Ubuntu and swap partitions

This is a note to self and any others that may find themselves in a similar situation. Should you happen to one day start your computer, wait for your linux distro to boot up and then see the following message

swap: waiting for UUID=xxxxxxxx-xxxx-xxxx

without anything else happening, then don't panic! At least not yet. Before you start pulling hair out of your head, try the following:

  • boot into recovery mode, using grub, a live-cd or the excellent system rescue cd
  • check which UUIDs your disks actually use (and by now, you should have an idea of where this is going)

    • easiest is: ls /dev/disk/by-uuid/ - however, if you have many disks then the output will be unwieldy
    • easy as well: sudo blkid - this will list all disks with extra info
  • mount your linux boot partition, then check the fstab file on it

    • if you mounted it on /mnt/disk then do vim /mnt/disk/etc/fstab or nano /mnt/disk/etc/fstab
  • check the partition that's marked as swap - compare the UUID it's loading by against the list obtained above

  • if the UUID matches, go ahead, panic. If the UUID in the fstab file doesn't match then change the fstab file (either to load the partition by /dev/sda-something or the proper UUID) and then try rebooting.

As I didn't have access to the above list when this happened, I panicked (after the third or fourth reboot with the same result). Luckily I had access to another computer and could google for solutions - and came across this in a forum which I figured needed to be spread some more.

Why did the UUID of the swap partition suddenly change? I have no idea. Perhaps it wasn't even the UUID changing, it was something else in the system that suddenly started caring about the mismatch (that's rather farfetched, but so is the whole situation). My best bet is that it was down to a bootup to Windows and some work there - perhaps trusty old WinXP decided to play nasty and change stuff at random. No matter what, though ... the relief when I finally got the thing working was massive (among other things, I have some webdev work to hand in soon).

social