[systemd-devel] What's the correct way to configure encrypted volume and mount point?

Jan Janssen medhefgo at web.de
Fri Jan 30 01:49:20 PST 2015


John Lane <systemd <at> jelmail.com> writes:
> $ mount /home/myuser/data
> mount: special device /dev/mapper/keyring does not exist
Your crypttab entry uses "noauto" as an option. This means that it won't get
activated and no plain text device is created. Hence your manual mount can
only fail.

>     I'm guessing that "mount" doesn't effect systemd and, therefore, the
>     dependency isn't actioned. But the docs for systemd.mount state that
>     "configuring mount points through /etc/fstab
>     is the preferred approach" so I'm wondering if there's something I
>     missed from my crypttab or fstab entries?
>     Thanks.

But really: why not use automounting logic in fstab?:
    /dev/mapper/data /home/myuser/data ext4 noauto,x-systemd.automount 0 0

No need to manually trigger a mount. And you can even use "noauto" in
crypttab so that the encrypted device is only opened once the mount point is
accessed the first time.

Jan



More information about the systemd-devel mailing list