LP#1879980 -- verification steps for initramfs-tools (without/with patched cryptsetup) Disk Setup: 2 virtio disks in md raid1 with dm crypt. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 252:0 0 8G 0 disk ├─vda1 252:1 0 243M 0 part /boot ├─vda2 252:2 0 1K 0 part └─vda5 252:5 0 7.8G 0 part └─md0 9:0 0 7.8G 0 raid1 └─md0_crypt 253:0 0 7.8G 0 crypt / vdb 252:16 0 8G 0 disk ├─vdb1 252:17 0 243M 0 part ├─vdb2 252:18 0 1K 0 part └─vdb5 252:21 0 7.8G 0 part └─md0 9:0 0 7.8G 0 raid1 └─md0_crypt 253:0 0 7.8G 0 crypt / $ cat /proc/mdstat Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10] md0 : active raid1 vda5[0] vdb5[1] 8131584 blocks super 1.2 [2/2] [UU] unused devices: $ sudo dmsetup status md0_crypt: 0 16259072 crypt Scenario 1) reference / both -updates: initramfs-tools & cryptsetup from bionic-updates ======== $ dpkg -s initramfs-tools cryptsetup | grep -i version: Version: 0.130ubuntu3.10 Version: 2:2.0.2-1ubuntu1.1 GOOD BOOT: Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: [ 14.941405] NET: Registered protocol family 38 [ 15.064025] random: cryptsetup: uninitialized urandom read (2 bytes read) cryptsetup (md0_crypt): set up successfully done. Begin: Running /scripts/local-premount ... done. Begin: Will now check root file system ... fsck from util-linux 2.31.1 [/sbin/fsck.ext4 (1) -- /dev/mapper/md0_crypt] fsck.ext4 -a -C0 /dev/mapper/md0_crypt /dev/mapper/md0_crypt: clean, 60462/509040 files, 517521/2032384 blocks done. [ 15.157099] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) done. INCORRECT PASSWORDS: There are two loops of 3-attempts for password, on local-top and local-block. THen it drops to the shell. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... done. Begin: Running /scripts/local-premount ... done. Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... done. done. Gave up waiting for root file system device. Common problems: - Boot args (cat /proc/cmdline) - Check rootdelay= (did the system wait long enough?) - Missing modules (cat /proc/modules; ls /dev) ALERT! UUID=ae67a530-3893-4019-8ec4-4f15050d69de does not exist. Dropping to a shell! BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) DEGRADED RAID: Remove disk 2 from the VM:
The loop takes 180 seconds (18 lvm messages, one every 10 seconds), then drops to the shell. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available done. ALERT! /dev/disk/by-uuid/64a030a2-1a88-43fb-87e2-1cedfc794f80 does not exist. Check cryptopts=source= bootarg: cat /proc/cmdline or missing modules, devices: cat /proc/modules; ls /dev -r Dropping to a shell. Will skip /dev/disk/by-uuid/64a030a2-1a88-43fb-87e2-1cedfc794f80 if you can't fix. BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) Scenario 2) mixed: initramfs-tools from bionic-proposed & cryptsetup from bionic-updates ======== $ dpkg -s initramfs-tools cryptsetup | grep -i version: Version: 0.130ubuntu3.11 Version: 2:2.0.2-1ubuntu1.1 GOOD BOOT: (same behavior) Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: [ 10.366340] NET: Registered protocol family 38 [ 10.468698] random: cryptsetup: uninitialized urandom read (2 bytes read) cryptsetup (md0_crypt): set up successfully done. Begin: Running /scripts/local-premount ... done. Begin: Will now check root file system ... fsck from util-linux 2.31.1 [/sbin/fsck.ext4 (1) -- /dev/mapper/md0_crypt] fsck.ext4 -a -C0 /dev/mapper/md0_crypt /dev/mapper/md0_crypt: clean, 60470/509040 files, 518228/2032384 blocks done. [ 10.551468] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) done. WRONG PASSWORDS: (same behavior) Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: [ 12.389217] NET: Registered protocol family 38 No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? [ 20.566552] random: fast init done cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... done. Begin: Running /scripts/local-premount ... done. Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... [ 275.383656] random: udevadm: uninitialized urandom read (16 bytes read) [ 275.393165] random: udevadm: uninitialized urandom read (16 bytes read) [ 275.394816] random: udevadm: uninitialized urandom read (16 bytes read) done. done. Gave up waiting for root file system device. Common problems: - Boot args (cat /proc/cmdline) - Check rootdelay= (did the system wait long enough?) - Missing modules (cat /proc/modules; ls /dev) ALERT! UUID=ae67a530-3893-4019-8ec4-4f15050d69de does not exist. Dropping to a shell! BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) MISSING DRIVE: (same behavior) Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available done. ALERT! /dev/disk/by-uuid/64a030a2-1a88-43fb-87e2-1cedfc794f80 does not exist. Check cryptopts=source= bootarg: cat /proc/cmdline or missing modules, devices: cat /proc/modules; ls /dev -r Dropping to a shell. Will skip /dev/disk/by-uuid/64a030a2-1a88-43fb-87e2-1cedfc794f80 if you can't fix. BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) Scenario 3) both "-proposed": initramfs-tools from bionic-proposed & cryptsetup patched/from PPA ======== $ dpkg -s initramfs-tools cryptsetup | grep -i version: Version: 0.130ubuntu3.11 Version: 2:2.0.2-1ubuntu1.2 # PPA GOOD BOOT: (same behavior) Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: [ 8.675149] NET: Registered protocol family 38 [ 8.809840] random: cryptsetup: uninitialized urandom read (2 bytes read) cryptsetup (md0_crypt): set up successfully done. Begin: Running /scripts/local-premount ... done. Begin: Will now check root file system ... fsck from util-linux 2.31.1 [/sbin/fsck.ext4 (1) -- /dev/mapper/md0_crypt] fsck.ext4 -a -C0 /dev/mapper/md0_crypt /dev/mapper/md0_crypt: clean, 64240/509040 files, 526222/2032384 blocks done. [ 8.894335] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) done. WRONG PASSWORDS: (diff behavior -- one more loop) There are now THREE loops of 3-attempts for password, on local-top and local-block. THen it drops to the shell. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... Please unlock disk md0_crypt: [ 17.240722] NET: Registered protocol family 38 No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? [ 21.755919] random: fast init done Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... done. Begin: Running /scripts/local-premount ... done. Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... [ 190.660430] random: udevadm: uninitialized urandom read (16 bytes read) [ 190.662243] random: udevadm: uninitialized urandom read (16 bytes read) [ 190.663459] random: udevadm: uninitialized urandom read (16 bytes read) done. Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? Please unlock disk md0_crypt: No key available with this passphrase. cryptsetup (md0_crypt): cryptsetup failed, bad password or options? cryptsetup (md0_crypt): maximum number of tries exceeded cryptsetup: going to sleep for 60 seconds... done. Gave up waiting for root file system device. Common problems: - Boot args (cat /proc/cmdline) - Check rootdelay= (did the system wait long enough?) - Missing modules (cat /proc/modules; ls /dev) ALERT! UUID=ae67a530-3893-4019-8ec4-4f15050d69de does not exist. Dropping to a shell! BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.3) built-in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) MISSING DRIVE (diff behaviors -- different timeouts, then succeeds in the end) The first loop (local-top) takes 5 seconds (5 lvm messages, one every second) The second loop (new, local-block) takes up to 30 seconds, 20ish in this case (20 lvm messages, one every second) then if successfully detects the device has been activated by mdadm and BOOTS! # First loop: Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available cryptsetup (md0_crypt): lvm is not available done. done. Begin: Running /scripts/local-premount ... done. # Second loop: Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done.[ 43.775985] random: fast init done cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. cryptsetup (md0_crypt): lvm is not available Begin: Waiting for encrypted source device... ... cryptsetup (md0_crypt): lvm is not available done. # mdadm activates degraded array [ 59.469180] md/raid1:md0: active with 1 out of 2 mirrors [ 59.469894] md0: detected capacity change from 0 to 8326742016 [ 59.470659] random: systemd-udevd: uninitialized urandom read (16 bytes read) [ 59.471546] random: systemd-udevd: uninitialized urandom read (16 bytes read) [ 59.472403] random: systemd-udevd: uninitialized urandom read (16 bytes read) # password prompt Please unlock disk md0_crypt: # rootfs is mounted [ 121.893385] NET: Registered protocol family 38 cryptsetup (md0_crypt): set up successfully done. Begin: Will now check root file system ... fsck from util-linux 2.31.1 [/sbin/fsck.ext4 (1) -- /dev/mapper/md0_crypt] fsck.ext4 -a -C0 /dev/mapper/md0_crypt /dev/mapper/md0_crypt: clean, 64241/509040 files, 528300/2032384 blocks done. [ 122.236598] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null) done.