Tuesday, October 2, 2007

Force a Kernel Reboot the Not Nice Way

If you use Linux and rely on it every day there will be a day that comes where you will utterly screw yourself. What I mean is you can get a shell but nothing else works...and you're 1000 miles away. So how do you unscrew yourself?
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
This sends a kernel message to reboot the machine. Now this is a horrible, horrible way to reboot, it's essentially like hitting the reset switch. It does not allow the system to unmount drives or run cleanup scripts, so once things are back up you may have some housekeeping to do.

No comments: