[systemd-devel] Mount files in systemd

g4hx g4hx at gmx.de
Thu May 17 10:54:21 PDT 2012


Hello all,

I have been using systemd for a while now, and I have to say that I am
quite impressed by the noticeable speed up during boot. However, I have
some question about systemd that are yet unanswered. I did not find the
reuqired information elsewhere, so now I am asking directly:

How do I include lvm2 based partitions in a technically clean and
correct way? Up to now I used the lvm.service file to call lvm2 and a
.mount file for each mount:

[Unit]
Requires=dev-storage-backup.device
After=dev-storage-backup.device

[Install]
WantedBy=sysinit.target

[Mount]
What=/dev/storage/backup
Where=/media/storage/backup

I noticed that the service files are automatically created, so I put
those in the unit description, although I suppose it would also be
possible to use the lvm.service, which one is correct? Is it even
necessary to include the lvm.service file, or does systemd somehow
recognize lvm partitions automatically?

Another thing I noticed is that systemd parses "/etc/crypttab", but the
expected syntax does not follow the syntax expected by my distribution:

https://wiki.archlinux.org/index.php/System_Encryption_with_LUKS#.2Fetc.2Fcrypttab

I looked over the source code of systemd-cryptsetup-generator to gain
some idea about how the parsing is done and managed to adjust my
"/etc/cryptsetup", but I would appreciate it if you could send me a link
to the file type documentation.

In general, if I have units depending on device files, should I include
the dependency as one to a device file or to the service that creates
it? Also, should I still use "/etc/fstab" or should I abandon it
entirely in favor of .mount files?

g4hx


More information about the systemd-devel mailing list