[systemd-devel] systemd blocks update kernel partition table

Mantas Mikulėnas grawity at gmail.com
Thu Nov 22 19:01:26 UTC 2018


On Thu, Nov 22, 2018 at 8:57 PM Eberhard Stoll <e-stl at gmx.de> wrote:

> > It could be that they remain mounted within another mount namespace. You
> > don't have any weird udev rules which call `mount`, do you?
> >
> > If you have a recent util-linux, run `sudo lsns -t mnt` to see live
> > namespaces. For each non-kernel process ID in the list, run something
> > like `findmnt -F /proc/$PID/mountinfo` (or `cat` the file). If you
> > don't, then `grep mmcblk1 /proc/*/mountinfo` should do the job as well.
>
> Yes, i found a udev rule which should mount any usb drive which is
> plugged in. This is also true for my emmc device:
>
>      # Media automounting
>      SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
>      SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
>      SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1"
> RUN+="/etc/udev/scripts/mount.sh"
>
> And systemd-udevd is running in an own namespace:
>      root at t1000-multi:~# lsns -t mnt
>      NS TYPE NPROCS   PID USER             COMMAND
>      4026531840 mnt      88     1 root             /sbin/init
>      4026531861 mnt       1    18 root             kdevtmpfs
>      4026532470 mnt       1   125 root
> /lib/systemd/systemd-udevd
>      4026532483 mnt       1   194 systemd-timesync
> /lib/systemd/systemd-timesyncd
>      4026532484 mnt       1   212 systemd-network
> /lib/systemd/systemd-networkd
>      4026532502 mnt       1   262 systemd-resolve
> /lib/systemd/systemd-resolved
>
> I wonder what is the preferred way to automount removable media
> especially in embedded devices?
>
> Is using 'MountFlags=shared' for systemd-udevd a common solution?
> should i prefer systemd automounting?
> With systemd automount i have to declare all devices statically. This
> could be a disadvantage.
>

You can use the `systemd-mount` tool if your version comes with it. That
will create a transient .mount unit in systemd via IPC, so it will be
unaffected by namespacing.

Otherwise, no need to bother with MountFlags=, just remove the existing
PrivateMounts=yes option which isolates udev to begin with.

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20181122/c9b33317/attachment.html>


More information about the systemd-devel mailing list