[systemd-devel] crypttab automount

Ralf Jung post at ralfj.de
Mon Jul 21 05:18:09 PDT 2014

Hi all,

first of all, please forgive me if this is not the right list for
questions of systemd users. In this case, I would appreciate if you
could forward me to the right channel for my question. I couldn't find a
"systemd-users" list.

In my laptop, I do have an encrypted partition on a second HDD that I
want to be be mounted automatically, but without delaying the boot.
Concretely, I have the following in my /etc/crypttab:

>  store           UUID=...          /some/keyfile luks

and the following in /etc/fstab:

> /dev/mapper/store     /mnt/store    ext4    errors=remount-ro,noauto,comment=systemd.automount     0       2

Looking at the output of "systemd-analyze plot", I can see that
"systemd-cryptsetup at store.service" is still run automatically on startup
(that's good), and it delays boot (that's bad). Naturally, opening the
device takes about one second as the system computes (from my password)
the key to decrypt the actual device key.
According to "systemctl show", it is "Before" cryptsetup.target, which
is "Before" lvm2-activation.service, which is "Before" local-fs.target.
Thus, opening that cryptdevice delays boot for no good reason.
How can I set up my system such that the rest of boot does not wait for
/dev/mapper/store to be opened?

I looked for some kind of option to add to /etc/crypttab, similar to the
"automount" in /etc/fstab, but found nothing like that.
I also tried to figure out how to manually create an appropriate
"systemd-cryptsetup@" instance so that I wasn't restricted by the
crypttab generator (and could control the dependencies myself), but I
couldn't figure out how to tell such an instance the necessary
parameters (like the keyfile). I couldn't even find the
"systemd-cryptsetup at .service" template file. It seems to me that I
either misunderstood that template stuff, or there's special magic going
on for this template.

I am using systemd 208 on Debian Testing. LVM is used for the main disk,
but is totally unrelated to this second HDD.
Please let me know if you need any further information.

Kind regards

PS: Please keep me in CC, I am not subscribed to the list.

More information about the systemd-devel mailing list