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.

Helo

I have a fresh install of 14.04 on a laptop with an SSD hard drive. When installing I turned on Full Disk Encryption as well as encryption of home folder.

Partitioning was left to the installer with no changes made by me.

Would anyone know why my swap is not getting turned on, and how to fix it?

My fstab

/dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=54b1c8ac-4c47-4d8a-a748-e15b1d6eb2ba /boot           ext2    defaults        0       2
/dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0
/dev/sr0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
/dev/mapper/cryptswap1 none swap sw 0 0

my crypttab

sda5_crypt UUID=59a0e1c9-2517-4434-b9bd-c3633047190d none luks,discard
cryptswap1 UUID=171441f7-054f-423a-ad8b-eba623bf67c9 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

swapon -s reports:

Filename                Type        Size    Used    Priority

free reports:

             total       used       free     shared    buffers     cached
Mem:       3740660    3463264     277396     310880      37924    1643064
-/+ buffers/cache:    1782276    1958384
Swap:            0          0          0

If I try to enable swap I get

sudo swapon -a
swapon: /dev/mapper/ubuntu--vg-swap_1: read swap header failed: Invalid argument
swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory

fdisk reports

sudo fdisk -l

Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000965cc

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   500117503   249807873    5  Extended
/dev/sda5          501760   500117503   249807872   83  Linux

Disk /dev/mapper/sda5_crypt: 255.8 GB, 255801163776 bytes
255 heads, 63 sectors/track, 31099 cylinders, total 499611648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/sda5_crypt doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--vg-root: 251.8 GB, 251821817856 bytes
255 heads, 63 sectors/track, 30615 cylinders, total 491839488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--vg-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--vg-swap_1: 3976 MB, 3976200192 bytes
255 heads, 63 sectors/track, 483 cylinders, total 7766016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--vg-swap_1 doesn't contain a valid partition table

blkid reports

/dev/sda1: UUID="54b1c8ac-4c47-4d8a-a748-e15b1d6eb2ba" TYPE="ext2" 
/dev/sda5: UUID="59a0e1c9-2517-4434-b9bd-c3633047190d" TYPE="crypto_LUKS" 
/dev/mapper/sda5_crypt: UUID="nbHinG-ylK8-KGxN-FTXP-GYnd-yhcj-zbJ3qd" TYPE="LVM2_member" 
/dev/mapper/ubuntu--vg-root: UUID="93d6000b-74cb-47a6-9535-9f5a49c95c0e" TYPE="ext4"
share|improve this question
    
Have you found a solution to this? I am a novice in almost exactly the same predicament, and my system has become absolutely unusably slow (persisting across reboots, of course) and nobody is supplying any actionable proposals except for links to pages that feature other links to other pages with other links… –  qubex May 18 at 16:53
    
The solution is descrived in the comments on this question: askubuntu.com/questions/462775/… and provided here: ubuntuforums.org/showthread.php?t=2224129 –  adosaiguas Jun 1 at 14:52
    
Finally I found someone with the same issue! In the past I tried to reinstall the system without success. I saw the answer with mkswap and cryptab. However could you detailed the different steps? I don't want to break the system with a wrong partition or something else... :) Thanks a lot –  kasiu Sep 8 at 7:20

3 Answers 3

I experienced this with Linux Mint 17 (based on 14.04) and searched for a solution without success.

I did a little investigation as you had above and it showed that while an entry existed in crypttab, that UUID didn't actually exist when viewing the blkid output. So, I issued a sudo mkswap /dev/mapper/mint--vg-swap_1 and copied the newly generated UUID into my crypttab file's cryptswap1 entry and rebooted. My swap problem is solved!

Your entry for mkswap will be specific to your distro and according to the information above should be /dev/mapper/ubuntu--vg-swap_1. YMMV.

share|improve this answer

Do you really need swap? How much ram do you have? Swap can unnecessarily shorten the lives of SSD systems with plenty of ram...

It looks to me like somehow your swap partition didn't get created during setup although you do have a uuid for it. I'm not really sure how that happened...I guess it depends on a lot of factors. The unfortunate recommendation I have for you is to go without a swap partition if you have at least 4 gb of ram or simply reinstall from the start.

The guide I like most, although it takes a lot more manual work is here.

Hope that helps...

share|improve this answer
    
I've already run into an issue where I've run out of memory when using VirtualBox, it either wont start the VM or force quits other applications. –  Jan Geep May 8 at 9:10
    
hmm that stinks! well what about my other suggestion with the manual guide to make sure everything gets installed correctly? not only that but it is a much higher level of encryption assuming you use a good passphrase... –  user175999 May 8 at 9:22
    
Oh I missed that link, I may try that though i'd rather not have to re-install. What I might do is just create a swap file on disk for the moment and use it. More RAM is always an option too :) –  Jan Geep May 8 at 9:54
    
Yeah, I used to know a way to take a folder on your root disk and create a swapfile that was randomly encrypted on each boot so that you could skip all that mess, but I couldn't find my guide on that...I do know that it CAN be done... –  user175999 May 8 at 13:22
    
well my disk is encrypted already so I am relatively ok with an unencrypted swap file sitting on the encrypted partition its self. –  Jan Geep May 8 at 13:28

I had the same issue and I succeed to solved it with the existed comments, thanks guys :). Here the following steps I followed, my home is encrypted and I have a dedicated swap partition.

Enable root account

sudo passwd root

Log on via CLI with the root account and format swap partition

sudo mkswap /dev/sdX

Check the swap partition UUID

sudo blkid /dev/sdaX

Add the following line in the /etc/fstab

UUID=XXXXXXXXXX none swap sw 0 0

Note! I disable the line /dev/mapper/cryptswap1 none swap sw 0 0 but I assume my swap should not be encrypted...

Disable root account

sudo passwd -dl root

If someone know how to do the same with an encrypted swap, I will appreciate :).

share|improve this answer
    
You don't need to enable/disable the root account. sudo uses the superuser privilege that has already been delegated to your account (assuming you're in the sudoers DB) and doesn't use the root account itself. Ubuntu and its variants default to having the root account disabled; with sudo, there's rarely a need to enable root. Prefixing your commands with sudo is enough. –  nstenz Sep 13 at 22:43

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.