1

I was given a VM to use for a class, and it was far too small. I extended the main HD by 100 GB to give me some breathing room. In the process, I had to remove and re-add the swap partition. The assignment is about forensics, and has nothing to do with administering the system (fyi).

Boot time was slow, so I found a similar question; however, I don't really know what I'm doing with this. My sudo swapon --show command was empty. The output of the first command was:

$ sudo blkid
/dev/sr0: UUID="2020-01-13-11-26-32-82" LABEL="VBox_GAs_6.1.2" TYPE="iso9660"
/dev/sda1: UUID="48d21be0-266d-412f-94c2-47eb9bdfcb6e" TYPE="ext4" PARTUUID="59d4415c-01"
/dev/sda5: UUID="525383e5-fea2-4b7d-bd81-028fd6f55e88" TYPE="swap" PARTUUID="59d4415c-05"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/fd0: SEC_TYPE="msdos" UUID="C4B1-CDCF" TYPE="vfat"
/dev/loop8: TYPE="squashfs"

and the second:

$ cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=48d21be0-266d-412f-94c2-47eb9bdfcb6e /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=ab7cc7d6-77e0-444f-982d-bb64502305b9 none            swap    sw              0       0

My guess is that swap is pointing to an old drive ab7cc... and needs to point to 52538... but I'm hesitant to muck around with this as I don't really know what it is.

Is my swap set up correctly? If yes, what else can I check for a "slow boot time"

  • Got impatient... the answer is to edit /etc/fstab to match the output of blkid. I will answer my own question if no one else does. – Jeff Jan 26 at 13:40
  • You have to edit your swap UUID in /etc/genfstab. Replace it with the UUID given by the command sudo blkid. – enigma Jan 26 at 13:48
  • 1
    Sorry, did not see that your solved your problem by your own... – enigma Jan 26 at 13:48
  • No worries! confirmation. – Jeff Jan 26 at 14:26
2

You're absolutely correct. There's a mismatch between UUIDs. This occurred because of the re-creation of the swap partition. You executed the correct commands to determine this.

free -h # show a little more data

sudo blkid # show UUIDs

cat /etc/fstab # show fstab

sudo -H gedit /etc/fstab # edit fstab

In /etc/fstab...

Change:

# swap was on /dev/sda5 during installation
UUID=ab7cc7d6-77e0-444f-982d-bb64502305b9 none    swap    sw     0 0

To:

# swap was on /dev/sda5 during installation
UUID=525383e5-fea2-4b7d-bd81-028fd6f55e88 none    swap    sw     0 0

Then reboot and it should boot a lot faster, as it won't be waiting for a non-existent swap partition.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.