The old convenient trick of creating a file /forcefsck
to force a file check on reboot does not work anymore since systemd
took over initialisation.
Change "Maximum number of mounts" (only ext file systems)
The quickest way, probably, is to temporarily change your Maximum mount count
to 1
. That will cause the kernel and e2fsck
to check the file system on the next reboot. However, this only works with ext file systems.
First check your current setting in case you want to restore to default later:
sudo tune2fs -l /dev/nvme0n1p2 | grep 'Maximum mount'
Substitute /dev/nvme0n1p2
by the device name of your system partition. Chances are this is set to -1
nowadays, disabling check based on the number of times the volume has been mounted.
Adjust the setting to 1
with the command:
sudo tune2fs -c 1 /dev/nvme0n1p2
Now reboot - the volume should be checked. After reboot, you should reset the value to what it was before in order to avoid the partition being checked everytime.
Change kernel parameter
Another way is to pass kernel parameters during boot that control the systemd services for file system check. fsck.mode=force
will force a file check.
To add a kernel parameter for a single time, boot to the Grub menu, highlight the entry and hit e. Move to the line starting with linux
, hit End to move to the last line, add a space and the kernel parameter. Hit Ctrl+x to close and continue booting.