I am trying setup hibernation using s2disk while using this answer on ubuntu 20.04 but am facing an error when testing it as below.
username@PC-Name:~$ sudo s2disk
s2disk: Could not use the resume device (try swapon -a). Reason: No such device
When I do swapon -s
username@PC-Name:~$ swapon -s
Filename Type Size Used Priority
/dev/nvme0n1p6 partition 17942524 0 -2
RESUME=
for hibernating. See: https://askubuntu.com/a/1116795/231142 – Terrance Aug 05 '21 at 13:57blkid | awk -F\" '/swap/ {print $2}'
give me2241a457-d042-47f9-bce1-14d5c99246a9
– iamafasha Aug 05 '21 at 14:02RESUME=
. – Terrance Aug 05 '21 at 14:03cat /etc/initramfs-tools/conf.d/resume
? If you also ran through all the steps in my linked answer here, did you reboot after setting theRESUME=
variable? I just did the steps outlined in the answer you linked and my answer of setting theRESUME=
andsudo s2disk
worked just fine for me. – Terrance Aug 05 '21 at 15:22RESUME=UUID=2241a457-d042-47f9-bce1-14d5c99246a9
this is the output, yer i did restart the PC and When I runsudo s2disk
I still get the same error – iamafasha Aug 06 '21 at 02:16sudo s2disk -r /dev/nvme0n1p6
. The error of No such device is very generic and doesn't say what device it is trying to access. – Terrance Aug 06 '21 at 04:23gparted
to create a new one. But first you would have to turn off all swaps before deleting and recreating a new onesudo swapoff -a
. Then in https://help.ubuntu.com/community/SwapFaq in the area for creating a new swap partition is some good information. You can skip the line of the adding theRESUME=
to the Grub and only add it to the file. – Terrance Aug 06 '21 at 13:18