Discussion:
systemd vs udev automount
(too old to reply)
Paul D. DeRocco
2017-10-08 07:16:33 UTC
Permalink
Raw Message
I've got a system (actually two similar systems) built with Yocto that use
systemd, but also have the udev-extraconf package, which includes a udev
rule and associated mount.sh script for automounting. It's doing strange
things, like mounting an additional partition on my main disk (which is
good), and then quietly unmounting it unless it is also listed in
/etc/fstab (which is bad). When it works, I see systemd messages in
journalctl about automounting, in addition to the messages generated by
the udev mount.sh, making me think these two systems are fighting with
each other. Is it possible that after mount.sh mounts it, systemd kicks
in, finds it's not in fstab, and unmounts it without logging anything?

But if I have systemd, should I even be using the udev automount rules in
the first place, or should I just create mount and automount units and
ditch udev-extraconf entirely? (Or are the autonet rules important?) My
ultimate goal is to have this additional partition on my main disk to be
automounted as early in the boot process as possible. I don't need (or
want) removable drives to be automounted anyway.
--
Ciao, Paul D. DeRocco
Paul mailto:***@ix.netcom.com
Zbigniew Jędrzejewski-Szmek
2017-10-08 11:43:38 UTC
Permalink
Raw Message
Post by Paul D. DeRocco
I've got a system (actually two similar systems) built with Yocto that use
systemd, but also have the udev-extraconf package, which includes a udev
rule and associated mount.sh script for automounting. It's doing strange
things, like mounting an additional partition on my main disk (which is
good), and then quietly unmounting it unless it is also listed in
/etc/fstab (which is bad). When it works, I see systemd messages in
journalctl about automounting, in addition to the messages generated by
the udev mount.sh, making me think these two systems are fighting with
each other. Is it possible that after mount.sh mounts it, systemd kicks
in, finds it's not in fstab, and unmounts it without logging anything?
systemd will not umount things mounted externally, in general.
In previous systemd versions there were some bugs in this area, and
things did get unmounted; all those bugs have been fixed a while back.
It's hard to say anything more without even knowing what systemd version
you're using, what downstream patches, etc.
udev-extraconf is not a systemd project, so you're probably better off
asking the maintainers of that package.
Post by Paul D. DeRocco
But if I have systemd, should I even be using the udev automount rules in
the first place, or should I just create mount and automount units and
ditch udev-extraconf entirely? (Or are the autonet rules important?) My
ultimate goal is to have this additional partition on my main disk to be
automounted as early in the boot process as possible. I don't need (or
want) removable drives to be automounted anyway.
I don't see why you'd need to use automounting for a partition on the
main disk. Just put it in /etc/fstab in the usual manner, and it'll
get mounted very early in boot.

Zbyszek
Paul D. DeRocco
2017-10-08 18:43:21 UTC
Permalink
Raw Message
Post by Zbigniew Jędrzejewski-Szmek
I don't see why you'd need to use automounting for a partition on the
main disk. Just put it in /etc/fstab in the usual manner, and it'll
get mounted very early in boot.
As I recall, I added udev-extraconf a couple of years ago when I wanted
one of my systems to be portable to different motherboards or different
mass storage devices. I didn't want the user to have to edit fstab somehow
before putting the system together. If I get rid of udev-extraconf, is
there a way to use a mount unit to specify a partition by some sttributes,
e.g., a FAT file system with a volume name of FOOBAR? Or is there a way to
do this directly with a udev rule?
--
Ciao, Paul D. DeRocco
Paul mailto:***@ix.netcom.com
Mantas Mikulėnas
2017-10-08 18:58:24 UTC
Permalink
Raw Message
Post by Paul D. DeRocco
Post by Zbigniew Jędrzejewski-Szmek
I don't see why you'd need to use automounting for a partition on the
main disk. Just put it in /etc/fstab in the usual manner, and it'll
get mounted very early in boot.
As I recall, I added udev-extraconf a couple of years ago when I wanted
one of my systems to be portable to different motherboards or different
mass storage devices. I didn't want the user to have to edit fstab somehow
before putting the system together. If I get rid of udev-extraconf, is
there a way to use a mount unit to specify a partition by some sttributes,
e.g., a FAT file system with a volume name of FOOBAR? Or is there a way to
do this directly with a udev rule?
Just configure "/dev/disk/by-label/FOOBAR" (or possibly "LABEL=FOOBAR") as
the mount source.
--
Mantas Mikulėnas <***@gmail.com>
Paul D. DeRocco
2017-10-09 18:00:28 UTC
Permalink
Raw Message
Post by Mantas Mikulėnas
Just configure "/dev/disk/by-label/FOOBAR" (or possibly
"LABEL=FOOBAR") as the mount source.
Duh. I never noticed LABEL in the fstab man page. Pretty simple. Thanks.
--
Ciao, Paul D. DeRocco
Paul mailto:***@ix.netcom.com
Reindl Harald
2017-10-09 18:13:29 UTC
Permalink
Raw Message
Post by Paul D. DeRocco
Post by Mantas Mikulėnas
Just configure "/dev/disk/by-label/FOOBAR" (or possibly
"LABEL=FOOBAR") as the mount source.
Duh. I never noticed LABEL in the fstab man page. Pretty simple. Thanks
LABEL was used for many years before UUID became common
hence commands like e2label

Loading...