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.

I installed Ubuntu and Windows on my MacBook and Ubuntu is my primary OS; however, all of my media stays on my OSX partition. I want to be able to access it (at least my OSX user's home folder) from Ubuntu without having to launch a media player (or anything else) as root. Also, because I occasionally want to fire up my machine in OSX, I don't want to change anything that I would need to change back frequently (I read a lot about changing UID--I don't exactly understand what this entails, but I wouldn't want to have to change my UID back and forth depending on which OS I'm using. Similarly, I don't want to change file system permissions back and forth).

Also, I saw something about a "noowner" option, but that doesn't seem to do what I want it to.

So I guess I'd like to be able to do something like this:

sudo mount -t hfsplus -o noowner /dev/sda2/ /media/Mac

And then be able to access all of my media (at least everything in my OSX user's Home folder) without dropping in as root. (for clarity: the above command line entry doesn't do what I want it to do, but I want to be able to do something similar).

Or would it be better to change my UID? And if so, how?

share|improve this question
    
Can you take a look at my answer. I believe I've answered your question more correctly than the marked answer. –  Catskul Mar 19 at 21:15
    
@Catskul No I can't. This question is over 2 years old--in that time, I've sold my MacBook and reproducing this issue for the purpose of validating your answer is prohibitively difficult. –  weberc2 Mar 20 at 15:06
add comment

4 Answers 4

up vote 6 down vote accepted

I wasn't able to figure out how to ignore the permissions, but I ended up changing the UID on my Ubuntu account to match my OSX account:

sudo useradd -d /home/tempuser -m -s /bin/bash -G admin tempuser
sudo passwd tempuser

Enter new password. Log out, log in as "other" with username "tempuser" and the password you chose earlier. Open a terminal and type:

sudo usermod --uid 501 yourusername
sudo chown -R 501:yourusername /home/yourusername

*change "yourusername" to your non-temporary user name and 501 to the UID of your Mac account (first Mac account starts at 501, but subsequent users will have different UIDs).

Log out of tempuser and log back into your normal account (this is important; don't just switch users--bad things happen). Open a terminal window and type:

sudo userdel -r tempuser

For more details, visit this page.

share|improve this answer
add comment

bindfs is the answer. It will take an already mounted file system and provide a view of it with whichever uid you'd like:

sudo apt-get install bindfs
mkdir ~/myUIDdiskFoo
sudo bindfs -u $(id -u) -g $(id -g) /media/diskFoo ~/myUIDdiskFoo
share|improve this answer
    
The load on cpu and memory is quite substantial, though. If that's a concern, I would recommend @weberc2's solution. Otherwise great answer. –  archie hicox Jun 24 at 14:43
add comment

The documentation for the linux kernel implementation of the HFS+ filesystem lists a uid mount option that allows you to "own" all files (and maybe some other options that might be useful too).

share|improve this answer
    
I've been trying to do that, but I don't know what UID I should be using. I've read it's something like 501 for OSX, but the account isn't the original OSX user. How can I find out this information? –  weberc2 Feb 22 '12 at 17:14
    
@weberc2: ls -l /media/YourHFSdisk/ will show you the uid and gid of the current files/folders. The HFS+ disks I come across seem to be mostly owned by uid 99 and gid 99. However, I tried various combinations uid/gid/umask settings in the mount command, and it didn't seem to change anything. –  mivk Nov 18 '12 at 22:56
add comment

I know this is old, but there is another way around it that seems to work just fine for me. Since all of the files were owned by a "root" user, all I did was issue su root from the terminal and ls -lah /media/Macintosh HD from there. By using root, I was able to bypass the permission denied error.

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.