[nSLUG] Forcing filesystem check on root
jthibo at chebucto.ns.ca
Wed Nov 3 13:25:43 AST 2004
What distro are you using? The RedHat (and probably Fedora Core,
although I've never really played around with it) /etc/rc.sysinit will
force a filesystem check if it finds the file /forcefsck. In Debian,
/etc/rcS.d/S10checkroot.sh will do the same.
But of course, if it fails for some reason, the system will be left in a
state requiring on location attention (I suspect you want to force the
check because this machine is having problems.)
The way I've done remote fscks on / manualy in the past has been to:
(I'll assume since your looking at /etc/rc.sysinit, that rebooting the
machine is not the end of the world.)
- Edit /etc/fstab and set / to mount ro,
- Set ssh to start in single mode (also ensure that networking is
brought up too),
- Set the bootloader to start the system in single at next boot,
- Reboot, wait a few minutes...,
- Log in, run fsck on /,
(assuming all goes well)
- mount -o remount,rw /,
- Edit /etc/fstab and set / back to rw,
- Set bootloader config back to normal,
- Reboot, enjoy.
And as always, YMMV, there may be special considerations which need to
be made for your specific setup.
On Tue, 2004-11-02 at 18:37, David Potter wrote:
> Is there a less invasive way to force/perform a check of the root
> filesystem (from a remote location) other than hacking /etc/rc.sysinit ?
More information about the nSLUG