May 24

Linux: Force a filesystem check (old and new way)


Systems with init.d:

1. touch /forcefsck
2. reboot 


Systems with systemd:

1. check the current tune2fs setting
sudo tune2fs -l /dev/nvme0n1p3 | grep 'Maximum mount'

2. Set tune2fs to check
sudo tune2fs -c 1 /dev/nvme0n1p3

3. reboot

On reboot the drive partition will be scanned

4. After loggin back in set the system back:
sudo tune2fs -c -1 /dev/nvme0n1p2


Copyright 2021. All rights reserved.

Posted May 24, 2022 by Timothy Conrad in category "Linux

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B