[systemd-devel] Masking mount units
Phillip Susi
phill at thesusis.net
Wed Oct 23 18:32:38 UTC 2024
A few years ago you mentioned that gparted should not be masking mount
units and should instead take a bsd lock:
https://lists.freedesktop.org/archives/systemd-devel/2020-January/043924.html
I brought this issue back up recently. It seems like taking a bsd lock
would allow gparted to make sure that partition probing and auto
mounting does not happen say, between the time the partition is created,
and the time mkfs is run on it, but apparently that is not the real
issue why gparted masks all mount units.
Simply having libparted *read* the partition table from the disk
triggers change events on all of the partitions, causing them to be auto
mounted. This is because libparted issues a BLKFLUSH ioctl to all of
the partition devices, I believe, as a workaround for the fact that
Linux does not unify the block cache for the partition and the whole
disk, so the partition is flushed to make sure that any recent mkfs is
visible when libparted tries to probe the filesystem type by reading the
raw disk block device.
Can you think of any other way to prevent this unwanted auto mounting
besides masking the mount units?
More information about the systemd-devel
mailing list