Dark-Fx.com

Linux: Forcing a system reboot
2008-12-10 09:33:50 posted by Dark-Fx
One of my machines has been having problems where the disk that / is on has been dropping out. This is especially irritating because I can no longer properly execute any commands, including the reboot command like so:

mythbox:~# reboot
-bash: /sbin/reboot: Input/output error

Clearly I wasn't going to be able to reboot my computer normally. Luckily I remembered about the magic sysrq way of rebooting. Unfortunately, I didn't think this was going to help because I'm 10 miles away from the machine, and can't get to it for another 7 hour or so. I dug in to how the sysrq stuff works, and you can do it on console by echoing to it.
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

Running these commands forced a reboot on the machine and it came back up happily.