Today I had a machine I was working on spit the dummy in a really bad way. It had a tonne of IO errors to its root filesystem and eventually decided to remount it read only. Of course this meant that it was almost entirely wedged. I tried the reboot command, the init command and everything would lockup my terminal. Not having console or physical access to the machine I couldn’t simply hit the power button, so I used the Linux magic commands:
# echo 1 > /proc/sys/kernel/sysrq
# echo b > /proc/sysrq-trigger
Of course the disk errors meant that it was unable to boot but ‘The Big Hammer’ struck me as something extremely useful.
Hiya Daniel,
Before sending the ‘b’ it is always worth sending ‘s’, ‘u’ and ‘s’ again – force a sync, remount all FS’s r/o and then sync again.
Best of luck with resurrecting the box!
I can’t believe that this stuff has a
procfsinterface! That’s totally awesome.@chris Normally yes, but in the light of many many disk errors I preferred to have the machine simply reboot. Plus everything had already become read only at that point anyway. I’m not yet sure if the machine (and the data) is cool, but luckily I have backups.
@Alex there is all kinds of cool stuff in procfs, I should write a post about the best bits.