How to make usb disks readable by all users on Raspbmc

hacks

In a past article I wrote about a comparison of Openelec, Raspbmc and Xbian. That article hit a record in terms of number of readings and comments on this blog. I spoke about some modification I had to do to Raspbmc to make it usable for my needs but I din’t show them. In this article I’m going to fill this gap.

In order to make the usb drives be mounted with writing permissions to all the user of the system I’ve modified the /etc/udisk-glue.conf as following (in bold are the part that I’ve added:

filter disks {
 optical = false
 partition_table = false
 usage = filesystem
}

match disks {
 automount = true
 automount_options = { sync, noatime, <strong>"dmask=0", "fmask=0"</strong>}
 post_insertion_command = "udisks --set-spindown %device_file --spindown-timeout 1800 --mount %device_file --mount-options sync,noatime,<strong>dmask=0,fmask=0</strong>"
}

And I had to let udisk-glue run as root as following:


# udisks-glue
#

description "udisks-glue for udisks"

start on started dbus
stop on (runlevel [06] or stopped dbus)

expect fork
respawn

#exec su - pi -c "udisks-glue"
exec udisks-glue

(I’ve changed udisk-glue such that It’s run by root)

Since there are a lot of folks out there that are using this distro I think it’s is worth sharing this knowledge. If some dev is reading this, please consider to propagate this changes (or do equivalent ones) to the distro in order to increase flexibility.

Previous
Openelec vs Raspbmc vs Xbian
Next
Javascript/css loader
  • Hi,
    I can’t find the “udisk-glue.conf” -file on the raspbmc.
    Or maybe this file has a different name under raspbmc?

    Cheers

    • I’ve installed raspbian-xbmc-20130212.img and the udisk-glue.conf is neither in /etc nor in /etc.init.

      I’d assumed that they’ve changed the way the drive were automounted?

  • Hi,
    Great article, I was wondering if you cold explain the second part – letting udisks-glue run as root. Specifically how did you do it? Is that a script that needs to be run?

    Thanks,

    Rob

  • Thanks much! – It works, but pretty it ain’t. Now the drives are root/root 0777. I’d rather have them pi/pi 0770 and add users to the pi group. I didn’t find a way, but perhaps you or Sam can help out?

    @PowWowWow the script is in /etc/init/udisks-glue.conf

  • The post_insertion_command doesn’t a loop because of the conjunction of the --set-spindown and --spindown-timeout parameters?

Leave a Reply

%d bloggers like this: