Re: Enumerating hard drive volumes using GVolumeMonitor



On Tue, Dec 8, 2009 at 12:38 AM, David Zeuthen <david fubar dk> wrote:
> On Mon, 2009-12-07 at 21:05 +0530, aniket ray wrote:
>> Hi,
>>
>> I was trying to use GVolumeMonitor's g_volume_monitor_get... set of
>> apis to enumerate all volumes/mounts available but it only seems to
>> display volumes on external devices.
>> It seems that GVolumeMonitor only enumerates "user interesting
>> devices" now.
>> Is there a way I could monitor mount-added/removed events for mount
>> changes with internal hard drive mounts (along with the external
>> devices that is happening now) using GVolumeMonitor.
>
> We only show stuff that is potentially interesting for users. This
> _does_ include internal hard disk partitions [1]. It has nothing to do
> whether the disk is internal or not - only if it is "potentially
> interesting". The volume monitor will also list stuff that isn't really
> on a hard disk - e.g. RAID arrays, network shares and so on.
>
> (See the sources for the definition of what "potentially interesting"
> means - for hard disks, it currently means only user mountable
> filesystems that are not already mounted outside /media or $HOME.)
>
Thanks for the pointer, David. I'll have a look at the sources for
more information.

>> Archived mailing lists seem to suggest that GVolumeMonitor uses
>> devicekit-disks now. Am I correct in assuming this (or have I
>> misunderstood) ?
>
> Yes, on recent Linux distributions GVfs use the libgdu.so library from
> the gnome-disk-utility package. This library uses DeviceKit-disks /
> udisks (DKD was recently renamed to udisks).
>

Yes, I have been following the dkd list about this change (frankly
with minor amusement at all the replies) for now.

>> I am not particularly keen on using GUnixMounts because of the extra
>> polling it does on mtab to generate mount/unmount events.
>
> The UNIX volume monitor will also hide stuff that isn't "potentially
> interesting" too so that won't help you.
>


> If you want to see all the drives and volumes that is connected to the
> system, the Palimpsest Disk Utility will do this - for the normal
> desktop shell user, it will list a lot of really uninteresting and
> complicated stuff (OTOH, this stuff is very interesting for the
> administrator) though - see e.g.
>

Palimpsest looks really interesting. I'll have a look at it for more.
Thanks a lot for the screenshot. Really appreciate the quick link.


>  http://people.freedesktop.org/~david/gdu-sas-expanders.png
>
> including RAID components, swap space and so on.
>
> Btw, I'm curious why you think your app needs to show stuff that we've
> already deemed isn't "potentially interesting" though. Care to share any
> details of what your app is supposed to do?
>

I work on the Adobe AIR team. In our 2.0 runtime release, we have
introduced a set of actionscript APIs that lets a user enumerate all
user accessible mounts.
Like the gio/gvfs stack, I too don't consider RAID components and swap
potentially interesting. Normal users won't want to interact with it
directly.

On the other hand, I do believe that volumes (like premounted)
harddrives and volumes that an administrator has mounted at non
standard locations are interesting.
End users would be interesting in knowing about that. (I still haven't
looked at the sources for fully understanding "potentially
interesting" on gvfs/gio.).

In short,  Applications might want to enumerate and have mount/unmount
events on volumes that they could write on/read from.

Hal directly provided this functionality and in our 2.0beta linux
release, this functionality was implemented using hal.
Hal of course, was an overly redundant behemoth and had to go. We
would like to move to the dkd/udisks story too (maybe keeping hal as a
backup).

Does any API / method exist off the top of your head using which I
could enumerate the volumes ?


>> Thanks in advance,
>> Aniket Ray
>>
>> PS: I could not find any gio-app-devel type list. If this is not the
>> right list for such queries, could someone point me to the right one.
>> Thanks.
>
> For the time being this is on-topic for this list.
>
>     David
>
> [1] : /dev/sda2 is a FAT partition on my internal disk
>
> Volume(0): Shared
>  Type: GProxyVolume (GProxyVolumeMonitorGdu)
>  ids:
>   uuid: '0A46-1DB0'
>   unix-device: '/dev/sda2'
>   label: 'Shared'
>  themed icons:  [drive-harddisk]  [drive]
>  can_mount=1
>  can_eject=0
>  should_automount=1
>
>
>

Thanks for the help,
Aniket Ray


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]