Skip to content

Instantly share code, notes, and snippets.

@kekneus373
Created January 12, 2026 15:14
Show Gist options
  • Select an option

  • Save kekneus373/6002c63e2bc4a550799da93c093ac3e0 to your computer and use it in GitHub Desktop.

Select an option

Save kekneus373/6002c63e2bc4a550799da93c093ac3e0 to your computer and use it in GitHub Desktop.
Fix initramfs no matching swap device is available

Initramfs Swap Device Error

The "no matching swap device is available" warning during update-initramfs indicates that the system's initramfs configuration references a swap partition UUID that is no longer present or valid, often due to changes like partition resizing, disk replacement, or switching from a swap partition to a swap file This typically occurs when the RESUME variable in /etc/initramfs-tools/conf.d/resume points to a UUID that no longer corresponds to an active swap device

To resolve this issue, first identify the current UUID of the active swap device using the blkid command and locate the line containing TYPE="swap" Then, update the /etc/initramfs-tools/conf.d/resume file to reflect the correct UUID If the swap configuration has changed significantly—such as switching from a partition to a file or using encrypted swap—it may be necessary to set RESUME=none instead of a UUID, especially if hibernation is not used Alternatively, if the RESUME variable is no longer needed, removing the /etc/initramfs-tools/conf.d/resume file entirely can eliminate the warning, as the system will then attempt to resume from the default swap device or skip resume altogether

After making changes, regenerate the initramfs with sudo update-initramfs -u to apply the updates If multiple kernels are installed, use sudo update-initramfs -u -k all to ensure all initramfs images are updated Rebooting the system will confirm whether the warning is resolved and whether swap is functioning correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment