Setting up encrypted swap causes ordering cycle

Bug #1928594 reported by Vasya Pupkin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

root@home:~# cat /etc/crypttab
# <target name> <source device> <key file> <options>
cswap /dev/disk/by-partuuid/95605326-e210-4e13-9f93-50cc3d556aca /dev/urandom cipher=aes-xts-plain64,size=256,hash=sha1,swap

root@home:~# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-73-generic
cryptsetup: WARNING: Resume target cswap uses a key file

After reboot:

root@home:~# systemctl status systemd-random-seed.service
● systemd-random-seed.service - Load/Save Random Seed
     Loaded: loaded (/lib/systemd/system/systemd-random-seed.service; static; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-random-seed.service(8)
             man:random(4)

May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on cryptsetup.target/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on <email address hidden>/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Job systemd-random-seed.service/start deleted to break ordering cycle starting with <email address hidden>/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found ordering cycle on systemd-random-seed.service/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on zfs-mount.service/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on zfs-import.target/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on zfs-import-cache.service/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on cryptsetup.target/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Found dependency on <email address hidden>/start
May 16 18:29:16 home systemd[1]: <email address hidden>: Job systemd-random-seed.service/start deleted to break ordering cycle starting with <email address hidden>/start

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: systemd 245.4-4ubuntu3.6
ProcVersionSignature: Ubuntu 5.4.0-73.82-generic 5.4.106
Uname: Linux 5.4.0-73-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu27.17
Architecture: amd64
CasperMD5CheckMismatches: ./boot/grub/efi.img
CasperMD5CheckResult: fail
Date: Sun May 16 18:40:45 2021
InstallationDate: Installed on 2021-01-21 (115 days ago)
InstallationMedia: Ubuntu-Server 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
Lsusb:
 Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Lsusb-t:
 /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
 /: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
 /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
 /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
     |__ Port 6: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
MachineType: System manufacturer System Product Name
ProcEnviron:
 SHELL=/bin/bash
 LANG=C.UTF-8
 TERM=screen.xterm-256color
 PATH=(custom, no user)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-73-generic root=UUID=7c964d4b-ef4d-40df-b297-631e4233f297 ro bootdegraded=true transparent_hugepage=never
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 03/14/2018
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 3801
dmi.board.asset.tag: Default string
dmi.board.name: Z170-E
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Default string
dmi.chassis.type: 3
dmi.chassis.vendor: Default string
dmi.chassis.version: Default string
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr3801:bd03/14/2018:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKCOMPUTERINC.:rnZ170-E:rvrRev1.xx:cvnDefaultstring:ct3:cvrDefaultstring:
dmi.product.family: To be filled by O.E.M.
dmi.product.name: System Product Name
dmi.product.sku: SKU
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Vasya Pupkin (shadowlmd) wrote :
Revision history for this message
Dan Streetman (ddstreet) wrote :

This looks an awful lot like bug 1875577 and from reading the latest comments it seems like that was never fixed in focal.

Colin did you ever get focal updated with the fix for bug 1875577?

affects: systemd (Ubuntu) → zfs-linux (Ubuntu)
Revision history for this message
Vasya Pupkin (shadowlmd) wrote :

While zfs-linux indeed triggers the issue, the root cause, I believe, is that automatically generated service systemd-cryptsetup@cswap wants to start after systemd-random-seed, even though it uses /dev/urandom which shouldn't require random seed data initialized. Also please note that in this particular case zfs partition is not root.

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.