Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I am writing a python script that is attempting to use UDisk to mount and unmount devices. I'm using something like this:

disk_dev_func = dbus.Interface(self.device_obj, "org.freedesktop.UDisks.Device")
disk_dev_func.FilesystemUnmount('')
disk_dev_func.FilesystemMount()

So the unmount works just fine, my question, however is how to get the last line (mount) to work. I want to know what arguments I need to mount a device READ ONLY and I cannot for the life of me find any adequate examples of how to do this.

share|improve this question
    
It's not a proper cut and paste answer, but here's a list of dbus parameters cgit.freedesktop.org/udisks/tree/data/… –  hbdgaf Jul 3 '12 at 23:31
    
searched through there and couldnt figure it out either –  Ryan Jul 5 '12 at 17:03
add comment

1 Answer

up vote 1 down vote accepted

Ok, so I found a way to make it work.

Instead of

disk_dev_func.FilesystemMount()

I use

subprocess.call(['udisk', '--mount-options', 'ro', '--mount', '/dev/sdd1'])

It seems to mount correctly as read-only with this command.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.