[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fsck on a mounted disk?



On Tuesday 11 March 2003 3:28 pm, Ron Farrer wrote:
> Hello,
>
> I have a machine that apparently has a bad spot on the disk. I'd like to
> run fsck on it, but the problem is the machine is headless and is only
> accessed remotely (ssh). Without pulling it out, hooking up a montior &
> keyboard, is there a way to run fsck safely, yet remotely, on a mounted
> partition (the disk only has one: root) without causing any (further)
> damage?

can you attach a serial console to it? if not, try the following:

kill all processes running on the box apart from init, bash, and your ssh 
session (the one with the lower pid is usually the server, the higher one is 
the session), then remount the disk read only ala

mount -o remount,ro /

if it doesnt remount, you have something running thats got a file open 
(possibly ssh) , but if it does remount, fsck accordingly, and remount with

mount -o remount,rw /

it would probably be a better idea to touch /etc/forcefsck and reboot - much 
safer choice imho

regards

waz



Reply to: