[systemd-devel] udev re-reading partition tables on inotify

Phillip Susi phill at thesusis.net
Wed May 7 13:07:26 UTC 2025


Lennart Poettering <lennart at poettering.net> writes:

> Maybe in your case, in the general case that's not so however. People
> often dd images to disks, and hence it's essential the partitions show
> up once that's complete.

I think you have that backwards.  That is, it is taken care of in the
general case, and only not in the case where someone uses dd to write a
whole disk image ( and honestly, that is a terrible way to image a disk
).  In that case, people can run blockdev or partprobe or partx to
activate the partitions, like they had to before udev started doing it
automatically.

> If you want to do userspace partition scanning, then this would need
> some kernel changes first (because you'd have to turn off the kernel's
> own scanner, so that you don#t race against that), and you'd have to
> call your tool from udev, so that it always is run when a device pops
> up. As long as your do your changes from your own tool, that is called
> independently of that you should really take the lock to indicate
> clearly you want no interference, and we'll accept that and respect
> it. But if you give up all locks then the kernel's and udev's
> management takes control again. I think that's a very reasonable
> approach.

Taking the lock doesn't prevent the interference; it only delays it.


More information about the systemd-devel mailing list