[HowTo] Disable / Turn off Hibernate completely!

Difficulty: ★★☆☆☆

This tutorial is to ensure you correctly turn off hibernation completely. You need to do this in 3 places in that order :

  1. systemd

    Create the following files:

  • /etc/systemd/sleep.conf.d/no-hibernate.conf

    • Add:

      [Sleep]
      # disable hibernation
      # doc : https://archived.forum.manjaro.org/t/turn-off-disable-hibernate-completely/139939
      AllowHibernation=no
      AllowHybridSleep=no
      AllowSuspendThenHibernate=no
      
  • /etc/systemd/logind.conf.d/no-hibernate.conf

    • Add:

      [login]
      # disable hibernation
      HibernateKeyIgnoreInhibited=no
      
  • Save and exit all

  • Test:

    sudo systemctl hibernate
    

    should fail with:

    Failed to hibernate system via logind: Sleep verb "hibernate" not supported
    
    I'm a N00b! I don't know how to to this: give me more help!

    Don’t worry! :slight_smile: Here is an example for the first file:

    1. Execute:
    sudo mkdir /etc/systemd/sleep.conf.d/
    sudo mkdir /etc/systemd/logind.conf.d/
    # If the above give: "mkdir: cannot create directory: File exists" that's OK!
    sudo nano --backup /etc/systemd/sleep.conf.d/no-hibernate.conf
    
    1. copy-paste the following text in there:
    [Sleep]
    # disable hibernation
    # doc : https://archived.forum.manjaro.org/t/turn-off-disable-hibernate-completely/139939
    AllowHibernation=no
    AllowHybridSleep=no
    AllowSuspendThenHibernate=no
    
    1. Ctrl+X, then Y and Enter to save.
    2. Repeat for each of the files in the section above.
  1. Desktop Environment
  • In KDE:

    Details
    1. Go to System settings:
    2. Type hibernate
    3. Click Energy Saving: and remove any traces of Hibernate and change it to Sleep or Shutdown

      Do this for all 3 tabs! :
      • On AC Power
      • On Battery
      • On Low Battery
    4. Hibernation also happens when your battery reaches critical condition during sleep, so click Advanced settings:

      and change that to Shutdown as well.
  • In Gnome:

    Details

    Adapt your gnome-shell extension to remove hibernate from the options.

  • In XFCE:

    Details
    • Sorry! Not running XFCE myself:
    • Try the KDE section
    • takes notes while you do it on XFCE and come back and leave a comment for me to edit this post for the next XFCE user. :innocent:
  1. Kernel
  • Change the /etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT and remove the resume=UUID= parameter.

  • Remove the resume item from the HOOKS= line in /etc/mkinitcpio.conf and perform a sudo mkinitcpio --allpresets

    I'm a N00b! I don't know how to to this: give me more help!

    Don’t worry! :slight_smile: /etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT just means there is a file /etc/default/grub which contains the word GRUB_CMDLINE_LINUX_DEFAULT and that you need to change it!

    1. Execute:

      sudo nano --backup /etc/default/grub
      
    2. Press Ctrl+W to start searching

    3. Type GRUB_CMDLINE_LINUX_DEFAULT Enter

    4. You’ll now see:

      GRUB_CMDLINE_LINUX_DEFAULT=
      
    5. with a whole bunch of :poop: behind it all separated by spaces. :wink:

    6. You’re looking for resume=UUID=SomeWeirdNumberCalledAGUID

    7. Before you do the next step, ensure there is at least one space left between the previous and next parameter.

    8. Remove resume=UUID=SomeWeirdNumberCalledAGUID and maximum one space!

    9. Verify again there is at least one space left before and after each parameter in that line or your computer will not boot any more! . If you’re unsure at this stage, press Ctrl+X then press N and try again at step 1

    10. You’re sure??? Well, then press Ctrl+X then press Y and Enter to save.

    11. Execute:

      sudo update-grub
      

    For mkinitcpio:

    1. sudo nano --backup /etc/mkinitcpio.conf

    2. Start the search functionality by pressing Ctrl+W (Meaning: W here is?) and type HOOKS= and Enter

    3. You will now see a line that has the word resume in it: remove that word and if you don’t see that word, just exit without saving by pressing Ctrl+X

    4. If you did find and remove the word, save and exit by Ctrl+X Y Enter and execute:

      sudo mkinitcpio --allpresets
      

So you’ve done all the above in one session?

  • Reboot

  • Final test:

    sudo systemctl suspend
    

Which should still suspend your system but non hibernate it any more!

11 Likes