HOW-TO: magic reboot commands in Linux

From Tayledras
Jump to: navigation, search

Overview

"Magic reboot commands" are sometimes necessary if a system is especially unresponsive - such as when the root filesystem is read-only.

Examples

For example, say you have a system that has gone read-only, and you need to reboot it. But when you issue a “reboot” or “shutdown -r now”, the system responds like this:

 # shutdown -r now
-bash: /sbin/shutdown: Input/output error

In this case you can execute the following two “magic” commands:

 echo 1 > /proc/sys/kernel/sysrq
 echo b > /proc/sysrq-trigger

References