I want to use hibernation with a LUKS encrypted main partition. Problem is, the machine state is not saved. After selecting “Hibernation” in the logout screen, the disk light shows much activity, then the machine is off. After pressing the power button LUKS asks for its passphrase, but then the GRUB boot happens and the saved state has not been restored.
I had run (in several solving attempts) hibernator
, then mkinitcpio -P
and update-grub
, each time successfully.
Early on in the search for a solution I observed a brief “ERROR: resume: hibernation device 'y' not found
” message and checked UUIDs, offset, and hooks.
The setup is a laptop with up-to-date Manjaro stable, kernel 5.10.34-1, KDE Plasma 5.21.4. The LUKS partition holds a btrfs with several subvolumes, swap is on /swap/swapfile.
Here are the (edited) backgrund data – I’m banging my head but can’t see what I’m doing wrong.
Details:
# ⬤ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1 vfat FAT32 1111-1111 510,3M 0% /boot/efi
└─sda2 crypto_LUKS 1 22222222-2222-2222-2222-222222222222
└─crypt_sda2 btrfs 33333333-3333-3333-3333-333333333333 894,6G 4% /run/timeshift/backup
sr0
# ⬤ df
Filesystem Size Used Avail Use% Mounted on
dev 3,9G 0 3,9G 0% /dev
run 3,9G 1,5M 3,9G 1% /run
/dev/mapper/crypt_sda2 932G 34G 895G 4% /
tmpfs 3,9G 128K 3,9G 1% /dev/shm
tmpfs 4,0M 0 4,0M 0% /sys/fs/cgroup
/dev/sda1 511M 720K 511M 1% /boot/efi
/dev/mapper/crypt_sda2 932G 34G 895G 4% /var/cache
/dev/mapper/crypt_sda2 932G 34G 895G 4% /home
/dev/mapper/crypt_sda2 932G 34G 895G 4% /swap
tmpfs 3,9G 51M 3,8G 2% /tmp
tmpfs 784M 148K 784M 1% /run/user/1000
/dev/mapper/crypt_sda2 932G 34G 895G 4% /run/timeshift/backup
# ⬤ /etc/fstab:
# /dev/sda1
UUID=1111-1111 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
# /dev/mapper/crypt_sda2
UUID=33333333-3333-3333-3333-333333333333 / btrfs rw,noatime,compress=zstd:3,ssd,space_cache,commit=120,subvol=@ 0 0
# /dev/mapper/crypt_sda2
UUID=33333333-3333-3333-3333-333333333333 /home btrfs rw,noatime,compress=zstd:3,ssd,space_cache,commit=120,subvol=@home 0 0
# /dev/mapper/crypt_sda2
UUID=33333333-3333-3333-3333-333333333333 /var/cache btrfs rw,noatime,compress=zstd:3,ssd,space_cache,commit=120,subvol=@cache 0 0
# subvol @swap is mounted in /swap and used for swapfile
UUID=33333333-3333-3333-3333-333333333333 /swap btrfs subvol=@swap,compress=no 0 0
/swap/swapfile none swap defaults 0 0
# ⬤ etc/crypttab:
# ... snipped ...
# <name> <device> <password> <options>
# home UUID=44444444-4444-4444-4444-444444444444 /etc/mypassword1
# data1 /dev/sda3 /etc/mypassword2
# data2 /dev/sda5 /etc/cryptfs.key
# swap /dev/sdx4 /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256
# vol /dev/sdb7 none
# ⬤ findmnt -no UUID -T /swap/swapfile
33333333-3333-3333-3333-333333333333
# ⬤ filefrag -v /swap/swapfile | awk '{ if(==0:){print substr(, 1, length()-2)} }'
1234567
# ⬤ /etc/default/grub | grep CMDLINE:
GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3 resume=/dev/disk/by-uuid/33333333-3333-3333-3333-333333333333 resume_offset=1234567 resume= resume= resume= resume=" # I guess hibernator kept adding "resume=" -??
GRUB_CMDLINE_LINUX="cryptdevice=UUID=22222222-2222-2222-2222-222222222222:crypt_sda2"
# ⬤ /etc/mkinitcpio.conf | grep -v ^#MODULES=()
BINARIES=()
FILES=(/crypto_keyfile.bin)
HOOKS=(base udev autodetect keymap modconf block encrypt filesystems keyboard resume)
# ⬤ mkinitcpio -P | grep '^==>.*'
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'default'
==> Starting build: 5.10.34-1-MANJARO
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux510.preset: 'fallback'
==> Starting build: 5.10.34-1-MANJARO
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.10-x86_64-fallback.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: 'default'
==> Starting build: 5.4.116-1-MANJARO
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux54.preset: 'fallback'
==> Starting build: 5.4.116-1-MANJARO
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-5.4-x86_64-fallback.img
==> Image generation successful
# ⬤ update-grub 2>&1 | grep -v '^Found snapshot'
Generating grub configuration file ...
Found theme: /boot/grub/themes/poly-light/theme.txt
Found linux image: /boot/vmlinuz-5.10-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.10-x86_64.img
Found initrd fallback image: /boot/initramfs-5.10-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.4-x86_64
Found initrd image: /boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-5.4-x86_64.img
Found initrd fallback image: /boot/initramfs-5.4-x86_64-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Detecting snapshots ...
Info: Separate boot partition not detected
Found 20 snapshot(s)
Found memtest86+ image: /boot/memtest86+/memtest.bin
done