Page 1 of 1

fsck on reboot

Posted: Tue Dec 29, 2015 8:20 am
by Wheelspin
I used:

tune2fs -C 2 -c 1 /dev/<boot partition>

to force a fsck on boot. However, it doesn't appear to do anything. Should I be expecting some sort of UI (textual or graphical) during the next boot to indicate the check in progress or is it completely silent?

Re: fsck on reboot

Posted: Tue Dec 29, 2015 8:26 am
by Laurent85
Use:

Code: Select all

sudo touch /forcefsck
Upon reboot a filesystem check will be run.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 10:53 am
by Pierre
you may have to goto a full shutdown, rather than a reboot,
- in order to get that to run, though.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 2:52 pm
by Wheelspin
I had already tried the forcefsck file, but I just tried it again with a full shutdown and it was no different. I get the grub menu then a black screen for a few seconds and then the login gui appears. There's no feedback that a file system check has occurred.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 3:06 pm
by Mute Ant

Code: Select all

man tune2fs
-C mount-count
Set the number of times the filesystem has been mounted. If set to a greater value than the max-mount-counts parameter set by the -c option, e2fsck(8) will check the filesystem at the next reboot.

So the first reboot wouldn't do a file check with -c2 -C2 (the next one would).

If you look in the logs, the kernel will have reported the boot activity.

The default setting for GRUB is quiet splash so you won't see the check when it happens...and if the journal is empty, a few seconds is all it takes, no test that the data is intact at all.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 3:22 pm
by Wheelspin
Yeah, I was following the man page when I ran it. Probably just typed it out wrong on here.
Mute Ant wrote:

Code: Select all

man tune2fs
If you look in the logs, the kernel will have reported the boot activity.
Which log and where?
Mute Ant wrote:

Code: Select all

man tune2fs
The default setting for GRUB is quiet splash so you won't see the check when it happens...and if the journal is empty, a few seconds is all it takes, no test that the data is intact at all.
[/quote]

ok, so what's the best way to turn off quiet splash temporarily?
Mute Ant wrote:

Code: Select all

man tune2fs
...and if the journal is empty, a few seconds is all it takes, no test that the data is intact at all.
[/quote]

How do I force it run a full FS check and disk integrity check? I'm seeing some odd system behaviour and I what to be sure that I've not got any disk corruption.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 3:31 pm
by Cosmo.
Wheelspin wrote:so what's the best way to turn off quiet splash temporarily?
If you see the grub menu and the entry for your system is marked press e. This gives you an editor window. Remove further down the parameter quiet and splash, than press F 10 to boot. This is a one time change which doesn't get stored.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 3:35 pm
by Laurent85
If the file /forcefsck was removed that would confirm the filesystem check was performed. If you need to manually run fsck you can boot the usb installation flash drive and use gparted or the command line.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 5:35 pm
by GeneBenson
Hi Wheelspin,

Have you tried sudo tune2fs -l /dev/<boot partition> ?
This will show you some interesting things like "Last checked:"
Should I be expecting some sort of UI (textual or graphical) during the next boot to indicate the check in progress or is it completely silent?
In my experience you don't get feedback on smaller partitions because it happens so fast. I only get feedback on larger partitions.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 6:41 pm
by karlchen
Wheelspin wrote:I used:
tune2fs -C 2 -c 1 /dev/<boot partition>
to force a fsck on boot. However, it doesn't appear to do anything.
Should this not read

Code: Select all

sudo tune2fs -C 2 -c 1 /dev/<boot partition>
because tune2fs requires root privileges?
Second question: Is the boot partition the same partition that holds the root file system / which you want to check?

I use the commandline

Code: Select all

sudo tune2fs -C MountCount /dev/sdaNo
every once in a while in order to schedule an fsck on the root filesystem during next reboot. And it has always worked as expected here. I.e. fsck will be run on the specified partition during next reboot, no matter whether warm boot or cold boot.

Note:
MountCount - mount count, usually set as interval between fsck's plus 1
No - number of partition on disk /dev/sda

--
P.S.:
I guess I will give the

Code: Select all

sudo touch /forcefsck
approach a try next time, provided long lasting habits don't make me type the commandline that I have got used to. :wink:

Re: fsck on reboot

Posted: Tue Dec 29, 2015 7:11 pm
by Wheelspin
GeneBenson wrote:Have you tried sudo tune2fs -l /dev/<boot partition> ?
This will show you some interesting things like "Last checked:"
Last Checked 11/02/2015. However, the forcefsck file is being removed.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 7:22 pm
by Wheelspin
Removing quiet splash from the boot options didn't reveal anything useful. Both of the log files:

/var/log/fsck/checkfs
/var/log/fsck/checkroot

contain the following:

(Nothing has been logged yet.)

Re: fsck on reboot

Posted: Tue Dec 29, 2015 8:07 pm
by Cosmo.
Wheelspin wrote:(Nothing has been logged yet.)
Probably this long standing bug.

Re: fsck on reboot

Posted: Tue Dec 29, 2015 9:05 pm
by Wheelspin
Are you aware of any Mint plans to rectify it if Ubuntu can't be arsed?

Re: fsck on reboot

Posted: Wed Dec 30, 2015 4:01 am
by elina
so complicated.

Re: fsck on reboot

Posted: Wed Dec 30, 2015 5:00 am
by GeneBenson
Hi Wheelspin,

One more thing to try. Have a look at /etc/fstab. Find the entry for your boot partition. The very last number on the right needs to be a "1". If it is "0" fsck will skip checking it. If you have any other partitions you want to check, excluding "Swap", then their values should be set to "2". Like this:

Code: Select all

UUID=0b361f58-db4b-4dd6-9ca0-fb84d0bdba33   /               ext4    noatime,errors=remount-ro 0       1
UUID=bb1e1afb-a24e-4671-a3fa-b3be3fe193df   /mnt/Backup     ext4    defaults,noatime   0       2
Are you aware of any Mint plans to rectify it if Ubuntu can't be arsed?
I see the same on Debian so the problem not just a Ubuntu/Mint issue. Will it ever be fixed? Who knows. :(

Re: fsck on reboot

Posted: Wed Dec 30, 2015 4:42 pm
by Wheelspin
GeneBenson wrote:One more thing to try. Have a look at /etc/fstab. Find the entry for your boot partition. The very last number on the right needs to be a "1". If it is "0" fsck will skip checking it. If you have any other partitions you want to check, excluding "Swap", then their values should be set to "2
The root partition is set to 1. The rest are 0. Since it's the root that I'm trying to check, I assume that that's not the problem.