[trusty] Swap partition not set up correctly

Bug #1303002 reported by Michael Flaig
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I think I found a bug with the creation of the swap, here is what I did

sda1 was kept as EFI
sda2 created as ext2 mount to /boot
sda3 created as swap
sda4 created as btrfs

I selected "Encrypt my home"
Installation went fine.

After reboot and logon I asked myself if SWAP was encrypted as I only selected swap, after I found out that when I create a dmcrypt volume I could not select a random key, which I would like to have for swap.

To my satisfaction crypttab was already set up!

mfl@devore:~$ cat /etc/crypttab
cryptswap1 UUID=5300177f-d9c4-4d71-9039-b65273ce9917 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

BUT: top shows, that there is no swap enabled:
top - 12:01:57 up 19 min, 5 users, load average: 0,03, 0,07, 0,06
Tasks: 212 total, 1 running, 210 sleeping, 0 stopped, 1 zombie
%Cpu(s): 1,2 us, 0,6 sy, 0,9 ni, 97,0 id, 0,2 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem: 10120340 total, 2343864 used, 7776476 free, 1856 buffers
KiB Swap: 0 total, 0 used, 0 free. 1625312 cached Mem

weird!

mfl@devore:~$ sudo /etc/init.d/cryptdisks restart
[sudo] password for mfl:
 * Stopping remaining crypto disks... * cryptswap1 (stopped)... [ OK ]
 * Starting remaining crypto disks... * cryptswap1 (skipped, device /dev/disk/by-uuid/5300177f-d9c4-4d71-9039-b65273ce9917 does not exist)... [fail]
                                                                                                                                                                                   [ OK ]

mfl@devore:~$ ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 100 Apr 5 11:42 .
drwxr-xr-x 5 root root 100 Apr 5 11:42 ..
lrwxrwxrwx 1 root root 10 Apr 5 11:42 3beb9864-e87b-4a61-a06d-fd351038b37d -> ../../sda4
lrwxrwxrwx 1 root root 10 Apr 5 11:42 45461e04-02c4-481b-9d6c-efa214490de1 -> ../../sda2
lrwxrwxrwx 1 root root 10 Apr 5 11:42 6B91-2F53 -> ../../sda1

Okay, partition missing? Weird! Check parted...

mfl@devore:~$ sudo parted /dev/sda print all
Model: ATA TOSHIBA THNSNH25 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 1049kB 512MB 511MB fat32 boot
 2 512MB 1024MB 512MB ext2
 3 1024MB 6024MB 5000MB
 4 6024MB 256GB 250GB btrfs

sda3 happens to be there, but not found by UUID with which it was set up by the installer.

Tags: trusty
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
Tomo Popovic (tp0x45) wrote :

Confirmed on several laptop/desktop PCs. Swap partition not available after the install. The temporary workaround was to:
1) install gparted
2) format swap partition as linux-swap
3) comment/delete line in the /etc/crypttab containing description of cryptswap1
4) use sudo blkid to find your new UUID for the swap partition you just formatted
5) edit /etc/fstab to specify use of UUID=<number from #4> as your swap instead of cryptswap1

This workaround does not get you with encrypted swap partition, but a regular/working one.

Hope someone finds this useful.

Tomo

Revision history for this message
Nick Dowson (nickmdowson) wrote :

I've also just experienced this bug, having just installed Kubuntu (not sure if that should be marked as affecting that package?)

I chose a fully encrypted disk (LVM) as well as an encrypted home partition. And therefore there is a 3.9 GiB swap_1 partition in my Kubuntu encrypted volume group - but it's not enabled and during boot it gives an error '/ ... partition not mounted'

(I also notice that the installer only created that amount of swap, despite my system having 3.7 gib ram and the ubuntu documentation that I've read suggesting that you need twice the amount of swap in order to activate hibernation?)

Is there a workaround for this such as creating a swap file on the encrypted partition? would this enable hibernation?

Cheers.

Revision history for this message
Albert Pool (albertpool) wrote :

When using /dev/sdXY instead of UUID in the /etc/crypttab file, it works right in 14.04. It looks like the system no longer recognizes the cryptswap's UUID on boot.

However using /dev/sda6 is not a solution for me. I have a hot-pluggable disk which always becomes /dev/sda when it is present on boot, turning my main disk into /dev/sdb.

Revision history for this message
Albert Pool (albertpool) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.