/dev/mapper/cryptswap1 is not ready yet or not present

I had this error going for a long time now (usually while my system was loading from a reboot) and my swap space would usually just not work…
I finally had some time to deal with that.
I couldnt even reformat it in gparted or something similar…

This is how I fixed it:

First you turn your swap space off

$ sudo swapoff -a

commented out the existing swap line in /etc/crypttab

comment out the swap line in /etc/fstab

# /dev/mapper/cryptswap1 none swap sw 0 0

reboot your pc/laptop

now you should be working without a swap space, try reformatting your partition in gparted to a linux-swap type (in my case it was /dev/sda3)

after successfully reformatting it, proceed this way:

create a new swap (in my case /dev/sda3)

$ sudo mkswap /dev/sda3

a swap space will be created, copy and paste somewhere your new UUID

update your /etc/initramfs-tools/conf.d/resume (coment our the old line) and add
Note: x-es represent your new UUID

RESUME=UUID=xxxxxxxxxxxxx

update initramfs:

$ sudo update-initramfs -u

and now edit /etc/fstab again and add the new swap space in the bottom
Note: x-es represent your new UUID

UUID=xxxxxxxxxxxxx        none    swap    sw      0       0

reboot your pc/laptop and your new swap space should be automatically enabled…

to see that use:

$ free

or

$ swapon -s

Just in case: I was using Ubuntu 12.04.1 LTS
Hopefully this helps you ! 🙂

9 thoughts on “/dev/mapper/cryptswap1 is not ready yet or not present

  1. there is only one problem with this procedure, I think…..your swap partition will not be encrypted, while the rest of your home will be…..not the most secure thing to do if your intention in the first place was to encrypt everything.

    I think that after updating initramfs, instead of updating fstab you should run these two commands

    sudo swapon /dev/sdXX (XX depends on your setup)
    sudo ecryptfs-setup-swap

  2. I think there is a much simpler solution. Just open up as root etc/crypttab (do this by entering gksudo nautilus in the terminal, or if you’re using KDE enter kdesudo dolphin) and check that the correct swap partition is being used. In my case, this file showed the following:

    cryptswap1 /dev/sdd6 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

    – now, when I looked in gparted, I noticed that the actual swap partition was /dev/sdc6 (not /dev/sdd6 as stated above). Clearly a mistake of the installer. However, after saving the corrected form of the crypttab file, the swap now gets mounted during bootup (which can be checked via the System Monitor).

  3. Great! That works. gparted shows swap partition wasn’t recognized. After your workaround encrypted swap is in operation. Thank you!

  4. Ӏ like the helpful information you provide in your ɑrticles.
    I will bookmzrk your weblog and take ɑ lolok at once more here regularly.
    I’m rather certain I’ll bbe told plenty of new stuff
    right right here! Good luck for the following!

  5. After ages fiddling with this I was finally able to find a way so that it worked with encryption; also after restarting
    $ sudo swapoff -a
    $ sudo nano /etc/fstab
    > comment out swap line (if existing)
    $ sudo nano /etc/cryptotab
    > comment out swap line (if existing)
    $ sudo reboot
    $ sudo gparted
    > formate the partition (assumed to be /dev/sda3 for the rest of the text)
    $ sudo mkswap /dev/sda3
    > copy the UUID (e.g. UUID=74a0b962-0a4d-4ac7-80f3-e58a5868532d)
    $ sudo nano /etc/initramfs-tools/conf.d/resume
    > put the line “RESUME=UUID=74a0b962-0a4d-4ac7-80f3-e58a5868532d” there
    $ sudo update-initramfs -u
    $ sudo reboot
    $ free -m
    > will still show 0 as the swap was not activated
    $ sudo swapon /dev/sda3
    $ sudo reboot
    $ free -m
    > this should show you the swap actived, but yet unencrypted
    $ sudo ecryptfs-setup-swap
    > this command is supposed to do it all, but if you don’t do the next step the swap might be gone the next reboot!
    $ sudo nano /etc/crypttab
    > IMPORTANT! replace the “UUID=74a0b962-0a4d-4ac7-80f3-e58a5868532d” with the “/dev/sda3”
    > e.g. the line should read sth like “cryptswap1 /dev/sda3 /dev/urandom swap,cipher=aes-cbc-essiv:sha256”
    $ sudo reboot
    > check if everything went fine
    $ free -m
    > this should show the same swap memory as before, not 0
    $ sudo gparted
    > gparted should display the partition as “unknown” and not “linux-swap” anymore

    You can likely skip the reboot part between update-initramfs and swapon, but I didn’t bother to try that out anymore. If you don’t fix the line in /etc/crypttab your linux may not mount the swap partition, you get no swap and you have just a useless partition of “unknown” format

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s