[parted-devel] some issues with ped_disk_commit_to_os()

Bart Hakvoort bart at hakvoort.be
Tue Sep 12 14:35:44 UTC 2006


> Bart Hakvoort wrote:
>> Hi people,
>>
>> As many of you probably know gparted uses libparted to create partitions
>> and CLI tools to create filesystems on them. While this works quite well
>> there has been a small problem since the beginning.
>> Whenever i call ped_disk_commit_to_os() (which in turn will call
>> ioctl(int
>> fd, BLKRRPART) somewhere in the process) the devicenodes show up after a
>> small delay. This delay causes the CLItools to throw a 'device not
>> found'
>> error every now and then. I've tried working with sync() and fsync(),
>> but
>> without luck so far.
>> Till now i simply 'solved' this by sleeping a bit after the reread, but
>> this is not perfect and every now and then someone encounters this. Also
>> i
>> wonder if there is a better way to solve this?
>
> I've been running into this same thing for over a year in my work with the
> Gentoo Installer. We are blaming udev. It seems like the device nodes are
> created, destroyed, and then created again for some weird reason. I've had
> cases
> where I commit to disk, check to make the /dev node exists, and then it's
> gone
> when I call mkfs.foo or whatever on it.
>
Yep, i have the same issues. You check if it exists, it actually does and
when you try to use it, it's gone again ;)

>
> In the installer, I've resorted to calling mkfs.foo in a loop a maximum of
> 10
> times with a 1s delay after a failure. If the return value is zero, the
> loop
> breaks and moves on. This obviously only works around the problem.
>
> The reason we blame udev is because we never saw this behavior when the
> Gentoo
> CDs used devfs.
>
Ok, if noone on this list has an idea about what's going on, i propose we
take this to some udev related list and see what we learn. It would be
really nice if we were able to finally solve this.

Any idea which list would be appropiate for this issue?

Bart

> --
> Andrew Gaffney                            http://dev.gentoo.org/~agaffney/
> Gentoo Linux Developer                                   Installer Project
>


-- 
--- plors




More information about the parted-devel mailing list