I need to run fsck so that it automatically fixes problems (i.e., fsck -y). And because I am using "systemd" instead of "init" in the linux system, I cannot modify the /etc/default/rcS.
So what should I do to make this check run automatically?
I need to run fsck so that it automatically fixes problems (i.e., fsck -y). And because I am using "systemd" instead of "init" in the linux system, I cannot modify the /etc/default/rcS.
So what should I do to make this check run automatically?
In the structure of the /etc/fstab file you can request the filesystem to be checked each time the system is booted - example :
/dev/sda1 / ext4 errors=remount-ro,relatime 0 1
/dev/sda2 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs rw 0 0
The last column (6th) indicates in which order you want the filesystems be checked at boot time. 0 means no check, 1 the first check, 2 the second, ... Filesystem with the same pass number are checked in parallel.
For information and completness:
mount when mounting the filesystemdump
commandIf the filesystem check returns a fatal error during boot, you will be prompted to enter into the filesystem repair mode (basically single-user mode text console).