Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Today I discovered that my Ubuntu 12.04LTS doesn't have any swap-space.

I installed this system from scratch only some weeks ago. I encrypted all the partitions to me needs. I didn't install any swap space in the first place, cause the installation dialog misbehaved when I tried to set up the encrypted swap. I added the encrypted swap-space after finishing the installation by editing /etc/crypttab and /etc/fstab. I might issued some more commands to propagate the changes (I don't remember). The swap-space used to just work fine after that.

Today I discovered for coincidence that I don't have any swap available. There are no error messages.


Some system information: (swap is supposed to be on sdb1_crypt)

/etc/crypttab:

sda1_crypt UUID=91cb1de3-0754-4aa3-89b9-807e9a95a55a /root/keyfileToHome luks
sdb1_crypt UUID=96558522-6c79-4ddc-8f93-7defee6a9255 /dev/urandom cipher=aes-cbc-essiv:sha256,hash=ripemd160,size=256,swap
sdb2_crypt UUID=5fd25f3a-de63-4a5d-94a7-3e509a70b68c none luks

/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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/mapper/sdb2_crypt /               ext4    errors=remount-ro 0       1
# /boot used to be on /dev/sdb3 during installation
UUID=9cdce42f-3894-4878-af03-12284dd5cab9 /boot           ext4    defaults        0       2
/dev/mapper/sda1_crypt /home           ext4    defaults        0       2
/dev/mapper/sdb1_crypt none            swap    sw              0       0

$ ll /dev/mapper shows me, that sdb1_crypt is actually not created:

total 0
drwxr-xr-x  2 root root     120 Sep 29 16:26 ./
drwxr-xr-x 16 root root    4460 Sep 29 16:26 ../
crw-------  1 root root 10, 236 Sep 29 16:24 control
lrwxrwxrwx  1 root root       7 Sep 29 16:24 sda1_crypt -> ../dm-1
lrwxrwxrwx  1 root root       7 Sep 29 16:24 sdb2_crypt -> ../dm-0

Therefor /proc/swaps is empty of course:

Filename                Type        Size    Used    Priority

I tried to update the initramfs:

# update-initramfs -u

That didn't help.

I am able to turn on the swap space temporarily by running the following commands:

# cryptsetup -d /dev/urandom create sdb1_crypt /dev/disk/by-uuid/96558522-6c79-4ddc-8f93-7defee6a9255
# mkswap /dev/mapper/sdb1_crypt
# swapon -a

I tried to add the output from dmesg here. I got an error message that the body of the message is too long. If it could be helpful, please ask for specific sections of the dmesg output.


What causes the problem? How can I fix it? How can I get the swap space work as usual again? Any help appreciated.

share|improve this question
    
Same think still happens on 14.04, and there is a solution. Just in case someone falls here: askubuntu.com/questions/462775/… –  adosaiguas Jun 1 at 14:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.