How to force a disk check on next restart on Ubuntu
sudo shutdown -rF now
-or-
make a file in the root ("/") directory called forcefsck
Tested on Ubuntu 10.10 .
I had to forcefully shut down a laptop today, and when it came back to life it did not seem all that well. Sometimes Ubuntu starts a spontaneous disk check but it had no such intentions this time. I could not do a "live" disk check since the disk was mounted and fsck sternly warned that I *will* destroy things if I continue. Well then, how to direct it to do it on next boot?
There are at least two ways of doing this: By issuing a restart from the command line with shutdown command, where in addition to the restart flag one also issues a Force disk check. Or by creating a temporary file that Ubuntu reads as a kind of flag on boot and then deletes.