2

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?

  • 1
    Files do not have UUIDs! – FedKad Oct 22 '21 at 13:03
  • @FedonKadifeli Will you please clarify what you mean? That command is supposed to output the UUID of swapfile. – Monojit Sarkar Oct 22 '21 at 13:30
  • 1
    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 – FedKad Oct 22 '21 at 13:55
  • 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,...). – ubfan1 Mar 04 '22 at 22:43

2 Answers2

2

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
evfokas
  • 21
0

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

$ sudo swaplabel /swapfile
UUID:  bb7f30c2-6d9d-4594-bcab-ed8e643ccb50
sugab
  • 4,367