1

Topic: device detection...

in the current releases of gparted i ask libparted for a list of available devices. This probing parses the content of /proc/partitions + tries some default paths (e.g. /dev/sd* /dev/hd*, etc). The latter gives sometimes problems in cases of broken cd/dvd drives. We then experience timeouts and/or hanging of the application. Also since parted-1.7.1, a ghost raiddevice is listed on some systems (/dev/md0).

All in all this caused me to think about dropping this probefunction and parse /proc/partitions ourselves. If we grep all lines with minor == 0, then we should have all available devices in the system. It's lightning fast and errorproof afaics.

Does any of you know of any reason why this could fail?

thanks!

2

Re: device detection...

Dont you think you could question parted about that, on irc ?

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

3

Re: device detection...

ok, i've added this in CVS and it will be in 0.3.1. Let's see how the users will react smile

4

Re: device detection...

cool : no more /dev/md0 smile

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

5

Re: device detection...

I found some time to do some testing and found a very minor wierdness on the livecd. It seems gparted is now scanning the loop device the squashfs is mounted on. So if you run gparted from the term it runs correctly but it says:

root@gparted:~# gparted
======================
libparted : 1.7.1
======================

Unable to open /dev/loop0 - unrecognised disk label.

Athough it does nothing you know somebody will report it as a bug. smile

This is the entry in /proc/partitions:

   7     0      22712 loop0

Maybe you could "ban" loop devices? I don't think they would be needed.

On the plus side the "unrecognised disk label" for the cdroms is gone.
On the minus side it's no faster now on the livecd as it used to be. (loop dev maybe?)

6

Re: device detection...

the speedgain is only marginal, because 98% of the time during scanning is spent on filesystemlevel (finding used/unused space). Only when someone has a broken cd(drive) this is much faster, because we no longer try to access it.

About the loopdevice, maybe i should only take devices of which the last character is not numeric smile That's even safer than scanning for minors with value 0.

thnx!