Score:0

Unable to get swap file UUID for hibenation in ubuntu 20.04

it flag

I am following this to enable hibernation in my ubuntu 20.04LTS system. I followed exactly as mentioned in the first answer. But when I run grep swap /etc/fstab to get the UUID value I get the below as the output.

/swapfile                                 none            swap    sw              0       0

I don't understand where my UUID is. How do I enable hibernation in my system?

FedKad avatar
cn flag
Files do not have UUIDs!
Monojit Sarkar avatar
it flag
@FedonKadifeli Will you please clarify what you mean? That command is supposed to output the UUID of swapfile.
FedKad avatar
cn flag
I haven't tried, but it may help if you follow the answer given **above** the one you shared the link of: https://askubuntu.com/a/1321773/855322
cc flag
The swaplabel command will give you the UUID fo the swap file, but that may not be useful for your purpose. Might take the root (location of the swapfile) UUID plus an offset depending on how your root is set up (encryption,...).
Score:1
cn flag

You don't need the swapfile UUID for hibernation but the UUID of the swapfile's physical partition, which might not be your root partition. To enable hibernation follow this guide instead.

To get the UUID of the swapfile which AFAIK is of no use try:

sudo swapoff /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Score:0
in flag

Use this swaplabel command with \swapfile argument (sudo is needed).

$ sudo swaplabel /swapfile
UUID:  bb7f30c2-6d9d-4594-bcab-ed8e643ccb50
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.