Ubuntu – What to do about “the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present”

bootencryptionswap

While booting Ubuntu 12.04, the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present is showing. Why is this?

Best Answer

This error message indicates that the the system was unable to use its encrypted swap partition.

Not being able to use swap may cause slowdown, especially if your machine doesn't have much RAM installed.

Assuming the system is booting, you should be able to fix the problem without too much hassle.

If this is happening when you boot the CD/DVD or USB flash drive to install Ubuntu, then assuming installation is still working, it can be ignored. Your installed system might or might not have the same problem once created--if it does, the problem can be addressed in the installed system.

If this is happening on a system that is installed on your hard disk, then your system might still run okay, but it's a good idea to fix it--if you have a swap partition (or swap file), you may as well use it.

Most Ubuntu systems with swap have a swap partition. Assuming that is the case, the technique described in this blog post may help:

Here's a summary, with some additional information that may be helpful for novices, and in my own words. I suggest taking a look at that post as well though (assuming it remains accessible), as it contains some examples and other information that I've left out for brevity.

  1. Open a Terminal window (Ctrl+Alt+T) or a virtual console and run: sudo swapoff -a
  2. Open /etc/crypttab (e.g., sudo nano -w /etc/crypttab or sudo -H gedit /etc/cryptab for a GUI editor) and put a # at the beginning of the line that starts with cryptswap1. Save the file.
  3. Do the same thing with the line that starts with /dev/mapper/cryptswap1 in /etc/fstab.
  4. Install gparted Install gparted. Run it and format your swap partition as linux-swap. Make sure to get the right partition; if you get the wrong one, you'll lose possibly important data! The line you commented out in crypttab should give the correct partition name (it comes right after /dev/).
  5. Run sudo mkswap /dev/..., repacing ... with that same device name. Part of that command's output should be text that says UUID=..... where ..... is a string of letters and numbers.
  6. In the file /etc/initramfs-tools/conf.d/resume, find the line that says RESUME=UUID= followed by letters and numbers like (but not identical to) ..... from the last step. Replace them with ..... (i.e., with the letters and numbers mkswap gave after UUID=.
  7. Run sudo swapon /dev/... (with the same /dev/... as you had in steps 4 and 5 above).
  8. Run sudo ecryptfs-setup-swap.

swapon -s will check to see if swap is successfully enabled. See that blog post for more information, and example output, for checking this.

Source: http://punygeek.blogspot.com/2012/10/ubuntu-1204-how-to-solve-disk-drive-for.html (on http://punygeek.blogspot.com/) by Litmus / Puny Geek. Some commands are copied; prose is not copied, but often expresses the same ideas.

Finally, note that this might be a bug. (I believe multiple factors could cause this problem, only some of which are bugs.) In particular, it resembles Launchpad Bug #1153661. If you believe that's your situation, you might want to subscribe to that, mark yourself affected (with the green "This bug affects..." link at the top of the page), and if you have any additional information to provide, comment with it.

Related Question