Skip to content

How to Fix Debian Slow Boot After Partition Resize or “No Matching Swap Device is Available” Error

Debian users may sometimes encounter a slow boot issue or a “No matching swap device is available” error, particularly after resizing partitions. This problem often arises due to discrepancies between the swap partition UUID and what is recorded in the system’s configuration files. Here’s a step-by-step guide to resolving these issues.

Step 1: Identify the UUID of Your Swap Partition

First, you need to identify the UUID (Universally Unique Identifier) of your swap partition. This can be done using the blkid command, which lists the UUID of each device or partition on your system.

Open your terminal and run:

$ sudo blkid

This command will display information about all your partitions. Look for the line corresponding to your swap partition and copy the UUID.

Note: If swap is disabled on your system, you can skip this step.

Step 2: Update the Resume Configuration

Next, you need to update the resume configuration file with the correct UUID of your swap partition.

Open the resume configuration file in a text editor (here we use vim):

$ sudo vim /etc/initramfs-tools/conf.d/resume

Replace the existing UUID with the UUID you copied in the previous step. The line should look something like this:

RESUME=UUID=your-swap-partition-uuid

If swap is disabled: Simply delete the line starting with RESUME=UUID=....

Save the file and exit the text editor.

Step 3: Update Initramfs

Finally, you need to update the initial ramdisk environment (initramfs) to apply the changes.

Run the following command:

$ sudo update-initramfs -u

This command updates the initramfs with the new configuration.

After completing these steps, reboot your system to apply the changes. Your Debian system should now boot more quickly, and the “No matching swap device is available” error should be resolved. Regular maintenance of your system configuration, especially after making changes to your partitions, can prevent such issues from occurring in the future.

Published inBatchLinuxScriptShell