cryptsetup preventing proper boot swap AND root on crypt device together

Bug #1487127 reported by Weed
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cryptsetup (Ubuntu)
Triaged
High
TJ

Bug Description

Summary:

Boot drops into busybox (initramfs) on initial boot.

Cause:

initrd.img/conf/conf.d/cryptroot gets an entry for a subsidary swap LV added as well as the rootfs when using full disk encryption + LVM

The hook script /usr/share/initramfs-tools/hooks/cryptroot
incorrectly adds the swap entry.

Manually removing the entry from the initrd's cryptroot allows the system to boot correctly.

Overview:

# /etc/crypttab

sda5_crypt UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2 none luks,discard

# extracted initrd.img

/tmp/initrd/conf/conf.d# more cryptroot
target=sda5_crypt,source=UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2,key=none,rootdev,lvm=ubuntu--vg-root,discard
target=sda5_crypt,source=UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2,key=none,lvm=ubuntu--vg-swap_1,discard

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/ubuntu--vg-root / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda1 during installation
UUID=955c7e81-81b0-440d-9774-5241beec1493 /boot ext2 defaults 0 2
/dev/mapper/ubuntu--vg-swap_1 none swap sw 0 0

blkid

/dev/sda1: UUID="955c7e81-81b0-440d-9774-5241beec1493" TYPE="ext2"
/dev/sda5: UUID="e395c3fa-5e1c-4ecd-ade7-b924e20a17a2" TYPE="crypto_LUKS"
/dev/mapper/sda5_crypt: UUID="UTspOf-uT8M-eHMO-0Hmu-Rc5S-JEjb-f7gBFF" TYPE="LVM2_member"
/dev/mapper/ubuntu--vg-root: UUID="8517460e-22ef-418d-848d-92e987978dab" TYPE="ext4"
/dev/mapper/ubuntu--vg-swap_1: UUID="a122b964-028e-4452-bf2e-fc30491081b0" TYPE="swap"
/dev/sdb1: LABEL="Elements" UUID="308B9F8A54410329" TYPE="ntfs"

lsblk

NAME FSTYPE LABEL MOUNTPOINT
sda
├─sda1 ext2 /boot
├─sda2
└─sda5 crypto_LUKS
  └─sda5_crypt (dm-0) LVM2_member
    ├─ubuntu--vg-root (dm-1) ext4 /
    └─ubuntu--vg-swap_1 (dm-2) swap [SWAP]
sdb
└─sdb1 ntfs Elements /media/weed/Elements
sr0

# Debugging enabled (set -x) in /usr/share/initramfs-tools/hooks/cryptroot

update-initramfs -vu
...
+ echo target=sda5_crypt,source=UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2,key=none,rootdev,lvm=ubuntu--vg-root,discard
...
+ echo target=sda5_crypt,source=UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2,key=none,lvm=ubuntu--vg-swap_1,discard

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: cryptsetup 2:1.6.1-1ubuntu1 [modified: usr/share/initramfs-tools/hooks/cryptroot]
ProcVersionSignature: Ubuntu 3.16.0-46.62~14.04.1-generic 3.16.7-ckt15
Uname: Linux 3.16.0-46-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 20 09:39:02 2015
InstallationDate: Installed on 2015-07-06 (44 days ago)
InstallationMedia: Ubuntu 14.04.2 LTS "Trusty Tahr" - Release amd64 (20150218.1)
SourcePackage: cryptsetup
UpgradeStatus: No upgrade log present (probably fresh install)
crypttab: sda5_crypt UUID=e395c3fa-5e1c-4ecd-ade7-b924e20a17a2 none luks,discard

Revision history for this message
Weed (missionplanner) wrote :
TJ (tj)
Changed in cryptsetup (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → TJ (tj)
Revision history for this message
TJ (tj) wrote :
description: updated
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.