[parted-devel] probing devices.. some questions/comments

Bart Hakvoort bart at hakvoort.be
Sat Sep 9 11:23:09 UTC 2006


hola,

> A patch to skip CD-ROM and floppy drives is currently on the way.
>
Cool, that was my main reason for looking into this :)

>> the reason for parsing the contents of /sys/block/ is: /* /sys/block
>> is more reliable and consistent; fall back to using * /proc/partitions
>> if the former is unavailable, however. */
>>
>> In what aspect is /sys/block more reliable and consistent?
>> /proc/partition seems pretty complete to me :)
> All I know is that /sys/block contains a lot more information.
>   Do you have problems with this two-fold approach?
>
No problems, just curious because for the probing all this info doesn't
seem important. (afaik we just want to find valid blockdevices)

>> one last thingy about 'static int _probe_proc_partitions()'
>> (arch/linux.c around line 1500). it says: /* Heuristic for telling
>> partitions and devices apart * Probably needs to be improved */ Why
>> not simply take the line with the lowest minor number? afaik this will
>> always be the device.
> Since the device doesn't have any number, I suppose you mean "no number"
> by "lowest minor number".  Isn't this what is currently being done?
> The _match_rd_device() check is also necessary for devices like
>
>   /dev/rd/c0d0p1
>
> as outlined in the justification comments before this function.
>
well, the minor number is in /proc/partitions. So if we take for example
the se 2 lines (i've included the header for more clearity):

major minor  #blocks  name

   3     0   39070080 hda
   3     1   11165143 hda1

Then it's easy to see that hda is the device. because the minor is 0. Of
course devices don't have numbers, but apperantly in /proc/partitions they
do, which could make life a bit easier for us.
No more use of _match_rd_device() and isdigit() on the last character.


>> Also i'm happy to provide patches if necessary.
> That's always good, of course.  I'd appreciate it, however, if you'd
> tell us more about the problems you have with the current approaches.
>
My main 'problem' was with the cd/dvd/floppy probing. If these devices are
skipped in the future my life is problem-free again :P
The rest is just curiosity and maybe a small optimalisation.

regards,

bart

>   All the best,
>
>     Leslie
>
> --
> gpg --keyserver pgp.mit.edu --recv-keys DD4EBF83
> http://nic-nac-project.de/~skypher/
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel
>


-- 
--- plors




More information about the parted-devel mailing list