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
So what should I do to make this check run automatically?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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:
mountwhen mounting the filesystem
If 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).