You are not logged in.

#1 2020-07-22 23:30:25

Math3mat1x
Member
Registered: 2020-04-22
Posts: 14

[Solved] Unable to resume from hibernation

Hello everyone,
NOTE: My ArchLinux is in an encrypted partition (LVM on LUKS) and I use efibootmgr to boot into my system.
I would like to use hibernation on my computer.
In order to do so, I first created a swap file:

dd if=/dev/zero/ of=/swapfile bs=1M count=8192
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile	none	swap	defaults	0 0" >> /etc/fstab

Then, as I went through the ArchWiki, I learned I must use "High Level Interfaces" such as systemd to hibernate. Thus, to do so, I just have to type:

sudo systemctl hibernate

The last thing to do is to modify the kernel parameters in order to tell the system to boot from the swapfile.
Using

filefrag -v /swapfile | awk '{ if($1=="0:"){print $4} }'

, I determined the value of the resume_offnet parameter, and I used

findmnt -no UUID -T /swapfile

to know the UUID of my swapfile.
Here’s the command I typed to add the ArchLinux boot entry:

efibootmgr --disk /dev/sda --part 1 --create --label "ArchLinux" --loader /vmlinuz-linux --unicode "cryptdevice=UUID=0d46f41d-6858-4cf0-8d9f-50de85af1bb2:cryptlvm root=/dev/ArchLinux/root resume=UUID=93e2002c-0a6f-4151-873b-3e01277dcab7 resume_offset=776192 quiet initrd=\intel-ucode.img initrd=\initramfs-linux.img" --verbose

I also added the resume hook and regenerated the initramfs.

The problem is I always get an error on startup ("ERROR: resume: no device specified for hibernation"). I tried to change the value of the resume parameter to /dev/ArchLinux/root, but this changed nothing.
Thanks in advance for helping me solve this problem!

Last edited by Math3mat1x (2020-07-30 07:48:53)

Offline

#2 2020-07-30 07:48:42

Math3mat1x
Member
Registered: 2020-04-22
Posts: 14

Re: [Solved] Unable to resume from hibernation

I found a solution to my problem.
I deleted my swap file and created a swap partition of the size of my RAM. I then put in the resume kernel parameter the location of this partition.

Offline

Board footer

Powered by FluxBB