Sysrq: Difference between revisions
Created page with "The magic SysRq key provides a way to instruct the kernel through the {{code|/proc}} pseudo-filesystem. It must be enabled with the kernel during compile time with the {{code|..." |
m Updated categories |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 27: | Line 27: | ||
* http://en.wikipedia.org/wiki/Magic_SysRq_key | * http://en.wikipedia.org/wiki/Magic_SysRq_key | ||
[[Category:Linux]] | {{Navbox Linux}}[[Category:Linux]] | ||
[[Category:LinuxUtilities]] | |||
Latest revision as of 01:29, 30 December 2021
The magic SysRq key provides a way to instruct the kernel through the /proc pseudo-filesystem. It must be enabled with the kernel during compile time with the CONFIG_MAGIC_SYSRQ option and is standard for most distributions.
Rebooting
Suppose you have a system that you can SSH into but cannot reboot because the system disk is dying or the SATA bus is in some weird state and no IO is actually working.
# reboot
bash: /sbin/reboot: Input/output error
# shutdown -r now
bash: /sbin/shutdown: Input/output error
Or perhaps the system disk is fine, but sync() isn't returning which causes reboot to hang even with the -f option.
To reboot the machine in such a state, enable sysrq and write 'b' to the sysrq-trigger.
## Enable sysrq
# echo 1 > /proc/sys/kernel/sysrq
## Reboot the machine without sync immediately
# echo b > /proc/sysrq-trigger
See Also
- https://www.mjmwired.net/kernel/Documentation/sysrq.txt
- http://en.wikipedia.org/wiki/Magic_SysRq_key