Score:0

s2disk: Could not use the resume device (try swapon -a). Reason: No such device when setting hibernation

cg flag

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

ChanganAuto avatar
us flag
You have a swap partition. The instructions you're following are explicitly for **swapfile**.
Terrance avatar
id flag
Probably missing `RESUME=` for hibernating. See: https://askubuntu.com/a/1116795/231142
iamafasha avatar
cg flag
running `blkid | awk -F\" '/swap/ {print $2}'` give me `2241a457-d042-47f9-bce1-14d5c99246a9`
Terrance avatar
id flag
Read the rest of the linked answer and set the `RESUME=`.
iamafasha avatar
cg flag
I have, doesn't seem to fix the issue. @Terrance
Terrance avatar
id flag
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.
iamafasha avatar
cg flag
@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
Terrance avatar
id flag
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.
iamafasha avatar
cg flag
It is returning the same error @Terrance. Is it a problem with how I formatted my disk?
Terrance avatar
id flag
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.
iamafasha avatar
cg flag
Which seetings should I consider when formatting the disk?
Terrance avatar
id flag
Swap is swap, there is no format, but only a partition.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.