Hallo,
Ich bin gerade beim Wechsel auf eine neues Gerät und versuche wie immer Grub mit verschlüsselter Boot Partition einzurichten.
Das Entsperren der /boot partition via keyfile funktioniert korrekt.
Beim Entsperren von der Disk mit root und swap brauche ich aber dennoch immer mein Passwort obwohl das Keyfile korrekt ist.
Meine Partitionen (entsprechen im Prinzip den
Vorgaben des Arch Wiki):
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 200M 0 part
│ └─cryptboot 254:3 0 198M 0 crypt /boot
└─nvme0n1p3 259:3 0 476,2G 0 part
└─lvm 254:0 0 476,2G 0 crypt
├─vg0-swap 254:1 0 64G 0 lvm [SWAP]
└─vg0-root 254:2 0 412,2G 0 lvm /
blkid:
/dev/nvme0n1p1: UUID="702B-5CF3" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="ad68bb99-7101-4623-b3f3-a98e242bc522"
/dev/nvme0n1p2: UUID="50edd581-0b39-4ff0-acd3-d4c6d6227166" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="29b20931-4222-4075-9621-953b6e40d545"
/dev/nvme0n1p3: UUID="6916f41f-436a-4eb4-8851-a88c30a4b084" TYPE="crypto_LUKS" PARTLABEL="Linux LVM" PARTUUID="8368cff2-21b8-46bc-b164-3d776ab15df8"
/dev/mapper/lvm: UUID="r2U7Dv-YyaX-mrfA-L3hY-dHSF-5U2G-mSOtO9" TYPE="LVM2_member"
/dev/mapper/vg0-swap: UUID="b782b74b-5c34-4161-8fb8-f0588d28970c" TYPE="swap"
/dev/mapper/vg0-root: UUID="b268e2bd-2364-42f2-80cd-4582002a7d75" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/cryptboot: UUID="1acc5485-11a2-4a9f-ac89-1631b8070a33" BLOCK_SIZE="1024" TYPE="ext2"
/etc/mkinitcpio.conf Hooks & Files:
HOOKS=(base udev autodetect keyboard keymap modconf block encrypt lvm2 resume filesystems fsck)
FILES=(/crypto_keyfile.bin)
/etc/default/grub:
GRUB_CMDLINE_LINUX="cryptdevice=UUID=6916f41f-436a-4eb4-8851-a88c30a4b084:lvm resume=/dev/mapper/vg0-swap"
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
GRUB_ENABLE_CRYPTODISK=y
Das Keyfile /crypto_keyfile.bin funktioniert korrekt:
cryptsetup luksDump /dev/nvme0n1p3
LUKS header information for /dev/nvme0n1p3
Version: 1
Cipher name: aes
Cipher mode: xts-plain64
Hash spec: sha256
Payload offset: 4096
MK bits: 512
MK digest: c5 99 70 f0 75 31 a6 1e 49 7e 3c 74 5c d7 01 bc 0e 4e c7 2e
MK salt: 9e 3c 24 5c 15 8c fd 34 1c f3 c6 15 24 48 56 51
fe 30 4b b3 9e 95 9f 1c b1 2a a6 91 e5 08 b7 03
MK iterations: 116404
UUID: 6916f41f-436a-4eb4-8851-a88c30a4b084
Key Slot 0: ENABLED
Iterations: 1916956
Salt: 46 01 ae 6c 3d e2 ec 4d 36 29 46 9a 61 1e 6f e7
5d 91 1d 43 19 13 fd f2 c7 6f bb 10 9a 34 12 18
Key material offset: 8
AF stripes: 4000
Key Slot 1: ENABLED
Iterations: 2036068
Salt: cf 2a 2b 50 9a e0 b8 65 4b df 85 2b e6 52 1f 82
81 fe 7a d2 d3 1b ab 61 ab f2 ab 88 4f 4b c8 dd
Key material offset: 512
AF stripes: 4000
Key Slot 2: DISABLED
Key Slot 3: DISABLED
Key Slot 4: DISABLED
Key Slot 5: DISABLED
Key Slot 6: DISABLED
Key Slot 7: DISABLED
cryptsetup --verbose open --key-file /crypto_keyfile.bin --test-passphrase /dev/nvme0n1p3
Schlüsselfach 1 entsperrt.
Befehl erfolgreich.
Das Keyfile ist im initramfs vorhanden:
zcat /boot/initramfs-5.4-x86_64.img | cpio -idmv
....
....
/crypto_keyfile.bin
....
....
und der Inhalt von /etc/crypttab:
cryptboot /dev/nvme0n1p2 /etc/key luks
Was ich bereits (erfolglos) getestet habe:
- FILES in mkinitcpio.conf in anderer Syntax angeben, also FILES=("/crypto_keyfile.bin") und FILES="/crypto_keyfile.bin"
- Cryptkey in GRUB explizit angeben:
GRUB_CMDLINE_LINUX="cryptdevice=UUID=6916f41f-436a-4eb4-8851-a88c30a4b084:lvm cryptkey=rootfs:/crypto_keyfile.bin resume=/dev/mapper/vg0-swap"
- Neues Keyfile erstellen
- nvm1n0p3, lvm bzw. vg-0 in das crypttab eintragen.
Leider komme ich einfach nicht darauf warum es nicht klappt, inbesondere weil diese Config exakt so auf meinem alten Gerät ohne Probleme funktioniert?