Automount HFS+ with R+W

Asked by shandar

Hi,

I am trying to get Ubuntu 11.04 to automount my external HFS+ usb-drive with write access. I can do it via the terminal using

   sudo mount -t hfsplus /dev/sdc2 /media/usb

the problem is: mount only gives write permissions to the root user, meaning I have to do all file access through the terminal using sudo cp, mv etc. Aside from the headache this brings it also means that all files are owned by root and end up being locked when I copy them over to my Mac later. So... How do you get Ubuntu to automount HFS+ with write permissions when you plug in an external drive?

Secondly: This is one of those little things that is extremely annoying... Why doesn't this happen automatically already? What possible reason could there be aside from deliberately annoying the crap out of users? :)

-Mikael

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu util-linux Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
enubuntu (mr.tennents) said :
#1

Hi, you can follow this guide:
http://embraceubuntu.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/

the script file will have the code that you have paste:
sudo mount -t hfsplus /dev/sdc2 /media/usb

Revision history for this message
enubuntu (mr.tennents) said :
#2
Revision history for this message
shandar (mikael-mannberg) said :
#3

Thank you for trying to answer my question but I realise I might not have been completely clear on what my problem is. I don't want to automount the drive on boot, what I am looking for is the ability to just plug in an external usb drive and have it automatically appear on the desktop with write permissions, given that the filesystem is HFS+. Much like you can with a regular thumb-drive.

As it is right now all I get is read permissions and no matter what I do to change the permissions any attempts to modify files on the drive fails with a Permission Denied error. The only way I can get around this is by manually unmounting the drive, then mounting it again from the terminal using 'sudo mount ...'. This lets root modify files, but it is a pain since all file actions have to happen in the terminal.

So, how do you set the permissions for the automounter? How do you set it to default to read/write for everyone?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

on the end of the mount command you can add:

-o rw

or similar. The -o bit means you want to add (o)ptions. You can use these to make file systems mount differently. Have a look on the web for these options and it may help.

Revision history for this message
gazhay (gazhay) said :
#5

There seems to be a major problem with mounting hfsplus drives.
I don't think there is full support

I am trying with

sudo mount -t hfsplus -o rw,nosuid,nodev,uid=1000,gid=1000,uhelper=udisks,force /dev/sdd2 /media/BackupOne

most options are ignored.
I can get rw access, but only as root, I cannot make the drive take my user/group as specified.

That is the issue the OP has.

Revision history for this message
Steven Roose (stevenroose) said :
#6

To give your user access to the device you need to do a
sudo chown [username]:[username] /mount/point -R
To give the ownership to [username]

Revision history for this message
gazhay (gazhay) said :
#7

Of course you can overwrite the permissions of all files recursively, however, it is inefficient, impossible even, to have to do this with every mount, or every different user.

The mount options allow you to *fake* this, and it works with drives of other types, however, the state of hfs+ drive support is such that you have to resort to workarounds.

If you have files on the disk that require specific permissions/users/groups, your method will also clobber that, making this technique useless for backups.

Can you help with this problem?

Provide an answer of your own, or ask shandar for more information if necessary.

To post a message you must log in.