Can anyone explain the mounting process for the following ?
/root lives on an LV in a PV, in a LUKS container
What is the best way to get a GRUB handoff for boot? It’s failing miserably through a manual crtypsetup open /dev/sd# / mounting / chroot /mnt / grub-install (grub install is fine, boot can’t find the volume).
I guess I’m looking for the UUID relationship between GRUB, LUKS, LVM, fstab, and crypttab. grub-install doesn’t seem to be finding things and setting them correctly.
bonus points for filesystem recommendation as well because maybe it all has to be mbr? Can I do this gpt?
It’s not for kernel, these params are just stored by kernel as bootparams and then used by init from initcpio:
$ grep cryptdevice /usr/lib/initcpio/hooks/encrypt
if [ -n "${cryptdevice}" ]; then
$cryptdevice
echo "Use 'cryptdevice=${root}:root root=/dev/mapper/root' instead."
and to encrypt hook it tells where to find our crypt device (UUID=…) and how to map it (root=/dev/mapper/…)
this all is required only to mount root (bootstrap) other disks could be initialized in normal way via unit files.
Now, this maps decrypted sda2 to dm/encDisk but before going to root=… you can put lvm2 hook, which will use dm/encDisk as pv and will map its lvs to other device - you then specify root to be your lv device node (/dev/vg-name/lv-name) rather than encDisk. The hook needs to be injected into mkinitcpio.conf HOOKS as sd-lvm2 and root= param in grub default cmdline. I’ve never tried it though as I’m not a big fan of lvm.