0

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

and this is my disk enter image description here

iamafasha
  • 101
  • You have a swap partition. The instructions you're following are explicitly for swapfile. – ChanganAuto Aug 05 '21 at 13:54
  • Probably missing RESUME= for hibernating. See: https://askubuntu.com/a/1116795/231142 – Terrance Aug 05 '21 at 13:57
  • running blkid | awk -F\" '/swap/ {print $2}' give me 2241a457-d042-47f9-bce1-14d5c99246a9 – iamafasha Aug 05 '21 at 14:02
  • Read the rest of the linked answer and set the RESUME=. – Terrance Aug 05 '21 at 14:03
  • I have, doesn't seem to fix the issue. @Terrance – iamafasha Aug 05 '21 at 14:46
  • What is the output of cat /etc/initramfs-tools/conf.d/resume? If you also ran through all the steps in my linked answer here, did you reboot after setting the RESUME= variable? I just did the steps outlined in the answer you linked and my answer of setting the RESUME= and sudo s2disk worked just fine for me. – Terrance Aug 05 '21 at 15:22
  • @Terrance RESUME=UUID=2241a457-d042-47f9-bce1-14d5c99246a9 this is the output, yer i did restart the PC and When I run sudo s2disk I still get the same error – iamafasha Aug 06 '21 at 02:16
  • Try one more command of sudo 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:23
  • It is returning the same error @Terrance. Is it a problem with how I formatted my disk? – iamafasha Aug 06 '21 at 12:54
  • I guess there is always that possibility. You can use gparted to create a new one. But first you would have to turn off all swaps before deleting and recreating a new one sudo 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 the RESUME= to the Grub and only add it to the file. – Terrance Aug 06 '21 at 13:18
  • Which seetings should I consider when formatting the disk? – iamafasha Aug 06 '21 at 13:20
  • Swap is swap, there is no format, but only a partition. – Terrance Aug 07 '21 at 03:57

0 Answers0