update-initramfs warning: initramfs-tools configuration sets RESUME but no matching swap device is available

Written by - 0 comments

Published on October 15th 2021 - Listed in Linux


After the primary (root) disk was replaced by a new disk with a bigger size, the update-initramfs command started to throw warnings to stdout.

Note: This was seen when a new Kernel (linux-image) package was installed through apt, as this triggers an update-initramfs in the background.

Of course the output from apt can be reproduced, by launching update-initramfs manually:

root@focal:~# update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-5.4.0-88-generic
cryptsetup: ERROR: Couldn't resolve device
    UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: initramfs-tools configuration sets RESUME=UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: but no matching swap device is available.
I: The initramfs will attempt to resume from /dev/sdd2
I: (UUID=eb73c48f-3c85-41df-a5f4-004c8aa264b1)
I: Set the RESUME variable to override this.

update-initramfs: Generating /boot/initrd.img-4.15.0-159-generic
cryptsetup: ERROR: Couldn't resolve device
    UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: initramfs-tools configuration sets RESUME=UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: but no matching swap device is available.
I: The initramfs will attempt to resume from /dev/sdd2
I: (UUID=eb73c48f-3c85-41df-a5f4-004c8aa264b1)
I: Set the RESUME variable to override this.
update-initramfs: Generating /boot/initrd.img-4.4.0-166-generic
modinfo: ERROR: could not get modinfo from 'crc32': No such file or directory
cryptsetup: ERROR: Couldn't resolve device
    UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: initramfs-tools configuration sets RESUME=UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
W: but no matching swap device is available.
I: The initramfs will attempt to resume from /dev/sdd2
I: (UUID=eb73c48f-3c85-41df-a5f4-004c8aa264b1)
I: Set the RESUME variable to override this.

Although the  warnings might sound cryptic, they are actually self-explaining: The current initramfs config (in /etc/initramfs-tools) points to another device (the previous primary disk) in the RESUME variable. But as the previous disk was replaced, it cannot be found anymore. The warning/information goes on that it would proceed with /dev/sdd2 (the current swap partition) but that the new UUID of /dev/sdd2 should be set in the RESUME variable.

Taking a look at the current UUIDs shows:

root@focal:~# ll /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Oct 14 12:04 0aeef443-e48a-4023-9776-e0f492833dac -> ../../dm-2
lrwxrwxrwx 1 root root 10 Oct 14 12:04 0df59b8a-4285-404d-942f-6d2b8293f653 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Oct 14 12:04 210e1adf-38f7-40b8-b612-55b693c71943 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Oct 14 12:04 3dbd5c6d-4ef6-4600-9013-f9360fcc668f -> ../../dm-0
lrwxrwxrwx 1 root root 10 Oct 14 12:04 eb73c48f-3c85-41df-a5f4-004c8aa264b1 -> ../../sdd2

As an alternative, you can also use lsblk -f to see the UUIDs of the partitions (which also shows which partition is used as swap):

root@focal:~# lsblk -f
NAME               FSTYPE      LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINT
fd0                                                                                        
sda                LVM2_member       eVjEig-Hgfi-cEjU-kPKR-GMQ8-rr3k-jiF3eF                
|-vges-lves        ext4              0aeef443-e48a-4023-9776-e0f492833dac      2.1T    68% /var/lib/elasticsearch
sdb                LVM2_member       efCcB1-7pmb-SVy5-AB1h-Lgli-J651-b5UYtW                
|-vges-lves        ext4              0aeef443-e48a-4023-9776-e0f492833dac      2.1T    68% /var/lib/elasticsearch
sdc                LVM2_member       cvB1oD-G4Mg-aEGI-aoKl-K2MA-Fzei-Ga2tNh                
|-vges-lves        ext4              0aeef443-e48a-4023-9776-e0f492833dac      2.1T    68% /var/lib/elasticsearch
sdd                                                                                        
|-sdd1             ext4              210e1adf-38f7-40b8-b612-55b693c71943      9.7G    29% /
|-sdd2             swap              eb73c48f-3c85-41df-a5f4-004c8aa264b1                  [SWAP]
|-sdd3                                                                                     
|-sdd5             LVM2_member       VJnIWZ-x7sJ-vdYP-X3m6-zCAQ-3zYr-Qj3rHm                
  |-vgsystem-lvtmp ext4              3dbd5c6d-4ef6-4600-9013-f9360fcc668f    894.1M     0% /tmp
  |-vgsystem-lvvar ext4              0df59b8a-4285-404d-942f-6d2b8293f653      4.8G    54% /var
sr0  

Now let's take a look at the RESUME variable of the initramfs config:

root@focal:~# cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7

Indeed, this UUID does not exist on the system anymore. Let's use the new swap UUID:

root@focal:~# vi /etc/initramfs-tools/conf.d/resume
root@focal:~# cat /etc/initramfs-tools/conf.d/resume
#RESUME=UUID=22b84831-047a-4ce4-a083-3d1999b6b3a7
RESUME=UUID=eb73c48f-3c85-41df-a5f4-004c8aa264b1

And then run update-initramfs again:

root@focal:~# update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-5.4.0-88-generic
update-initramfs: Generating /boot/initrd.img-4.15.0-159-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-166-generic
modinfo: ERROR: could not get modinfo from 'crc32': No such file or directory

This time, initramfs ran through without RESUME warnings.

Note: The crc32 error can be ignored. It shows up since Ubuntu 20.04 (Focal Fossa).

Then run update-grub:

root@focal:~# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-88-generic
Found initrd image: /boot/initrd.img-5.4.0-88-generic
Found linux image: /boot/vmlinuz-4.15.0-159-generic
Found initrd image: /boot/initrd.img-4.15.0-159-generic
Found linux image: /boot/vmlinuz-4.4.0-166-generic
Found initrd image: /boot/initrd.img-4.4.0-166-generic
  WARNING: PV /dev/sda in VG vges is using an old PV header, modify the VG to update.
  WARNING: PV /dev/sdb in VG vges is using an old PV header, modify the VG to update.
  WARNING: PV /dev/sdc in VG vges is using an old PV header, modify the VG to update.
done

Note: The LVM warnings show that the volume group is using an old PV header. <- Click on the link to find out how to solve this.

And just to be on the safe side, install grub on the primary disk (/dev/sdd on this particular server):

root@focal:~# grub-install /dev/sdd
Installing for i386-pc platform.
Installation finished. No error reported.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.