17
March
2022
15:25

Fix warning when updating initramfs-tools kernel "no matching swap device is available"

17 March 2022 15:25

If, when installing an operating system update, the message "W: initramfs-tools configuration sets RESUME=UUID=" and "W: but no matching swap device is available" is displayed on the screen. This warning can be easily resolved.

Previously, I replaced the disk, and then used a different SWAP file: instead of a special partition, a swap file on the disk is used.

The configuration file is stored in the directory /etc/initramfs-tools/conf.d/
in the file resume.

First way:

If the system swap partition was eliminated as written in the article "Creating a SWAP swap file in Linux as a file from the root of the disk".

Need to edit the file resume:

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

Remove references to SWAP from the configuration file "", for example, by commenting '#':

# RESUME=none

Ctrl+O
Enter
Ctrl+X

After that, you need to start the kernel update with the command:

sudo update-initramfs -u -k all

where -k -all - reassemble all kernels.

The warning is no longer displayed:

update-initramfs: Generating /boot/initrd.img-5.13.0-35-generic
Warning: No support for locale: ru_RU.utf8

Note: Some distributions (Debian, MX Linux) do not have a "resume" file and do not display a warning. Essentially adding a comment#before the single line RESUME= is equivalent to the fact that the "resume" file is not used.

Second way

If the swap file is used as a system partition of type swap:

Find out the UUID of the paging file partition:

sudo blkid

find the line in the output that refers to the page file. This real UUID value:

For example:

/dev/sdc5: UUID="fd79588f-94ae-4b02-9ec2-47dc0c31b7dd" TYPE="swap" PARTUUID="47216535-05

Copy the UUID without quotes to the clipboard.

  1. Replace the partition ID in the file "/etc/fstab" where SWAP is specified. In my case:

For example:

UUID=a47ee3f6-5838-4bf7-8a7b-6070a4e3e735

in the file "/etc/fstab" insert the real UUID instead of the old value

`UUID=fd79588f-94ae-4b02-9ec2-47dc0c31b7dd swap swap noatime 0 0

  1. Insert the same real UUID of the swap partition into the file resume:

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

    RESUME=UUID=fd79588f-94ae-4b02-9ec2-47dc0c31b7dd

  2. Run command

    sudo update-initramfs -u -k all

The next time you reboot the PC, the real UUID of the SWAP partition will be used.

Note: files /etc/fstab и /etc/initramfs-tools/conf.d/resume лучше редактировать при помощи строчного текстового редактора "sudoedit", который обеспечивает безопасное редактирование (создаёт временную копию, соблюдает стандарты кодировки конфигурационных файлов). Например: sudoedit /etc/fstab.


Source:
*UbuntuForums



Related publications