How to force fsck in Ubuntu

Most of you may try to let servers run as long as possible to maximize availability in term of uptime. That is good. However, there is at least a side-effect originated by the nature of file system where as it is necessary to clean up something important. For example, ext2/ext3 should be checked for every 30 mounted or 180 days. It is fine to reboot a server once a year as long as the file system is not read/write too often, especially when there is very low free space. That's why you should force to run fsck sometimes.

In Ubuntu, it is very easy to force fsck at next reboot and also let it reboot right now using below command.

sudo shutdown -F -r now

However, you should let it fix possible problem automatically so you don't have to stay around its console by modifying FSCKFIX in /etc/default/rcS as follow.

FSCKFIX=yes

Tags: , , ,

Reply