I'm trying to achieve full disk encryption using LUKS on both internal hard drivers but during boot system asks for passphrase multiple times. I also tried key file method but initramfs cant find this key file. I also noticed that every time i update grub there are two cryptomount lines in grub.cfg` (for both hard drives) How do i configure that system will ask for passphrase only once for /dev/nvme0n1p2 and then automatically opens second hard drive.


sda                       931.5G            
└─sda1        crypto_LUKS 931.5G            a0013d72-5a3f-4c17-b072-2feb0bb4ad3f
  └─hddcrypt  LVM2_member 931.5G            tkWI9N-qp0C-00M0-tWAu-YYDg-zLoj-mBPdmc
    └─vg-home xfs         931.5G /home      1a9eed8c-f79e-4ff2-bcda-0abddcbfbe28
nvme0n1                   238.5G            
├─nvme0n1p1   vfat           99M /boot/efi  294E-E662
└─nvme0n1p2   crypto_LUKS 238.4G            c73094a5-8fd0-42c8-86a2-59d05696a94e
  └─nvmecrypt LVM2_member 238.4G            seVKYc-DEPl-QIv0-3mVf-Lq7G-AOLx-i5Guwf
    ├─vg-swap swap           16G            8399701e-02f6-4700-886b-c7c1cd21448a
    └─vg-root xfs         222.4G /          3483aa8d-8948-4991-88f6-4d5a2efb6bd4

Would you recommend me better setup?


/dev/mapper/vg-root /               xfs     defaults        0       0
UUID=294E-E662      /boot/efi       vfat    umask=0077      0       1
/dev/mapper/vg-home /home           xfs     defaults        0       0
/dev/mapper/vg-swap none            swap    sw              0       0


nvmecrypt UUID=c73094a5-8fd0-42c8-86a2-59d05696a94e none luks,discard
hddcrypt  UUID=a0013d72-5a3f-4c17-b072-2feb0bb4ad3f none luks

/etc/crypttab (using key file)

nvmecrypt UUID=c73094a5-8fd0-42c8-86a2-59d05696a94e /root/.keyfile luks,discard,keyscript=/bin/cat
hddcrypt  UUID=a0013d72-5a3f-4c17-b072-2feb0bb4ad3f /root/.keyfile luks,keyscript=/bin/cat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.