Remote emergency reboot for Linux servers

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

I ran into a situation where my remote server was not able to reboot or shut down (well… reboot with the -f option does not always help). In this case we should be prepared for an “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 the 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