On Do, 31.10.24 12:08, Dan Nicholson (dbn@xxxxxxxxxxxxx) wrote: > On Thu, Oct 31, 2024 at 10:23 AM Lennart Poettering > <lennart@xxxxxxxxxxxxxx> wrote: > > > > On Do, 31.10.24 09:03, Phillip Susi (phill@xxxxxxxxxxxx) wrote: > > > > > Lennart Poettering <lennart@xxxxxxxxxxxxxx> 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. That sounds like a bug though. They should open the device for write only when they need to make changes. > 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. Yeah, what you are proposing sounds like it is the way to go indeed, if parted really is not doing this already right now. Lennart -- Lennart Poettering, Berlin