You are not logged in.

#1 2024-07-18 01:30:47

nvann
Member
Registered: 2024-04-04
Posts: 8

Two LUKS encrypted drives with one password under the same LVM?

I only have one drive but I'm thinking of expanding but I'm not exactly sure how to put the second drive under the same LVM group and make them open under the use of only one password. This is what I currently do:

cryptsetup luksFormat /dev/sda2 <- main drive
cryptsetup luksOpen /dev/sda2 luks
pvcreate /dev/mapper/luks
vgcreate vg0 /dev/mapper/luks
lvcreate --size xG vg0 --name swap <- swap
lvcreate -l +100%FREE vg0 --name root
mkfs.ext4 -L ROOT /dev/mapper/vg0-root
mkswap -L SWAP /dev/mapper/vg0-swap
mount /dev/mapper/vg0-root /mnt
mkdir /mnt/efi
mount /dev/sda1 /mnt/efi
swapon /dev/mapper/vg0-swap

How would I need to adapt this to make room for an, for example, encrypted /dev/sdb.

Offline

#2 2024-07-19 09:41:32

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 644

Re: Two LUKS encrypted drives with one password under the same LVM?

To unlock two LUKS devices in early userspace (in the initramfs phase), you need to use sd-encrypt with systemd-based mkinitcpio hooks. If you use the same passphrase for both of them, then you'll only need to enter it once.

Offline

Board footer

Powered by FluxBB