If you want to force fsck with each reboot, there are few steps you need to follow.
- use
blkid
to identify the uuid for the partition.
amarcus@amarcus-desktop:~$ blkid
/dev/mapper/vgubuntu-swap_1: UUID="d24b0766-c9be-49ef-9022-8ccae4f79801" TYPE="swap"
/dev/mapper/vgubuntu-root: UUID="d414c4f9-da0d-42bf-8290-4bcb55b8d984" BLOCK_SIZE="4096" TYPE="ext4"
amarcus@amarcus-desktop:~$
- Use uuid or mount point to locate the partition in
/etc/fstab
amarcus@amarcus-desktop:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/vgubuntu-root / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=0AE0-795B /boot/efi vfat umask=0077 0 1
/dev/mapper/vgubuntu-swap_1 none swap sw 0 0
UUID=D41C-2F17 /mnt/WDElements auto umask=0022,gid=1000,uid=1000,x-gvfs-show 0 0
The last column that is a column 6, aka fsck PASS column is used by fsck to determine whether fsck should check filesystem before it is mounted and in which order given partitions in /etc/fstab should be checked
For root partitions, make sure that entry is set to 1
- Finally, set the mount counter for that partition to 1.
root@amarcus-desktop:~# tune2fs -c 1 /dev/mapper/vgubuntu-root
Explanation:
Basically, in step 1 you are identifying which partition you want to check at boot.
In step 2, you are making sure that it takes higher priory. It's useful if you are checking more than one partitions. It decide which should be taken up first, then second and so on.
In step 3, you are saying after how many mounts the partition should be checked. The argument 1 specifies that after one mount the partition should be checked. So basically it checks after each mount, i.e. after every restart.