0

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

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
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.

Zanna
  • 70,465
Adscnet
  • 1
  • 2
  • 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 03:59
  • Welcome to AskUbuntu! There seem to be problems right now with some swap encryption. http://askubuntu.com/questions/91292/is-my-swap-cryptswap-partition-working-properly/109217#109217 , but you could check this as well. http://askubuntu.com/questions/248158/how-do-i-setup-an-encrypted-swap-file – No Time Jul 31 '14 at 04: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

1 Answers1

0

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.

Zanna
  • 70,465
muru
  • 197,895
  • 55
  • 485
  • 740
  • 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
  • now results after reboot: [ sudo cat /etc/crypttab ] [ cryptswap1 UUID=6ed3aa70-2d53-4ba7-a03c-034959db49bf /dev/urandom swap,cipher=aes-cbc-essiv:sha256 ] [ sudo blkid | grep swap ] [ No data available ] [ sudo swapon -s ] [ No data available ] swap not working – Adscnet Jul 31 '14 at 17:30
  • Also if I run swapon -a I get this [ swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory ] – Adscnet Jul 31 '14 at 17:45
  • @Adscnet @Adscnet does sudo blkid | grep 6ed show anything? – muru Jul 31 '14 at 17:54
  • doesn't show anything – Adscnet Jul 31 '14 at 18:06
  • @Adscnet so the base partition for cryptswap got its uuid changed. Try looking up the UUID of the partition and replacing the old value in crypttab. – muru Jul 31 '14 at 18:24
  • when I run blkid, I don't see the swap UUID coz the partition as I said before its unknown to the system – Adscnet Jul 31 '14 at 18:30
  • @Adscnet don't look for swap in blkid. Try to identify by other means, like partition number or identifier (sdaX). – muru Jul 31 '14 at 19:18
  • Iam not able to do anything with this partition not even mounting it to get the UUID – Adscnet Aug 01 '14 at 03:31
  • @Adscnet can you post the output of sudo blkid and lsblk in your question? Not in the comments, it's really hard to understand output in the comments. – muru Aug 01 '14 at 22:05