This question already has an answer here:

I upgraded my system to Ubuntu 14.04LTS, I encrypted the home & the swap partition during the installation since it was already encrypted in the old version.

But later I noticed swap partition is not used & using the gparted I found the swaps is damaged, I re-formatted the swap partition as Linux-swap & fixed the UUID in the fstab then cleared the crypttab, then swap was working fine but without the encryption. As soon as I run the ecryptfs-setup-swap to encrypt the swap partition then reboot the system it gets damaged.

This link shows the steps I followed

Any idea how to fix this?

@muru this is the output, & sda6 is the swap part.

sudo blkid

/dev/sda1: SEC_TYPE="msdos" UUID="5450-4444" TYPE="vfat" 
/dev/sda2: LABEL="RECOVERY" UUID="DAAC6031AC600A79" TYPE="ntfs"
/dev/sda3: LABEL="WinSys" UUID="E2D0647AD0645737" TYPE="ntfs"
/dev/sda5: UUID="96e501a8-40ee-4d08-bcb2-2396a99abd94" TYPE="ext4"
/dev/sda7: UUID="348874d5-f654-4640-bbad-0b377e545334" TYPE="ext4" 

sudo lsblk

sda      8:0    0 698.7G  0 disk 
├─sda1   8:1    0  39.2M  0 part 
├─sda2   8:2    0  13.2G  0 part 
├─sda3   8:3    0   100G  0 part 
├─sda4   8:4    0     1K  0 part 
├─sda5   8:5    0  42.9G  0 part /
├─sda6   8:6    0  14.3G  0 part 
└─sda7   8:7    0 528.2G  0 part /home
sr0     11:0    1  1024M  0 rom  

Hope its readable now.

marked as duplicate by Zanna, edwinksl, Eric Carvalho, Anwar, jokerdino Dec 20 '16 at 14:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • to be honest unless you run a branch of the nsa you should be fine with an unencrypted swap, it really is only an extension of the ram and usually does not have enough of a process stored on it to be that much of a risk – sbergeron Jul 31 '14 at 3:59
  • Welcome to AskUbuntu! There seem to be problems right now with some swap encryption. askubuntu.com/questions/91292/… , but you could check this as well. askubuntu.com/questions/248158/… – No Time Jul 31 '14 at 4:25
  • This what I thought first time when I installed the 14 LTS, when it was released directly, that may be there is problem with the encryption & I left it w/o encrypted swap till now, & now I tried again but same problem, how come this bug (if any) not fixed till now? – Adscnet Jul 31 '14 at 15:54

I doubt it was damaged. Encrypted swap shows up as of type Unknown in tools like GParted, because the partition is filled with random data and such tools have no way of knowing that it really is an encrypted swap partition.

  • Yes Muru, its Unknown, but why the system is not able to recognize it as soon as I encrypt it. Without running the encryption setup on the swap partition, swap is working fine recognized & utilized by the OS. Also I had setup another new laptop and had no problem encryption works fine on home & swap partition !! I can't figure out what I'm missing in this setup. I already used the encryption for last 2 years with the old Ubuntu versions. Any suggestion. – Adscnet Jul 31 '14 at 15:57
  • I already reformatted the swaps part & now I'm using w/o encryption, so the swapon -s shows this results:Filename Type Size Used Priority /dev/sda6 partition 14998524 224 -1 – Adscnet Jul 31 '14 at 16:25
  • do you want me to do the encryption on swap then past the swapon -s results? – Adscnet Jul 31 '14 at 16:28
  • yes I know, but cant live without encryption. I'll prepare the data and send it to you. Thanks in advance. – Adscnet Jul 31 '14 at 16:50
  • results after encrypting swap & before reboot: -- [ sudo cat /etc/crypttab ] [ cryptswap1 UUID=6ed3aa70-2d53-4ba7-a03c-034959db49bf /dev/urandom swap,cipher=aes-cbc-essiv:sha256 ] [ sudo blkid | grep swap ] [ /dev/mapper/cryptswap1: UUID="9cff2ac3-9bed-438d-829a-2b97f91da0d1" TYPE="swap" ] [ sudo swapon -s ] [ Filename Type Size Used Priority ] [ /dev/mapper/cryptswap1 partition 14998524 836612 -1 ] – Adscnet Jul 31 '14 at 17:29

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