Ubuntu – could not mount /dev/mapper/cryptswap1


I have just had a major issue with my Ubuntu 11.04 Natty which I think is going to end up in a reinstall πŸ™

This is problem one of two so I've put them as two questions.

For some unknown reason I had a Distribution update on my Laptop yesterday which for all intend and purposes did nothing.
No major version changes except in Evolution and LibreOffice plus some of the GNOME environment (my other question).

Now, whenever I boot my machine I receive this message

could not mount /dev/mapper/cryptswap1 M for manual S for skip

What would have caused this error and what on earth is Cryptswap1?

# /etc/fstab: static file system information.
# Use 'blkid -o value -s UUID' 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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=c3cff8dd-1bf2-4618-8801-761b335c8d38 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
#UUID=fe10641d-a928-479e-ab3a-b0706b97b601 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0

sudo blkid | grep swap

/dev/mapper/cryptswap1: TYPE:"swap"

# <target name> <source device> <key file> <options>

ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 2011-08-16 05:28 control

Filename Type Size Used Priority

/dev/sda5 partition 1038332 86760 -1

Best Answer

In your /etc/fstab file, the /dev/mapper/cryptswap1 entry is there, which is why Ubuntu tries to mount it on boot. If you don't use encrypted partitions, that line shouldn't be there. For some reason the line created by the Ubuntu installer got commented out too. So just change (in /etc/fstab):

# swap was on /dev/sda5 during installation
#UUID=fe10641d-a928-479e-ab3a-b0706b97b601 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0


# swap was on /dev/sda5 during installation
UUID=fe10641d-a928-479e-ab3a-b0706b97b601 none            swap    sw              0       0

IMPORTANT: Before you restart, make sure you check that fe10641d-a928-479e-ab3a-b0706b97b601 is actually /dev/sda5 by running:

ls -l /dev/disk/by-uuid/fe10641d-a928-479e-ab3a-b0706b97b601

It should say something like:

lrwxrwxrwx 1 root root 10 2011-08-16 08:28 /dev/disk/by-uuid/fe10641d-a928-479e-ab3a-b0706b97b601 -> ../../sda5

The sda5 part at the end is the important part. Once you are sure the UUID matches the partition number, run sudo fdisk -l /dev/sda and make sure that /dev/sda5 is a swap partition.

Then just restart and that's it :) Hope this helps.