Amazon Ad

Featured Post

Showing posts with label fsck. Show all posts
Showing posts with label fsck. Show all posts

Sunday, December 16, 2018

How to force an fsck of the boot partition


Run mount to identify the device name for the boot partition (/):


[root@moon 13:29:31 eyal]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=32523472k,nr_inodes=8130868,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
/dev/mapper/centos-root on / type ext4 (rw,relatime,data=ordered)

Check the frequency of the fsck of the boot partition:

[root@moon 13:29:36 john]# sudo tune2fs -l /dev/mapper/centos-root | grep "Maximum mount count"
Maximum mount count:      1

Check the last time the boot partition was fsck-ed:


[root@moon 13:29:36 john]# sudo tune2fs -l /dev/mapper/centos-root | grep "Last checked"
Last checked:             Tue May 15 16:40:51 2018

Change the fsck frequency to every reboot:

[root@moon 13:29:36 john]# sudo tune2fs -c 1 /dev/mapper/centos-root

Reboot:

[root@moon 13:29:36 john]# sudo reboot

Optional: Change the frequency back to what it was prior.