Enable Hibernation (Suspend to Disk)
State of Hibernation on Pop!_OS
Hibernation is not currently enabled on Pop!_OS by default. There are several limitations that keep this from being a default:
- Pop!_OS' Default Partition Layout
- Use of a non-persistent encryption key for SWAP.
- Additional drive I/O used on Solid State Drives (SSDs)
- Depending on alloted RAM in a system, and size of NVMe/SSD drive(s), hibernation could add notable delay on resuming a hibernation session.
However, these limitations aside, hibernation is an often requested feature for Pop!_OS. The purpose of this article is to provide steps for enabling hibernation for any users that would like it. Since hibernation completely shuts off power to the device, it can prolong the lifetime of your battery. Additionally, there are some security benefits. Unlike suspend, the decryption key for the disk no longer remains in memory, and the disk is locked. This mitigates certain physical attacks that can extract the key from RAM.
Enable Hibernation on an Encrypted Drive
Boot into Pop!_OS Recovery
Turn your computer off, then turn it back on and hold down the
SPACEbar immediately. In the menu that appears, select
PopOS Recovery, and let it boot.
Once it boots, close out of the installation window or choose
Try Demo Mode(be sure not to choose any install or repair options, as this could result in data loss. It will also mount the drive and make the next steps harder).
Applicationsand searching for "Gparted" or by pressing
Tto open a Terminal, and running:
Disable and remove the SWAP partition. You can either right-click on the SWAP partition, and select
swapoffor issue that same command in the Terminal:
Then click on the swap partition, click the red
Xto mark it for deletion, and then press the green check-mark to approve the changes.
lukspartition to the end of the drive.
Click on the encrypted
lukspartition and select the "Resize/Move" button. Use the GUI drag tools, or number fields, to make sure the OS partition extends to the end of the drive (after
recovery). Use the green check-mark to apply the changes to the drive and close
gpartedonce the changes are complete.
Open the encrypted partition using these Terminal commands:
SATA Drives NVMe Drives
sudo cryptsetup luksOpen /dev/sda3 cryptdata
sudo cryptsetup luksOpen /dev/nvme0n1p3 cryptdata
NOTE: In the screenshot example, the partition is called
/dev/vda3. Adjust the drive name to your case (sda# or nvme#n#p#).
sudo lvscan sudo vgchange -ay
Reduce the size of the root volume by the size of main memory. If you have 16GB of memory, reduce the
data-rootvolume by 16GB. If you have 32GB, reduce by 32GB, etc. Use these Terminal commands:
free -h sudo lvreduce -r -L -16G /dev/mapper/data-root
swapvolume (instead of a drive partition):
sudo lvcreate -L 16G --alloc contiguous --name swap data sudo mkswap /dev/data/swap
rootfilesystem and edit
fstabto update for the new
sudo mount /dev/mapper/data-root /mnt
crypttabto remove the original swap partition entry.
sudo nano /mnt/etc/crypttab
fstabto update the mount path for the new swap volume.
# swap mount line will be changed to # /dev/mapper/data-swap none swap defaults 0 0 sudo nano /mnt/etc/fstab
Reboot your computer and allow it to load Pop!_OS normally. Check that the swap partition in use and is sized for your system memory by running the following command in a terminal:
Add a resume target for the kernel:
Using the UUID for the
data-swappartition run this command:
sudo blkid # use the UUID for the /dev/mappter/data-swap line from the output of blkid sudo kernelstub -a "resume=UUID=xxxxxxxx-xxxx-xxxx-xxxxxxxx"
NOTE: Replace everything after
UUID=with the ID of your new
The system should now be ready to suspend to, and resume from disk.
You can test if hibernation works by booting back into your install and running:
sudo systemctl hibernate
CAUTION: Hibernation, if used often, will add additional write traffic (equal to the total amount of RAM) to SSDs, shortening the lifespan of the drives.
Desktop Integration - GNOME Extension
Hybrid Sleepto the power menu, we'll need to add this GNOME-Shell extension: Hibernate Status Button
NOTE: Pop!OS and Ubuntu require a file at
To create this file, run:
sudo nano /etc/polkit-1/localauthority/10-vendor.d/com.ubuntu.pkla
Then copy these contents into the newly created file:
[Enable hibernate in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Enable hibernate in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=yes
Save (ctrl+s) and close the file (ctrl+x).
On your next boot, you should now have an
Hibernate option in the top-right, drop-down,
Power Off / Logout Options menu. The
Hibernate option is located alongside the existing
Power Off options.