What's the difference between the magic REISUB reset and holding down the power key?

8,188

I'll try to explain those in an easily understandable way, but it might not necessarily be 100% complete or 100% correct.

  • R - switch the keyboard mode

    This is said to "Switch the keyboard from raw mode, the mode used by programs such as X11 and svgalib, to XLATE mode" (from Wikipedia), but I don't really know if this would normally have any notable effect.

  • E - gracefully terminate all running programs

    This sends the SIGTERM signal to all processes except init and thereby asks them to gracefully terminate, giving them a chance to tidy up and free their resources, save data, etc...

  • I - forcibly kill all running programs

    This is similar to the E, but sends the SIGKILL signal to all processes except init, which kills them immediately and forcibly.

  • S - sync all disks and flush their caches

    All your disks normally have a write cache, a piece of RAM where the system caches data it wants to save on the device, to speed the access up. Syncing tells the system to flush these caches now and perform all remaining writes. That way you do not lose any data that has already been cached but not been written yet, and it protects from leaving the file system in an inconsistent state.

  • U - unmount all disks and remount them read-only

    This is again pretty unspectacular, it simply makes all mounted disks read-only to prevent any further (partial) writes.

  • B - reboot the system

    This reboots the system. However, it does not perform a clean shutdown, but instead a hard reset.

However...

On Ubuntu, these SysRqs are normally masked and partially disabled. Only syncing, remounting read-only and shutting down/rebooting are enabled.

This is controlled by the kernel interface file /proc/sys/kernel/sysrq, which holds the decimal representation of a bitmask of the allowed SysRq actions. The Ubuntu default is 176. See this answer for loads of additional explanations and material.

So actually you could also just Alt + SysRq + { S | U | B }.

Share:
8,188

Related videos on Youtube

prab4th
Author by

prab4th

Updated on September 18, 2022

Comments

  • prab4th
    prab4th almost 2 years

    I found from googling that each letter stands for these:

    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.
    

    So if what B does is reboot, what difference does this make against just holding down the power key.

    And what's the significance of other letters (I don't understand the terms).

  • ravery
    ravery about 7 years
    also, if you change your system setting to shutdown when power button is pressed.a normal press(not hold down) will do a normal shutdown in most cases. pressing ctrl + alt + del will bring up the log off dialog, breaking minor hangups.
  • prab4th
    prab4th about 7 years
    But why are R E I disabled. If I followed the other answer and reenabled them, can it go wrong?
  • Byte Commander
    Byte Commander about 7 years
    @prab4th If you check the answer I linked, they describe the reason for the bitmasking below the headline "Why does RESIUB(O) not work?" near the top of the post.