[systemd-devel] removing dm-crypt mapping hangs on shutdown

Lennart Poettering lennart at poettering.net
Tue Jun 19 07:07:14 PDT 2012


On Wed, 13.06.12 14:58, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> I guess the initramfs should really write something in /run/initramfs
> folder that indicates which devices it's "managing" such that systemd
> can only deal with the remainder.

Well, the idea is that the normal cryptsetup logic detaches all devies
as part of normal shutdown, i.e. via cryptsetup at ...service, way before
systemd-shutdown becomes PID 1. At that point systemd-shutdown will
just clean up what was forgotten before, and jump back into the
initrd which is then responsible for the rootfs. 

The kernel reports EBUSY when a DM device is still needed for the root
fs, so this is all flag we need.

To me it appears as if there are two things to fix:

a) for some reason the cryptsetup at ...service shutdown logic didn't work
for you for non-root-fs disks.

b) libdevmapper sometimes hangs if somebody else invoked the kernel DM
ioctls directly.

a) of course doesn't apply if you talk about encrypted root.

b) is something to fix between the kernel and libdevampper, not systemd.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list