-   Linux - Software (
-   -   Which process/program processes /etc/crypttab (

taylorkh 01-22-2017 08:08 PM

Which process/program processes /etc/crypttab
CentOS 7.3

I have 4 encrypted partitions/drives in my server which I unlock and mount at boot time by defining mappers in /etc/crypttab and using a key file. The unlocked file systems are mounted with entries in /etc/fstab. Here are examples

secret18.0a  /dev/disk/by-uuid/5828d371-db06-4123-9c07-943ed4efe423 /root/keyfile luks

/dev/mapper/secret18.0a  /media/data18.0a  ext4 defaults 0  1

I am trying to track down where this activity fits in systemd. I have not found the /etc/crypttab file referenced in any systemd scripts so I need to know what program is processing the file. Any ideas?



syg00 01-22-2017 09:12 PM

"man systemd-cryptsetup-generator"

taylorkh 01-22-2017 09:38 PM

Thanks syg00,

Very interesting read. I never heard of unit generators before. The key point I came away with is that they operate "very early at bootup." That leads me to believe that I will need to replace the /etc/crypttab approach with something home made.

What I am trying to achieve is to unlock the partitions using a key file which resides on a flash drive. If the flash drive or key is not present the system would not try to unlock the partitions nor mount the file systems. As unlocking occurs before mounting per /etc/fstab and the usb flash drive would be mounted by /etc/fstab which takes place after the key file would be needed... Not a path to success.

I have a script which will detect the appropriate flash drive, mount it, check for the key file and if present unlock and mount the drives then unmount the flash drive. I guess I need to figure out how to fit this into the systemd scheme of things instead of relying on /etc/crypttab and /etc/fstab. :study:


All times are GMT -5. The time now is 08:53 AM.