Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: mbertrand on April 16, 2013, 11:46:38 AM

Title: e2fsck
Post by: mbertrand on April 16, 2013, 11:46:38 AM
When TC regenerates the fstab it sets the sixth column for the e2fsck to zero which disables it. Does that mean it will not run
when system is not shut down properly. For example the rebuilding of what in the journal is done by e2fsck?
Title: Re: e2fsck
Post by: Rich on April 16, 2013, 11:52:49 AM
Hi mbertrand
Yes, you need to make sure the drive is unmounted and run e2fsck manually. This may mean booting from a CD
if the drive in question is your boot drive. If you go to the search page and enter  e2fsck  you should find other threads
that have discussed this.
Title: Re: e2fsck
Post by: mbertrand on April 16, 2013, 12:49:00 PM
Well I searched and I can seem the find answer to following question: when does fsck run?
Title: Re: e2fsck
Post by: curaga on April 16, 2013, 12:53:29 PM
TC does not run fsck for you.
Title: Re: e2fsck
Post by: mbertrand on April 16, 2013, 01:19:04 PM
Sorry for not understanding then who does the Kernel? What is fstab 6th column actually do?
And what about counter and max counter for fsck?
When I run "tune2fs -l /dev/sdb1" I see my counter is greater then my max counter and the last date never changed.
Like it never ran. Do you know what are the condition for it to run?

My messages file has "EXT4-fs (sdb1): warning: maximal mount count reached, running e2fsck is recommended" Should this had not run when I rebooted if my counter reached its max?
Title: Re: e2fsck
Post by: gerald_clark on April 16, 2013, 01:32:23 PM
If you want fsck to run, you must run it manually after making sure the filesystem is not mounted.
Core is not a full blown distribution like Ubuntu.
It is a toolkit.  You must learn what tools are available and how to use them.
Title: Re: e2fsck
Post by: mbertrand on April 16, 2013, 01:35:06 PM
That's ok I just wanted to make sure  nothing was wrong.
Title: Re: e2fsck
Post by: gerald_clark on April 16, 2013, 01:40:18 PM
Yes.  We are not running sysv init.  The init is a shell script: /etc/init.d/tc-config.
Title: Re: e2fsck
Post by: tinypoodle on April 16, 2013, 04:33:28 PM
Yes, you need to make sure the drive is unmounted and run e2fsck manually. This may mean booting from a CD if the drive in question is your boot drive.

Hmm...
This makes me realize that I have never given attention to boot loader access following an unclean shutdown.
Wondering now if there could be a risk.
But the way I remember traditional scatter GNU systems, they would mount "/" read-only at first to be able to run a "fsck -n" at each boot, but then that happens way after the boot loader is done and has handed over to the kernel.
Title: Re: e2fsck
Post by: gerald_clark on April 16, 2013, 05:47:34 PM
Unless you have opt= or home= bootcodes, the disk is only written to during the 'backup' phase of shutdown.
Title: Re: e2fsck
Post by: tinypoodle on April 16, 2013, 06:25:29 PM
That depends on user's habits and on mode.
In mount mode /tce dir must be mounted read-write and is written to not only when downloading extensions but also when using functions of "tce-audit".

Personally I try to run backup frequently, to reduce risk of data loss.
Statistically I have probably accessed mydata.tgz as a literal backup to restore prior versions of selected files more often than running restore at boot.
I happen to hardly ever voluntarily run shutdown (I do use suspend).

In any case, if backup is written to disk at shutdown, then most likely it is not an unclean shutdown which would require a fsck before mounting fs read-write.
Title: Re: e2fsck
Post by: aus9 on April 16, 2013, 08:08:12 PM
guys

What about this idea?  It looks like e2fsck (for us normal users) is a part of base.

If we had  e2fsck.tcz (= e2fsprogs.tcz) and we loaded it then ran
Code: [Select]
sudo umount /mnt/sdxn
sudo e2fsck /dev/sdxn

eg sdxn = sda1

Would that work?

I hope so as I assume the tcz is in RAM

If so,  I could volunteer to have a go at submitting one. I am a dinosaur and use only Linux type partitions so not sure what others might use.
Title: Re: e2fsck
Post by: Rich on April 16, 2013, 08:19:21 PM
Hi aus9
You can't unmount the drive if it's in use. So that means no extensions on that drive loop mounted, and no persistent
/home or /opt. That's why I suggested booting from a CD, possibly with the base boot code so it doesn't try to mount
extensions from a hard drives /tce directory.

Title: Re: e2fsck
Post by: aus9 on April 16, 2013, 08:28:22 PM
Rich

Fair enough

Do SCMs get loaded into RAM and not loop mounted?
Title: Re: e2fsck
Post by: Rich on April 16, 2013, 08:33:43 PM
Hi aus9
SCMs are loop mounted. I don't know if there is a copy to RAM option for them.
Title: Re: e2fsck
Post by: Juanito on April 16, 2013, 11:13:53 PM
Just boot (or make a boot menu entry) with the codes "base norestore", then you will be able to run e2fsck and reboot normally (or run "sudo tce-setup") once it finishes.
Title: Re: e2fsck
Post by: curaga on April 17, 2013, 03:02:22 AM
Quote
What is fstab 6th column actually do?

It is the fstab order, for when you run fsck -A.

Quote
The sixth field, (fs_passno), is used by the fsck(8) program to  deter-
       mine the order in which filesystem checks are done at reboot time.  The
       root filesystem should be specified with a fs_passno of  1

Those with a lower number are checked first.