automount of internal sata drives with udisks

David Zeuthen david at fubar.dk
Fri Apr 9 08:04:04 PDT 2010


Hi,

On Thu, 2010-04-08 at 13:49 +0200, Stephan Raue wrote:
> Hi all,
> 
> how is it possible to mount internal (SATA) Harddisk drives 
> automatically with udisks?
> 
> I am using an embedded Linux system with udisk-1.0.0 and without using 
> an /etc/fstab. I can boot my system from an USB stick. Other USB drives 
> will be mounted by udisks automatically, but not the internal drives. 
> what must i change or do?

Actually udisks doesn't automatically mount anything - the way it works
is that the desktop session is responsible for deciding if a mountable
filesystem is to be automatically mounted. It sounds really easy to do
this but experience has shown that you need to be very careful.

Anyway, for GNOME, Nautilus is in charge of that. Nautilus basically, on
startup and when a new GVolume is announced, just checks the result of
g_volume_should_automount(),

http://library.gnome.org/devel/gio/unstable/GVolume.html#g-volume-should-automount

which is set by the GVolumeMonitor in charge (which in this case is the
gnome-disk-utility volume monitor) and, if TRUE, calls g_volume_mount().

So we need to look at the volume monitor to find the answer. It's here:

http://git.gnome.org/browse/gvfs/tree/monitor/gdu/ggduvolume.c?id=1.5.5#n356

As you can see this involves looking at the udisks properties
DevicePresentationNopolicy and DriveConnectionInterface. See

 http://hal.freedesktop.org/docs/udisks/Device.html

for more details.

It also involves setting should_automount to FALSE for GVolume objects
for mountable filesystem that appear much later than the GDrive that
contains them - this is to void automounting a filesystem just created
via fdisk(1) or parted(1) from the command line.

Of course for a fixed function device, rather than a generic OS, you
don't have to be that careful because you know e.g. that there is never
going to be a multi-initiator SAN with 1000 disks connected to it.

     David




More information about the devkit-devel mailing list