[systemd-devel] Can udev assist?

Aaron_Wright at selinc.com Aaron_Wright at selinc.com
Fri Nov 20 09:44:20 PST 2015

> From: Reindl Harald <h.reindl at thelounge.net>
> Am 20.11.2015 um 18:08 schrieb Aaron_Wright at selinc.com:
> > I have a script that creates a partition (using pyparted) and then 
> > to format it (using mkfs.ext4). Most of the time this works OK. 
> > sometimes the format fails because it can't find the device. There 
> > to be a race condition due to a delay between creating a partition and
> > the device node in /dev being created.
> >
> > Is there a tool in udev or udevadm that can help my script know when 
> > safe to proceed?
> just call "partprobe" for that device, that works even when you clone 
> MBR including partition table with dd

I've been over the code for partprobe and pyparted and they both do the 
same thing (they use the same code). They tell the kernel about the 
partition, but it seems to be asynchronous as to when the kernel gets 
around to making the device node. I thought maybe udev could help me out 
because it may be listening to the same "events" or whatnot that would 
cause the device node to get created.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151120/093aa002/attachment.html>

More information about the systemd-devel mailing list