<div dir="ltr">Hi, I'm going on with my work to have systemd in initrd on NixOS (using dracut is a little complicated at the moment).<div>Everything works fine, I've ported luks and lvm and both work separately. However I'm hitting a problem when using luks and lvm on top of luks.</div><div><br></div><div>SETUP</div><div><br></div><div>Software: systemd 212, lvm 2.02.111, cryptsetup 1.6.3, kernel 3.14.22</div><div><br></div><div>The test is done with kvm.</div><div><br></div><div>I have a device /dev/vda formatted with luks which gets opened in /dev/mapper/luksroot.</div><div>Then lvm with a vg named "vg" and an lv named "lv" so that it gets named /dev/mapper/vg-lv.</div><div><br></div><div>I have a sysroot.mount What=/dev/mapper/vg-lv and requires/after the cryptsetup service.</div><div>The cryptsetup service runs systemd-cryptsetup attach luksroot /dev/vda.</div><div><br></div><div>All fine, the luks gets opened correctly etc.</div><div><br></div><div>PROBLEM</div><div><br></div><div>Note I don't do any vgchange -a y, in any service, in any script.</div><div>The /dev/vda appears, and then cryptsetup service runs. Luks is unlocked, /dev/mapper/luksroot and systemd tries to mount sysroot.mount.</div><div><br></div><div>This is the problem, systemd does not wait for /dev/mapper/vg-lv to appear before mounting sysroot. In fact, it does not exist at all.</div><div>It's like luksOpen + some udev rule tell udev/systemd that the device is there, but it's not.</div><div><br></div><div>Note: if I disable the cryptsetup service, sysroot.mount correctly waits for /dev/mapper/vg-lv to appear.</div><div><br></div><div>So the setup is pretty simple, I've read the udev rules however they're a little complex for my poor knowledge.</div><div>The udev rules installed are all of lvm, dm. From systemd/udev it's:</div><div>60-cdrom_id.rules<br></div><div>60-persistent-storage.rules<br></div><div>80-drivers.rules<br></div><div>99-systemd.rules<br></div><div><br></div><div>Any hints on where the culprit can be? Same happens with lvmetad.</div><div><br></div><div>Best regards,</div></div>