I have a virtualized CentOS 7 server that needs to mount multiple password-protected encrypted volumes. I cannot automatically map the devices on boot, because I don't have access to the console during the boot process to enter the decryption password. After I reboot the system, I have to manually run
cryptsetup luksOpen <device> <name>
to map each underlying block device to an encrypted device. That requires keeping notes on the UUID of each underlying block device and the name it maps to. Is there an easy way to automate this process? I can add the information to /etc/crypttab
with the noauto
keyword to prevent the devices from mounting on boot. However, I can't get cryptsetup to use the information from this file.
It would be great if there were a command like cryptsetup luksOpen <name>
that would read /etc/crypttab
to find the name of the underlying block device (similar to the way that you can can mount <mountpoint>
if is defined in /etc/fstab
).
Is there any way to get cryptsetup to read the mappings from /etc/crypttab
?