#781468 cryptsetup depends on udev in shutdown initramfs

Package:
cryptsetup-bin
Source:
cryptsetup
Description:
disk encryption support - command line tools
Submitter:
Dominik Brodowski
Date:
2022-08-08 11:09:03 UTC
Severity:
normal
#781468#5
Date:
2015-03-29 17:22:44 UTC
From:
To:
Using Debian's cryptsetup binary works just fine in my initramfs during
boot. However, it doesn't work well during shutdown, when systemd hands over
to the initramfs again[*], and udev is no longer running:

$ cryptsetup luksClose VOLUME
...
# Deactivating volume VOLUME
# dm status VOLUME ...
# Udev cookie ... created
# Udev cookie ... incremeted to 1
# Udev cookie ... incremeted to 2
# Udev cookie ... assigned to REMOVE task(2) with flags
# dm remove VOLUME
# VOLUME: Stacking NODE_DEL (verify_udev)
# Udev cookie ... decremented to 1
# Udev cookie ... waiting for zero

Then cryptsetup hangs, and does not return to the shell / shutdown script.

As the same issue also appears in upstream cryptsetup (1.7.0-git -
046e0e52), I see two options to resolve this for future revisions of
cryptsetup:

- Disable UDEV in the device mapper backend, same as it is done when
  running cryptsetup from the initramfs during boot.

- Provide a command line option similar to LVM's vgchange --noudevsync

Many thanks for taking a look at this issue.

Best,
        Dominik


[*] http://www.freedesktop.org/wiki/Software/systemd/InitrdInterface/