Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My server running Debian lenny has just had a power cut recently and its come back up with the root partition in read only mode. I tried to remount the filesystem in read write mode with mount -n -o remount,rw / which then gave the output mount: block device /dev/hda1 is write-protected, mounting read-only.

But now the root filesystem isn't mounted at all so I can't run anything to mount the partition again or any other command for that matter such as shutdown because /bin/ isn't there.

Is there anything I can do remotely?

share|improve this question
add comment

1 Answer 1

You might be able to use something in usr (assuming that's still mounted).

But one thing you can do is use magic SysRq keys if it's compiled into your kernel.

echo 1 > /proc/sys/kernel/sysrq
echo e > /proc/sysrq-trigger
echo i > /proc/sysrq-trigger
echo s > /proc/sysrq-trigger
echo u > /proc/sysrq-trigger
echo b > /proc/sysrq-trigger

You should wait for around thirty seconds or so between commands (a few minutes after e).

This will terminate processes (e), kill any processes that haven't yet terminated (i), sync disks (s), unmount disks (u), and finally reboot your server (b). Hopefully that'll give you another chance at fixing it without needing physical access.

share|improve this answer
    
I'd try that but due to the bad disks which need fsck'ing is there any way to make sure thats forced and to automatically fix the errors, i'd rather it not sit there for input when it reboots due to fsck –  Jack Jan 6 '11 at 14:51
    
well, the way I know to run an fsck is to touch /forcefsck... which isn't really an option for you ;) even so, i don't think there's any way to force fsck in non-interactive mode. I'd try the magic sysrq and just go out there if that doesn't work. good luck –  Michael Lowman Jan 6 '11 at 14:56
    
I can get access to it in a few hours so, it's not too bad I guess. I'll go for it now. –  Jack Jan 6 '11 at 14:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.