REISUB / REISUO

Original post by @đabby Manjaro Forum

Difficulty: ★★☆☆☆

REISUB (also known as the magic SysRq key) is a mnemonic for:

  • Rise up
  • Reboot Even If System Utterly Broken
  • Raising Elephants Is So Utterly Boring

and is a gentle way of rebooting your system by doing

  1. Switch the keyboard from Raw mode, used by programs such as X11 and SVGALib, to XLATE (translate) mode.
  2. Send an End signal (SIGTERM) to all processes, except the boot process, allowing all processes to end gracefully.
  3. Send an Instant kill (SIGKILL) to all processes, except the boot process, forcing all processes to end.
  4. Sync all mounted filesystems, allowing them to write all data to disk.
  5. Unmount and remount all mounted filesystems in read-only mode.
  6. ReBoot the system

In fact, the only data you lose is since your last [auto]save as the system is shut down gracefully.

Before you read any further, ensure all your work is saved!

How to invoke the REISUB procedure?
First we have to unlock the SysRq key so:

  • Add to your grub GRUB_CMDLINE_LINUX_DEFAULT the sysrq_always_enabled=1 variable.
  • Execute echo kernel.sysrq=1 | sudo tee --append /etc/sysctl.d/99-sysctl.conf
  • Reboot normally if you had to add one of these parameters and come back here to read the rest of the blurb...

There is a special System *R equest key on most keyboards called SysRq on all English language and most international keyboards.

Stamp (or Stampa on old Olivetti keyboards)
S-Abf

  • on full-size keyboards it's called by pressing Alt+SysRq
  • on most laptop keyboards it's called by pressing Fn+Alt+PrtSc
  • On some keyboards, please also try Alt+PrtSc if the SysRq key is missing or Alt Gr+SysRq if none of the above Alt combinations work .

Once you've located your SysRq key, please keep the Alt key pressed.

Test

Now lightly tap these keys waiting between 1 second (fast, new machines) and 6 seconds (older or resource-starved machines¹) in-between keypresses : REISUB

If you actually followed the above instructions, your system just rebooted gracefully and you did not damage your HDD (if you still have one) by forcing it into PARK mode forcefully nor was your EXT4 or NTFS transaction journal rolled back.

  • For even more info, [Read the Fine Manual ][6]
  • If a REISUB just restarts your DE just do a REISUO after the REISUB.
  1. Read the REISUB section above and then you'll know what this means:

  2. REISUO will turn your machine off instead of rebooting it...

  3. Sometimes (If only the UI is frozen), you can still switch to one of the TTYs by pressing Ctrl+Alt+F2 or F3, ... and gently tap the power button there.

  4. To do the same from within your Desktop Environment (DE) this has to be set up beforehand!
    So to ensure that your power button effectively shuts down your computer instead of going to sleep / Hibernate / ... in the future , follow these steps for your DE:

    • In Gnome:
    • Execute the following command:
      gsettings set org.gnome.settings-daemon.plugins.power button-power 'shutdown'
    • In KDE:
    • Go to System Settings
    • Type energy
    • Click Energy Saving
    • in all of the On AC Power, On Battery and On Battery tabs, set the check-mark on Button events handling and the Even when an external monitor is connected
    • When power button pressed to Shut Down
    • Click Apply
    • In XFCE:
      • Go to the Applications menu or System settings
      • Clock Power Manager
      • From When Power Button is pressed: select Shutdown.