eSATA auto mounting

David Zeuthen zeuthen at gmail.com
Mon Jun 13 07:45:48 PDT 2011


Hi,

I've been on vacation last week and away from mail so apologies for
the late reply.

On Fri, Jun 3, 2011 at 4:00 PM, Phillip Susi <psusi at cfl.rr.com> wrote:
> Towards the end of last year, I tried to tackle the problem of udisks not
> automounting eSATA drives because it does not know they are external ( and
> it doesn't auto mount internal drives ).  I ended up generating a patch for
> the kernel to read and report the ahci attribute bit flagging the port as
> external.  This patch ended up being ignored after several attempts to
> submit it upstream.

Just for the record, in general, when it comes to udisks, any serious
udisks development discussions should happen in udisks Bugzilla, not
on the mailing list. And if you feel that you are being ignored in
Bugzilla the way to resolve that is to poke people on IRC. Myself and
Martin Pitt and others usually hang out in #udev on Freenode. Find us
there.

To get to the issue at hand, I have two comments.

First is that there is no reliable way you can determine whether a
SATA drive is connected via an eSATA connector or not. So we shouldn't
even be trying. Even laptops for which the AHCI data will give you
some hints (cf. bit 21 in 3.3.7 of the AHCI 1.3 spec, "External SATA
Port (ESP)") seem to lie about it. Presumably because laptop vendors
don't fill in the right data which is probably because Windows don't
use it. I don't know.

This is why the DeviceIsSystemInternal property, this one

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

talks about "heuristics". Note that this property will be removed in
udisks in the next ABI break (2.0). So we shouldn't be assuming that
we know such things (e.g. whether it is connected via eSATA) about a
disk drive, so we shouldn't be basing policy (e.g. whether to
automount or not) on it since we cannot know.

Second, until the next udisks release happens and everyone has been
ported to not use this property, I propose that you just configure
polkit so your user has the

 org.freedesktop.udisks.filesystem-mount-system-internal

authorization. On Fedora we give this authorization to any user in the
'wheel' group.

> Now that I'm looking at it again, it occurs to me that this information
> should be reported in a more generic form rather than an ahci specific
> attribute.

Disagree because the kernel shouldn't be reporting its guesses to the user.

>  What sysfs attribute does UDisks currently use for this?

None, it uses heuristics based on the bus type.

>  I
> noticed that there is /sys/block/sda/removable, but this does not appear to
> be documented anywhere.

The 'removable' sysfs block attribute tells you whether the drive the
block device is for, uses removable media. It is tempting to think
that "removable media" is the same as "drive is using a
hotplug-friendly physical connector such as eSATA" but it is not the
same.

    David


More information about the devkit-devel mailing list