Friday, April 12, 2013

Getting Medieval on Linux Shutdown

Until today, I had never run into a circumstance where I couldn't reboot a linux box with the 'reboot -f' command.  A reboot this way is definitely not recommended, as it bypasses the system shutdown, doesn't unmount disks, etc.  So always try to use your typical 'shutdown -r now' type of reboot first.

If your machine has a disk error, it is possible that 'shutdown -r now' will never complete.  That is when you can try 'reboot -f'.  If that doesn't complete you have to kick it up a notch and utilize Magic SysRq.

First enable Magic SysRq:
echo 1 > /proc/sys/kernel/sysrq

Then use it remotely to reboot the machine at a very low level:
echo b > /proc/sysrq-trigger

No guarantee you will be able to remotely access that machine again, but it will be going down.

Thanks to http://blog.mohammadzadeh.info/index.php/howto-force-a-immediate-reboot

No comments:

Post a Comment