Remote emergency reboot for Linux servers

Sep 25, 2014 00:00 · 88 words · 1 minute read Linux

I got the situation, when my remote server was not able to reboot or shutdown (well.. reboot with option -f does not help sometimes). In this case we should be prepared for “emergency reboot” (this is pretty much the same as pressing the reset button on the server).

Preparation steps - we should stop all unnecessary daemons (services), unmount unnecessary disks and flush the data to disks.

So, time for “magic commands”:

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