<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1469202432625_11575">Hi,</div><div id="yui_3_16_0_ym19_1_1469202432625_11575"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">I'm running LFS (Linux From Scratch) with systemd-230, compiled from source. I have three LUKS-encrypted devices:</div><div id="yui_3_16_0_ym19_1_1469202432625_11575"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575">/dev/mapper/swap</div><div id="yui_3_16_0_ym19_1_1469202432625_11575">/dev/mapper/root</div><div id="yui_3_16_0_ym19_1_1469202432625_11575">/dev/mapper/home</div><div id="yui_3_16_0_ym19_1_1469202432625_11575"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">I want to drop into initramfs and do some maintenance work, for which I require all three of these encrypted devices to remain active.</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">I create /run/initramfs with a populated and working initramfs. I create /run/initramfs/shutdown with permissions 0755 and the following content:</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">#/bin/sh</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">exec busybox sh</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">When I issue the shutdown command I get dropped into the initramfs and I get the busybox shell. Howerver, only /dev/mapper/root (my / ) remains active. /dev/mapper/swap and /dev/mapper/home point to non-existent /dev/dm-* block devices.</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">Manually trying cryptsetup open /dev/sdaN label just hangs without activating the device.</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">I'm guessing systemd goes on a killing spree and kills all the crypt processes, except the ones associated with / (/oldroot in the initramfs).</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">Is there a way to tell systemd to keep the encrypted devices active, even if it unmounts their filesystems?</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">Thanks,</div><div id="yui_3_16_0_ym19_1_1469202432625_11575" dir="ltr">IvanK.</div></div></body></html>