0

I want to check my filesystem. It has to be unmounted, so I found that I should

$ sudo touch /forcefsck
$ reboot

I did that on Sat Dec 30 10:02 2017 (approx.) After rebooting, this is what I get (pasting only the relevant info)

My partitions:

$ sudo fdisk -l
Device     Boot Id Type
/dev/sda2  *    83 Linux
/dev/sda3        5 Extended
/dev/sda4       83 Linux
/dev/sda5       82 Linux swap / Solaris
/dev/sda6       83 Linux
/dev/sda7       83 Linux

Where is each one mounted (could have used other commands, I know):

$ df -h
Filesystem   Mounted on
/dev/sda6    /
/dev/sda4    /mnt/old-home
/dev/sda7    /home
/dev/sda2    /boot

Last time each parittion was checked:

$ sudo tune2fs -l /dev/sda2 | grep -i check
Last checked:             Sat Dec 30 10:02:48 2017
Check interval:           0 (<none>)
$ sudo tune2fs -l /dev/sda4 | grep -i check
Last checked:             Thu Nov  3 17:39:51 2016
Check interval:           0 (<none>)
$ sudo tune2fs -l /dev/sda6 | grep -i check
Last checked:             Fri Nov  4 12:08:31 2016
Check interval:           0 (<none>)
$ sudo tune2fs -l /dev/sda7 | grep -i check
Last checked:             Sat Dec 30 10:02:04 2017
Check interval:           0 (<none>)

I expected /dev/sda6 (i.e., /) to be checked, but it was not.

Is that correct?

What is the correct way to check /? I think I am currently unable to boot from a Live CD/USB.

1 Answers1

1

You can set the Maximum mount count to 1 and reboot which should start the fsck.

Before doing so, note down the default value you get with the command as follows. In the following example we will use /dev/sda6 as an example.

tune2fs -l /dev/sda6 | grep 'Maximum mount count'

Then set the value to 1.

tune2fs -c 1 /dev/sda6

Then reboot and the filesystem check should start.

Thomas
  • 6,223
  • I did this, and then $ sudo touch /forcefsck $ reboot. I cannot find evidence that / was checked. E.g., referring to https://askubuntu.com/questions/112907/where-are-fsck-results-logged-at-boot-time-after-forcefsck, I tried journalctl -b --no-pager | grep systemd-fsck and cat /var/log/boot.log. Both report having checked /dev/sda2and /dev/sda7, but not /dev/sda6. – sancho.s ReinstateMonicaCellio Jan 03 '18 at 10:04
  • What is the timestamp reported with sudo tune2fs -l /dev/sda6 | grep -i check? – Thomas Jan 03 '18 at 19:00
  • It reports Last checked: Wed Jan 3 06:38:19 2018. So it seems to have checked /dev/sda6. If so, why the difference with journalctl ... and /var/log/boot.log? – sancho.s ReinstateMonicaCellio Jan 04 '18 at 07:04