Re: Enumerating hard drive volumes using GVolumeMonitor



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.)

> 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).

> 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.

 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?

> 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




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