Monday, December 17, 2012

Ubuntu Freezing? Piece of Cake

Safely reboot after Ubuntu freezes.

Have you ever had the problem that Ubuntu freezes ? You type on your keyboard,
you move the mouse but nothing really happens. As last resort we use the
"Hard reset" button. Everybody knows this is bad for your pc,
it can causse severe damage to your hardware.

So now we ask ourselve... Is it possible to reboot the system in a safe way?
The answer is: YES!

First you got to find your SysRq button on your keyboard, mostly it's the same as Prt sc (print screen).

- To use this magic, you should check the value of "/proc/sys/kernel/sysrq" file by typing the following command:
cat /proc/sys/kernel/sysrq

- If it prints "1", your good to go. If not edit it with the following command :
sudo echo "1" > /proc/sys/kernel/sysrq

- When your Ubuntu freezes, simply press and hold :
Alt + SysRq

- While holding the Alt and SysRq keys down, type the following keys in order, pausing for several seconds in between each key:

Command list:
r – Puts the keyboard into raw mode, taking control of it away from the X server.
e – Sends the terminate signal to all processes, asking them to end gracefully.
i – Sends the kill signal to all processes, forcing them to end immediately.
s – Flushes data from your cache to disk.
u – Remounts all file systems read-only.
b – Reboots your computer.