How to force fsck to check filesystem after system reboot on Linux when using systemd
The procedure is as follows:
- Edit the /etc/default/grub file on Debian
- Find line that read as GRUB_CMDLINE_LINUX_DEFAULT and append the fsck.mode=force. You may have other config options. Just add it between the quote marks. For example:
GRUB_CMDLINE_LINUX_DEFAULT="quiet fsck.mode=force". To force all auto repair option including that may cause damage add the fsck.repair=yes option too. - Then run an sudo update-grub
- Reboot the system by typing the sudo reboot
- After that system will boot. The system will run fsck on ext4 file systems.
- Finally, when you get a shell prompt, make sure you remove the fsck.mode=force config option from the /etc/default/grub file and run the update-grub command again.
