If you are having hard time rebooting a Linux server especially from remote using putty etc due to drive failure or high load averages the reboot command may fail to soft reboot the server if any process ends looping.
The sysrq-trigger is a magical key use to hard reboot the Linux server but please note that since its a hard reboot it may lead to data loss or file system corruption.
Before triggering the sysrq-trigger, you need to enable the sysrq
- # echo 1 > /proc/sys/kernel/sysrq
To enable the key permanently
- # echo “kernel.sysrq = 1” >> /etc/sysctl.conf
# sysctl -p
And then use the following command to trigger the hard reboot.
- # echo b > /proc/sysrq-trigger
It is advisable to use the above option only under extreme conditions where the reboot command is not helpful or not responding.