[clug] Debian Jessie file system checking on boot up

George at Clug Clug at goproject.info
Tue Apr 5 10:11:09 UTC 2016

    Does anyone know how to get a Debian Jessie server to check and
repair its root file system on boot up ?

I have tried "shutdown -rF now" but this command fails with an error

And the below idea does not cause fsck to run either;
$ sudo touch /forcefsck 


On Debian, Ubuntu or Linux Mint, edit /etc/default/rcS as follows.

 $ sudo vi /etc/default/rcS 

# automatically repair filesystems with inconsistencies during boot

I tried moving fsck hook after systemd but it doesnt help. If I put
fsck.mode=force to kernel parameter, it fscks all other partition but
not root. Does anyone have a clue what could be the cause of it?



You can also force fsck at boot time by passing fsck.mode=force, as a
kernel parameter [1]. This will check every filesystem you have on the


fstab [2] is a system configuration file and is used to tell the Linux
kernel which partitions (file systems) to mount and where on the file
system tree. 

A typical /etc/fstab entry may look like this: 

/dev/sda1 / ext4 defaults 0 1 /dev/sda2 /other ext4 defaults 0 2
/dev/sda3 /win ntfs-3g defaults 0 0  The 6th column (in bold) is the
fsck option. 

	*  0 = Do not check.
	*  1 = First file system (partition) to check; / (root partition)
should be set to 1.
	*  2 = All other filesystems to be checked.
# systemctl status systemd-fsck-root.service

# systemctl disable systemd-fsck-root


# / was on /dev/sda3 during installation
UUID=e6fffa5a-8125-4feb-9743-9beeb581f11e   /    ext4   
noauto,x-systemd.automount,errors=remount-ro    0    0

[1] https://wiki.archlinux.org/index.php/Kernel_parameter
[2] https://wiki.archlinux.org/index.php/Fstab

More information about the linux mailing list