I migrated all LV extents from one PV to a new PV. Both old and new PVs were LUKS encrypted devices. root is one of the migrated LVs.
This didn't work as, after migration, boot wouldn't even try to unlock the new LUKS PV. It was asking for password for old LUKS, which doesn't exist anymore, those drives have already been reassigned and overwritten.
However, if I use the kernel parameters rd.auto=1, and remove old kernel parameters which specify the UUID of the old PV, I can get linux to boot and ask for the right password. Yet, it still doesn't work.
Before I give the password it says
dracut-initqueue /usr/bin/crypt-run-generator: line 14: cryptsetup: command not found
Unnecessary job for dev-mapper-luks-<UUID of new PV LUKS> was removed
So, it automatically finds the new LUKS partition, and let's me unlock it, but that's all after it has given up on finding usable filesystems on it. Why would it do that?
At this point, the boot process stalls waiting indefinitely for required jobs to complete. I forget all their names, but one is cryptsetup.target and I think one was mounting root. So, that makes sense.
But, I don't know how to configure grub and dracut so that this will work. It's like the initrd has a configuration telling it only to start LVM on the old PV. When I boot a live image all the LVs are there and data looks great.
What grub2 (efi mode) configuration and dracut configuration do I need to fix this?
EDIT Since posting, I've tried many things. I have found kerel params that I think are right, but they don't seem to make any difference. I created a new initrd image with dracut to which I forcefully added cryptsetup and a new, fixed /etc/crypttab. That did seem to help and all the errors are now gone...but it still will not boot! Using the latest options and initrd I've tried, the boot process does not ask for any passphrase. It says "Sending to plymoth for password request" but that just stalls.
Now, one of the kernel options I tried was rd.shell. This gave me a dracut shell after it timed out, unable to find root. From the dracut shell I can start the mdadm RAID PV with --assemble --scan, luksOpen it with my passphrase, and all the LVs are right there. So I still don't understand what it wants.