Force Linux to reboot

How to force Linux to reboot when the reboot command does not work.

Enable the use of the magic SysRq option:

# echo 1 > /proc/sys/kernel/sysrq

Reboot the machine:

# echo b > /proc/sysrq-trigger
Answered by anonymous.

Even if you could not log on the system but sshd is working, you can force the Linux to reboot by:

ssh root@server_home 
'echo 1 > /proc/sys/kernel/sysrq; echo b > /proc/sysrq-trigger'

You can find a list of all the SysRq commands at:

https://en.wikipedia.org/wiki/Magic_SysRq_key

For example, shut off a system by ‘o’, invoke OOM killer by ‘f’.


If you want to force Linux to shut down, use o instead of b:

echo 1 > /proc/sys/kernel/sysrq; echo o > /proc/sysrq-trigger

Leave a Reply

Your email address will not be published. Required fields are marked *