I've had some system instability on my laptop for the first time in ages, and had to recall a trick I learned several years back. On a linux machine, even if everything else is entirely locked up, one can safely reboot. The gist is, by using the Magic SysRq key you can force low-level commands in. This consists, on my laptop at least, of holding left alt and the print screen key down while typing out the letters REISUB, with the mnemonic "Reboot Even If System Utterly Broken". Personally, I think about the store REI and submarines. Each letter sends a specific command, namely:
- R - This takes the keyboard input away from the X session
- E - Sends SigTerm to all processes, asking them nicely to shutdown
- I - Sends SigKill to all processes, forcing them to shutdown
- S - Syncs all changes to disk
- U - Unmounts all file systems
- B - Reboots the machine
With all the processes stopped, all changes written to disk, and all file systems unmounted, there is no risk of file system corruption when rebooting with this method. If you follow the link above you can see that there are a good many things you can do with the Magic SysRq key, even intentionally initiate a system crash, but the sequence above seems to be the single most useful.