How to Force an Fsck on the Next Reboot
Continuing on my current run of Linux Tech pieces:
I recently needed to do a full filesystem check on my MythTV DVR box, as it was behaving strangely. Doing this from the command line is fairly hard, as you have to switch runlevels and then unmount your drives.
It's also almost impossible to do remotely, as SSH will shutdown when you switch to single user mode.
As a solution, you can reboot and force the check as it comes back online. to do this, run the following:
touch /forcefsck
reboot
When it comes back up, it should be clean! That is, of course, unless it finds problems and needs user interaction. Then you're SOL. There's got to be a better way to do this.
Stolen from perturb.org




