Bug#801342: systemd: plain dm-crypt volumes not brought up on boot

René Wagner rw at nelianur.org
Thu Oct 8 20:21:36 BST 2015


Package: systemd
Version: 215-17+deb8u2
Severity: normal

[This was originally meant as a followup to #712439 which has been 
archived.]

Dear maintainers,

I upgraded a laptop from wheezy to jessie last weekend using
dist-upgrade which installed systemd as the init system. Since the
upgrade plain dm-crypt volumes are no longer brought up on boot. LUKS
volumes only work without errors if no plain dm-crypt volumes are
configured.

If a single, plain encrypted swap partition is present (alongside a
LUKS volume) this causes the machine to hang for the infamous 90
seconds and drop me into emergency mode. systemd then reports the
following status:

# systemctl status dev-mapper-swap.device
● dev-mapper-swap.device
    Loaded: loaded
    Active: inactive (dead)

Oct 08 20:53:16 laptop systemd[1]: Job dev-mapper-swap.device/start 
timed out.
Oct 08 20:53:16 laptop systemd[1]: Timed out waiting for device 
dev-mapper-swap.device.
# systemctl status dev-mapper-swap.swap
● dev-mapper-swap.swap - /dev/mapper/swap
    Loaded: loaded (/etc/fstab)
    Active: inactive (dead)
      What: /dev/mapper/swap
      Docs: man:fstab(5)
            man:systemd-fstab-generator(8)

Oct 08 20:53:16 laptop systemd[1]: Dependency failed for /dev/mapper/swap.

If I then manually run "cryptdisks_start swap" such that cryptsetup is
called appropriately this changes as follows:

# systemctl status dev-mapper-swap.device
● dev-mapper-swap.device - /dev/mapper/swap
    Follow: unit currently follows state of 
sys-devices-virtual-block-dm\x2d3.device
    Loaded: loaded
    Active: active (plugged) since Thu 2015-10-08 20:54:55 CEST; 8s ago
    Device: /sys/devices/virtual/block/dm-3
# systemctl status dev-mapper-swap.swap
● dev-mapper-swap.swap - /dev/mapper/swap
    Loaded: loaded (/etc/fstab)
    Active: failed (Result: exit-code) since Thu 2015-10-08 20:54:55 
CEST; 39s ago
      What: /dev/mapper/swap
      Docs: man:fstab(5)
            man:systemd-fstab-generator(8)
   Process: 797 ExecActivate=/sbin/swapon /dev/mapper/swap (code=exited, 
status=255)

At this stage I can resume the boot process via "systemctl default" and
this leads to a working system.

# systemctl status dev-mapper-swap.swap
● dev-mapper-swap.swap - /dev/mapper/swap
    Loaded: loaded (/etc/fstab)
    Active: active since Thu 2015-10-08 20:56:11 CEST; 14min ago
      What: /dev/mapper/swap
      Docs: man:fstab(5)
            man:systemd-fstab-generator(8)
   Process: 824 ExecActivate=/sbin/swapon /dev/mapper/swap (code=exited, 
status=0/SUCCESS)

The configuration has been working for years, so I believe this is a
regression in jessie.

# dpkg -l dmsetup
Desired=Unknown/Install/Remove/Purge/Hold
| 
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  dmsetup        2:1.02.90-2. amd64        Linux Kernel Device Mapper 
usersp

# grep swap /etc/crypttab
swap	/dev/sda5	/dev/random	swap,cipher=aes-xts-plain,size=512

[For the record, this is not an entropy problem. Changing the key file
to /dev/urandom does not improve the situation.]

# grep swap /etc/fstab
/dev/mapper/swap none		swap	sw		0	0

# journalctl -b -p 3
[...]
Oct 08 20:53:16 laptop systemd[1]: Timed out waiting for device 
dev-mapper-swap.device.
Oct 08 20:53:16 laptop systemd[1]: Dependency failed for Cryptography 
Setup for swap.
Oct 08 20:53:16 laptop systemd[1]: Dependency failed for Encrypted Volumes.
Oct 08 20:53:16 laptop systemd[1]: Dependency failed for /dev/mapper/swap.
Oct 08 20:53:16 laptop systemd[1]: Dependency failed for Swap.
[...]

systemd also logs identically looking errors about other filesystems on
an encrypted lvm volume. Oddly enough, those go away and the system
boots normally if I remove the swap configuration.

Any help in tracking this down would be appreciated!

Cheers,

Rene



More information about the Pkg-systemd-maintainers mailing list