fsck on reboot

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 8:20 am

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?

Laurent85
Level 16
Level 16
Posts: 6144
Joined: Tue May 26, 2015 10:11 am

Re: fsck on reboot

Post by Laurent85 » Tue Dec 29, 2015 8:26 am

Use:

Code: Select all

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

User avatar
Pierre
Level 19
Level 19
Posts: 9234
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: fsck on reboot

Post by Pierre » Tue Dec 29, 2015 10:53 am

you may have to goto a full shutdown, rather than a reboot,
- in order to get that to run, though.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 2:52 pm

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.

Mute Ant
Level 14
Level 14
Posts: 5135
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: fsck on reboot

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

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.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 3:22 pm

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.

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: fsck on reboot

Post by Cosmo. » Tue Dec 29, 2015 3:31 pm

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.

Laurent85
Level 16
Level 16
Posts: 6144
Joined: Tue May 26, 2015 10:11 am

Re: fsck on reboot

Post by Laurent85 » Tue Dec 29, 2015 3:35 pm

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.
Image

GeneBenson
Level 4
Level 4
Posts: 342
Joined: Fri Sep 17, 2010 9:55 pm

Re: fsck on reboot

Post by GeneBenson » Tue Dec 29, 2015 5:35 pm

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.

User avatar
karlchen
Level 20
Level 20
Posts: 11504
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: fsck on reboot

Post by karlchen » Tue Dec 29, 2015 6:41 pm

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:
Image
Linux Mint 19.2 64-bit Cinnamon, Total Commander 9.22a 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 7:11 pm

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.

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 7:22 pm

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.)

Cosmo.
Level 23
Level 23
Posts: 17830
Joined: Sat Dec 06, 2014 7:34 am

Re: fsck on reboot

Post by Cosmo. » Tue Dec 29, 2015 8:07 pm

Wheelspin wrote:(Nothing has been logged yet.)
Probably this long standing bug.

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Tue Dec 29, 2015 9:05 pm

Are you aware of any Mint plans to rectify it if Ubuntu can't be arsed?

elina
Level 1
Level 1
Posts: 13
Joined: Wed Dec 30, 2015 3:51 am

Re: fsck on reboot

Post by elina » Wed Dec 30, 2015 4:01 am

so complicated.

GeneBenson
Level 4
Level 4
Posts: 342
Joined: Fri Sep 17, 2010 9:55 pm

Re: fsck on reboot

Post by GeneBenson » Wed Dec 30, 2015 5:00 am

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. :(

Wheelspin
Level 2
Level 2
Posts: 62
Joined: Mon Jul 14, 2014 6:27 pm

Re: fsck on reboot

Post by Wheelspin » Wed Dec 30, 2015 4:42 pm

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.

Post Reply

Return to “Software & Applications”