REISUB, Force restarting Ubuntu safely

When all else fails try using the REISUB magic SysRq key sequence.

TL;DR

Hold down Alt + Sys Req and then type reisub

If you don’t have a Sys Req key you should have PrtScr which will work the same. Also, some laptops might require that you press Fn too.

Explanation

The magic SysRq key is a key combination understood by the Linux kernel, which allows the user to perform various low-level commands regardless of the system’s state. It is often used to recover from freezes, or to reboot a computer without corrupting the filesystem.

In this particular case, REISUB does the following:

1
2
3
4
5
6
unRaw (take control of keyboard back from X),
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes, forcing them to terminate immediately),
Sync (flush data to disk),
Unmount (remount all filesystems read-only),
reBoot.

for more info checkout the wikipedia page