Lubuntu 18.04 ‘Gave up waiting for suspend/resume device’
June 15, 2018 6 Comments
Software Updater in Lubuntu 17.10 recently prompted me to upgrade the OS to 18.04 LTS, and I clicked on ‘Yes, Upgrade Now’. The upgrade was performed and I was able to boot the PC into 18.04, login and access the Desktop as usual. However, I noticed a new message ‘Gave up waiting for suspend/resume device
‘ was displayed on TTY1.
Now, I recalled that the Lubuntu 17.10 Installer had created a swap file rather than a swap partition when I installed Lubuntu, as confirmed in the output listed below:
user $ sudo blkid
[sudo] password for fitzcarraldo:
/dev/sda1: UUID="3602-BD57" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="72b3693e-b81f-7299-84fb-bf3781bef43d"
/dev/sda2: UUID="afe17116-26fa-4169-b2d9-fb6ac8afc63c" TYPE="ext4" PARTUUID="738fed17-293d-832f-c7a4-e83471fe8ca6"
user $ swapon
NAME TYPE SIZE USED PRIO
/swapfile file 2G 0B -2
user $ ls /swapfile
/swapfile
The initramfs installed by upgrading to Lubuntu 18.04 expects a swap partition in order to resume from hibernation:
user $ lsinitramfs /initrd.img | grep resume
scripts/local-premount/resume
bin/resume
conf/conf.d/resume
And, when I regenerated the initramfs files for the three kernel images in the /boot
directory, I could see from the terminal output that the update-initramfs
tool was expecting a swap partition:
user $ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.15.0-23-generic
W: initramfs-tools configuration sets RESUME=UUID=7b4cb3c5-4c17-42ae-be3c-cc35d31fe287
W: but no matching swap device is available.
update-initramfs: Generating /boot/initrd.img-4.15.0-22-generic
W: initramfs-tools configuration sets RESUME=UUID=7b4cb3c5-4c17-42ae-be3c-cc35d31fe287
W: but no matching swap device is available.
update-initramfs: Generating /boot/initrd.img-4.13.0-43-generic
W: initramfs-tools configuration sets RESUME=UUID=7b4cb3c5-4c17-42ae-be3c-cc35d31fe287
W: but no matching swap device is available.
I had a look in the file /etc/initramfs-tools/conf.d/resume
and found that it had indeed been configured to expect a swap partition, although I have no idea where that UUID came from, as it was not for any of the partitions on this PC:
user $ cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=7b4cb3c5-4c17-42ae-be3c-cc35d31fe287
So I edited the contents of the configuration file to point to the swap file /swapfile
instead of a non-existent partition:
user $ cat /etc/initramfs-tools/conf.d/resume
#RESUME=UUID=7b4cb3c5-4c17-42ae-be3c-cc35d31fe287
RESUME=/swapfile
Then I regenerated the initramfs files for the three kernel images currently in /boot
on the PC:
user $ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-4.15.0-23-generic
update-initramfs: Generating /boot/initrd.img-4.15.0-22-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-43-generic
As you can see above, there were no longer any messages that ‘no matching swap device is available
‘. And, when I rebooted the PC, the message ‘Gave up waiting for suspend/resume device
‘ was no longer displayed on TTY1. All good again, although it’s a pity the Lubuntu Installer did not create a swap partition so that the installation could be put into hibernation. With a swap file, hibernation is not possible.
Update (14 July 2018): Actually, it is possible to hibernate if the installation has a swap file instead of a swap partition – see my latest post: Configuring Lubuntu 18.04 to enable hibernation using a swap file.
Pingback: Getting the lock screen to work reliably when resuming from suspension in a single-seat, multi-user Lubuntu 18.04 installation | Fitzcarraldo's Blog
Excellent advice. Thanks.
Thanks a lot! That fix worked for me on Linux Mint 19. The break came up after i removed an additional HDD.
your fix worked for me. Thx
Thanks Fitzcarraldo. I moved a Ubuntu 18.0.4 install to another disk (with different partition numbers etc), grub-update grub-install worked but had this problem, fixed now using your instructions. I had no /etc/initramfs-tools/conf.d/resume, had to create it.
Thanks. I had the same problem. Very informative.