PDA

View Full Version : Forced disk check after 30(?) reboots...



wildcard442
18th January 2010, 03:10 AM
You know how you have to do the forced disk check after you reboot / mount the drive 30 (can't remember exact number)? How do I run this manually? I would like to be able to do a disk check (while logged in) at a time that works (like overnight), rather than on boot up. Sometimes I need my machine right away and this is a huge PITA.

Is there a command I can run that will check the disks and reset the counter? Is there a way I can check the counter to see how many more reboots until it is forced?

I have a main OS drive and 3 file server drives. I probably wont be able to do the OS drive (have to unmount it) but I would like to do this for the other drives.

Thanks!!

marko
18th January 2010, 03:52 AM
Suppose you have a partition /dev/sda3, this will show your super block where all the settings for the mount count and last fsck time are stored.

tune2fs -l /dev/sda3

This would set your mount count limits to 30 and 35 and 31 and 36 days

tune2fs -c 30 -i 31d /dev/sda1
tune2fs -c 35 -i 36d /dev/sda3

To do the check at the next boot, just put in a fake "mount count" with -C (note the big C) that's bigger than the 'max mount count'
that was shown by the tune2fs -l output.

I pick a different value for the mount counts and times so both partitions don't check at
the same time.

wildcard442
18th January 2010, 04:40 AM
do you have to do it at boot time? Can I unmount and do it while the system is running and then remount it?

marko
18th January 2010, 05:01 AM
do you have to do it at boot time? Can I unmount and do it while the system is running and then remount it?

Sure, if the volume isn't being used you can un mount it and then
check it with e2fsck and remount

wildcard442
29th January 2010, 02:13 AM
does e2fsck automatically reset the count, or do I have to use a particular parameter?

so e2fsck -i -y /dev/sda1/ would work?

marko
1st February 2010, 08:00 AM
there is no -i option for e2fsck that I see in the man page.

JohnJasonJordan
1st February 2010, 08:24 AM
It ought to be possible to add a feature that would resolve the problem.

I recently switched to Fedora 11 after a couple years with Ubuntu. For the past several versions of Ubuntu the forced check has an option to hit Esc to ignore the forced check until the next boot.

Now, I know at this point you're going to ask me how to get Fedora to do this. Sadly, I have no clue. But if Ubuntu can do it, it should be doable in Fedora. Perhaps someone smarter than me can chime in here.

wildcard442
5th February 2010, 01:54 AM
there is no -i option for e2fsck that I see in the man page.

I just ran e2fsck -v -y on one of my partitions (created with LVM if that matters) and it didn't reset the "mounts since check count".. is there another parameter i am missing with e2fsck ?