How to fsck a Linux system at boot time

The old method of creating a file with “touch /forcefsck” should still work on modern systems even though it is a hangover from the old sysvinit days, however it obviously relies on the root partition being mountable in order to read that flag.

I have found a new method mentioned on lists.fedoraproject.org which I can confirm works perfectly on Fedora(30).

At the grub boot menu, use “e” to edit the boot entry to be used, and at the end of the boot parameter line add fsck.mode=force , this will fsck all the filesystems which is useful if the root partition was not mountable at boot time.

Posted here for my later reference as it is the sort of thing I will need again.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.