Ubuntu installer doesn't format swap partition when selecting encrypted drive and home

Bug #1301383 reported by Will on 2014-04-02
This bug affects 7 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)

Bug Description


Ubuntu 14.04 Beta 2 AMD64 - "ubuntu-14.04-beta2-desktop-amd64.iso"
Xubuntu 14.04 Beta 2 AMD64 - "xubuntu-14.04-beta2-desktop-amd64.iso"

Steps to reproduce running the standard amd64 iso installer:

1. Select install Ubuntu
2. Choose erase entire disk and auto-partition
3. Select full disk encryption
4. Select home drive encryption
5. Set other timezone/username settings


On boot the swap partition is not activated.
However, entries for the swap partition are present in /etc/crypttab and /etc/fstab.


The following command: "mkswap /dev/mapper/ubuntu--vg-swap_1" immediately resolves the issue.
The installer should automatically ensure the swap partition is formatted.

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1301383/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
tags: added: trusty
affects: ubuntu → ubiquity (Ubuntu)
Will (tcosprojects) wrote :

I tried this again with the Xubuntu 14.04 2014-04-08 daily live iso and am still seeing the same issue. Any additional diagnostics you'd like me to gather that would help track down this issue?

Launchpad Janitor (janitor) wrote :

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

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Star Man (starman) wrote :

This is happening to me right now. I'm using Trusty final release.
Installer doesn't enable SWAP partition at all.

Star Man (starman) wrote :

The «mkswap» solution provided by the user who filed this bug didn't work for me.
I'm constrained to use an unencrypted SWAP partition.
Is there any other solution for this? (Or should I have to go back to Precise again...)

Albert Pool (albertpool) wrote :

A solution has been proposed at bug #1310058 in comment #3.

After patching the ecryptfs-setup-swap file as posted there, you first need to setup an unencrypted swap before you can encrypt it again.

For reference, how to create an unencrypted swap:
Please format the partition as linux-swap with GParted.
Then, edit /etc/fstab and uncomment the line about the unencrypted swap; on that line, change the UUID into the current UUID of your unencrypted swap. Mount your swap using "sudo swapon -a". Now, I suppose, you have a working unencrypted swap. You can use swapon -s to verify that your swap is enabled.

When you have an unencrypted swap enabled, you can again convert it into an encrypted one. You will first need to remove the lines about your old (not working) encrypted swap from /etc/crypttab and /etc/fstab.
Then you can convert your unencrypted swap into an encrypted one, using sudo ecryptfs-setup-swap. That will now work fine, because you have patched the file to include "offset=8" in the /etc/crypttab file.
Again, use swapon -s to verify that the swap is enabled; but now it should display /dev/mapper/cryptswap1 as device.

Another workaround, which is probably easier to apply: replace the UUID in /etc/crypttab by a /dev/sdXY name of the partition. Unlike the offset=8 patch of syscon-hh, this does not require re-creating the encrypted swap. This is how it was done on Raring and earlier releases; only since Trusty, UUID's are used here.
(For me this was not a solution: I have a hot-pluggable disk which becomes /dev/sda when it is inserted at boot time, causing my main disk to become /dev/sdb, so I need to use UUID's)

I am marking this bug as a duplicate of #1310058.

Star Man (starman) wrote :

I made it work by installing 12.04 and then inmediately upgrading to 14.04
Every other way to get SWAP properly encrypted and stable failed for me.

Redsandro (redsandro) wrote :

@starman if you have a working setup, could you show us the following files?

* /etc/fstabtab
* /etc/crypttab

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers