16/09/2007
Force remote reboot via sysrq
I’ve just had a kernel crash on a remote machine. Unfortunately kjournald died and I couldn’t write anything to the / (root) partition. I could ssh to the machine but I couldn’t start nor stop any services. I couldn’t call any shutdown scripts either. My only hope was to force, somehow, the machine to hard reboot remotely, but how ? The solution was to use the magic sysrq button (or trigger if you like)!
Since my kernel already supported sysrq and it was enabled, I only had to:
echo b > /proc/sysrq-trigger
and the machine rebooted just as if I had pressed the reset switch on the box.
The good news is that after one minute the machine was up and running, the bad news is that I have to find what caused the kernel crash. It’s the third time it happens since January on the same machine…
P.S. ipt_sysrq looks quite interesting now…hmm….
Filed by kargig at 02:46 under Linux
No Comments | 11,769 views