How to set the RESUME variable to override these issues?

The swap UUID needs to be added to the /etc/initramfs-tools/conf.d/resume file.

The following command can show what your swap UUID is:

blkid | awk -F\" '/swap/ {print $2}'

You can run the following to set that in the RESUME file:

printf "RESUME=UUID=$(blkid | awk -F\" '/swap/ {print $2}')\n" | sudo tee /etc/initramfs-tools/conf.d/resume

Then run the following to update the kernels on the system:

sudo update-initramfs -u -k all

Reboot the system so the changes can take affect.


This is what I have had to do to my machine too. This happens when I install Ubuntu fresh on the system, but I allow it to pick the install without choosing manual and repartitioning leaving the old swap partition. Well, the install creates a swap file and doesn't use the old swap partition. Later I decide to use the swap partition instead of the file and I get this message because the resume was never created by default or it is set to use the swap file instead.

This does last through kernel updates.

Hope this helps!


I will add just one caveat.

The initramfs will attempt to resume from /dev/sda2
I: (UUID=139d357c-829d-408d-bccc-147ec4402da8)
I: Set the RESUME variable to override this.

The above was my case and the UUID stated there is the disk's (sda2 in my case) UUID, not the PARTUUID (i.e. the partition's UUID where the swap is installed).

This is so counter-intuitive, as the warning suggests, at least to me, that the disk's UUID was the problem!

But long story short, here is my solution:

Add the disk's UUID to the resume file not the partition's PARTUUID.

sudo gedit /etc/initramfs-tools/conf.d/resume

In my case I added:

RESUME=UUID=139d357c-829d-408d-bccc-147ec4402da8

And if this is not clear, my fstab for my swap location is:

/dev/sda2: UUID="139d357c-829d-408d-bccc-147ec4402da8" TYPE="swap"
PARTLABEL="HDD_Swap" PARTUUID="0067903b-aed0-48d1-8d59-956784616d48"