Force fsck on next boot

diskThere are times when you want to do a filesystem health check. However, it’s not safe to run fsck on a mounted volume. The best option is to run it on next boot. To do that on Ubuntu (applies to many other Linux favours as well), run the following command:

$ echo y | sudo tee /forcefsck

The y written to the file ensures that fsck doesn’t wait for user input. This is useful for remote connections.
The reverse (to skip fsck) is the following:

$ sudo touch /fastboot

Leave a Reply

Your email address will not be published. Required fields are marked *