[systemd-devel] Masking mount units
Dan Nicholson
dbn at endlessos.org
Thu Oct 31 18:08:47 UTC 2024
On Thu, Oct 31, 2024 at 10:23 AM Lennart Poettering
<lennart at poettering.net> wrote:
>
> On Do, 31.10.24 09:03, Phillip Susi (phill at thesusis.net) wrote:
>
> > Lennart Poettering <lennart at poettering.net> writes:
> >
> > Yes, but then it reads the disk and auto mounts a partition just because
> > someone ran parted print. Printing the partition table should not
> > trigger auto mount.
>
> NO!
>
> I don't know parted, but why would it open device for *WRITE* if it
> only wants to show contents of it? It should open it for *READ* then,
> and thus not trigger any events.
I'm reading between the lines a bit, but my guess is that libparted
always opens the device writable in case you start issuing actual
partitioning commands. To support "parted print doesn't trigger udev
events", I think you'd have to change libparted so that it opens the
device for read first (potentially with a shared lock) and then
reopens it for write (with an exclusive lock) when needed (e.g. when
using the mkpart command in the interactive session). Without that, I
think you're always going to need workarounds such as masking mount
units.
---
Dan
More information about the systemd-devel
mailing list