Force fsck
on reboot for Ubuntu 20.04
The Maximum mount
setting for ext4
file system can be used to enforce fsck
to be executed on root file system.
Check current value
sudo tune2fs -l /dev/nvme0n1p2 | grep 'Maximum mount'
Note: 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