Open phirince opened 11 months ago
# /etc/crypttab
cryptroot /dev/mapper/cryptroot none luks,timeout=60
kernel command line args (must be provided to dracut via "kernel_commandline" or provided by GRUB -- Dracut concatenates, then parses those two sources)
# /etc/default/grub
GRUB_CMDLINE_LINUX="rd.auto=1 rd.driver.pre=btrfs rd.luks.allow-discards rd.luks.timeout=0 rd.luks.uuid=luks-<<uuid of encrypted volume>> root=/dev/mapper/cryptroot rootfstype=btrfs rootflags=rw,relatime,ssd,space_cache=v2,subvolid=5,subvol=/"
the dracut '90crypt' scripts will prompt you for the password of the volume that matches the rd.luks.uuid
Describe the bug I have a system which has an encrypted root partition on mdraid array.
In order to mount this during bootup, I have the following inside the crypttab file.
Even though the key file is included in the crypttab file and contains the correct key to decrypt the partition, I get asked for the passphrase of device
luks-c156b2c0-d516-48d7-805b-a78bac83d818
. When I entered the initramfs shell withrd.break
option, I found this:Apparently,
parse-crypt.sh
is not recognizing that an entry for the root device is already present in /etc/crypttab and adding that extra line. This issue goes away once I replace the mapper name to be same as theluks-UUID
nameI think this new entry is generated at this line: https://github.com/dracutdevs/dracut/blob/6acfecae572fb457115b276b5b64d9424ad5187b/modules.d/90crypt/crypt-run-generator.sh#L25
PS: Interestingly, this issue only happen when rd.auto kernel parameter is set to 1.
Distribution used CentOS Linux release 7.9.2009 (Core)
Dracut version Version: 033-572.el7
Init system systemd
To Reproduce An encrypted root partition needs to be created on top of a software RAID1 array. The encryption key as well as the /etc/crypttab file as above should be added to the initramfs and the host should be booted up.
Expected behavior Dracut should have recognized that an entry for root partition is already present in /etc/crypttab and shouldn't have added additional entries.
Additional context Kernel commandline options: