[How-To] Enable Auto-Mounting of External Drives In openSUSE 11

Sathya | August 20th, 2008 - 2:59 pm


Due to weird-ass PolicyKit rules, you may not be able to mount external drives – such as USB Hard drives, Pen drives, or other mass storage drives. while the drive gets recognised, on trying to mount you’ll end up with this error:

org.freedesktop.hal.storage.mount-removable no <– (action, result)

This is because of a PolicyKit rule, which prevents external media from being mounted. To get around this, you’ll have to edit the policy. So first open the terminal. Switch to root by typing

su root

Next, open the PolicyKit config file corresponding to Storage. This file is located at

/usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy

Open this file for editing, by typing
kate /usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy
Next, search for this section

<action id="org.freedesktop.hal.storage.mount-removable">
<description>Mount file systems from external drives.</description>
<message>System policy prevents mounting external media</message>
<defaults>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

And replace it with

<action id="org.freedesktop.hal.storage.mount-removable">
<description>Mount file systems from external drives.</description>
<message>System policy prevents mounting external media</message>
<defaults>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>

Save the file, and then restart the HAL subsystem by typing

rchal restart

From now on, your external drives should be mounted with full access.

If you enjoyed this post, make sure you subscribe to my RSS feed!

13 Responses to “[How-To] Enable Auto-Mounting of External Drives In openSUSE 11”

  1. Marco says:

    Thx. This solution works fine for me!

  2. Sathya says:

    @Marco Glad this post was useful to you :)

  3. RD says:

    Does it work for RHEL?
    As there is no file as /usr/share/PolicyKit/policy/org.freedesktop.hal.storage.policy in RHEL, there should be some other file. There is an XML file simillar to one in SUSE at ./usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi could be.

    Also does it have any security threat involved?

  4. Sathya says:

    @RD I don’t think this is needed for RHEL. The XML file you’ve mentioned is for the way the external/removable drives behave(ie, Sync transfer on/off etc).

    Given that a user needs to be logged on for a removable device to be mounted, there isn’t any security threat per-se

  5. Frank says:

    Hi Sathya,
    Your fix is the only one that has worked for me amongst many I have tried. I am using OpenSuse 11 KDE 3.5.9 release 49.1. I still find that it seems a hit & miss situation so that the USB sticks sometimes seem to time out rather than mount. Still it is better than previously when I could only mount them using console as root.
    I also have PCLinux on the same computer as it is multiple boot, and using it the USB sticks mount without fail so it does not seem to be a hardware problem. Thanks for your advice. Frank

  6. RD says:

    Thanks Sathya.

  7. Sathya says:

    Hi Frank,
    I’m happy that the above post could help you somehow. I don’t quite know why you’re getting the timeout, as on my system the USB drive has been connected for like > 6hours and still had no time outs. And as you mention, PCLinux works fine, so hardware problem is ruled out. I guess its some problem with openSUSE itself. If oyu do manage to find a fix, please do comment back here, it might be helpful for others.
    Thanks!

  8. RonB says:

    I just moved from openSUSE 10.3 to 11.0 and was surprised to see that the automount feature didn’t work out “of the box.” Your fix worked great.

    Thanks.

  9. tom says:

    You’re a godsend!
    Thanks!

  10. Hedge says:

    To avoid editing files, I think this can be done in two lines.
    Some openSUSE forum posts suggested:

    # sudo polkit-auth --grant org.freedesktop.hal.storage.mount-removable --user your_user_name

    # sudo polkit-auth --grant org.freedesktop.hal.storage.eject --user your_user_name

  11. YAOMTC says:

    I’ve been looking all over for this! Thanks a lot!

You can leave a response, or trackback from your own site.

Leave a Reply