Typically you can have 4 TTY sessions open at once.
Alt
+ PrtSc
+ r
Alt
+ <
/>
Once you have access to a responsive TTY, you can try to shut down the system with shutdown
, halt
, and poweroff
again. If this does not work, you can try the systemd
commands, or directly try the so called Magic SysRq
key commands.
Administrative rights are needed. systemd
will automatically ask you for the root password.
COMMAND | DESCRIPTION |
---|---|
systemctl reboot | Shut down and reboot the system. |
systemctl poweroff | Shut down and power-off the system. |
systemctl suspend | Suspend the system. |
systemctl hibernate | Put the system into hibernation (write RAM to disk). |
systemctl hybrid-sleep | Put the system into hybrid-sleep state (write RAM to disk, then suspend). |
systemctl suspend-then-hibernate | Suspend the system, then wake up after a configured time to just hibernate the system. |
systemctl soft-reboot | Perform a reboot of the userspace-only with a soft-reboot. |
SysRq
key #If just changing the virtual TeleTYpe (TTY) does not help then it makes sense to try the Magic SysRq
key combinations. They are primarily used as a safer alternative to a cold reset when the system has completely crashed. This is because commands, such as those for syncing and unmounting the file system, can help prevent damage and data corruption before resetting or rebooting.
Some keyboards may not provide a separate SysRq
key. In this case, a separate PrtSc
(print screen) key should be present.
To initiate a graceful shut down of the system, perform all three commands in the given order (from top to bottom):
COMMAND | DESCRIPTION |
---|---|
Alt + PrtSc + s | Sync all mounted filesystems. |
Alt + PrtSc + u | Remount all mounted filesystems read-only. |
Alt + PrtSc + o | Shut down the system. |
The key combinations Alt
+ SysRq
+ [LETTER]
are generally known as Magic SysRq
commands which directly send commands to the kernel.
On certain devices, particularly laptops, the Fn
key may need to be pressed to use the magic SysRq
key. For example, on the many Lenovo laptops, SysRq
is triggered by pressing Alt
+ Fn
+ S
simultaneously, then releasing Fn
and S
while continuing to hold Alt
. On a ChromeOS device, SysRq
is activated by pressing Alt
+ Volume Up (F10)
+ [LETTER]
.
By following safe shutdown methods for unresponsive Linux systems, you can avoid potential data corruption and system damage. Understanding these alternative techniques ensures you can handle crashes without risking your system’s integrity.
Always prioritize graceful shutdowns over forced power cuts!
Sources and recommended, further resources on the topic:
License: How to shut down a frozen Linux system by Jonas Jared Jacek is licensed under CC BY-SA 4.0.
This license requires that reusers give credit to the creator. It allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only. To give credit, provide a link back to the original source, the author, and the license e.g. like this:
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"><a property="dct:title" rel="cc:attributionURL" href="https://www.ditig.com/instructions/how-to-shut-down-unresponsive-linux-system">How to shut down a frozen Linux system</a> by <a rel="cc:attributionURL dct:creator" property="cc:attributionName" href="https://www.j15k.com/">Jonas Jared Jacek</a> is licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="license noopener noreferrer">CC BY-SA 4.0</a>.</p>
For more information see the DITig legal page.