Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have an external disk which (for other reasons) is formatted using FAT32. On that disk I have created a sparse bundle image formatted using HFS extended (journaled). This image is then mounted on /Volumes/TestDisk.

$ sudo hdiutil attach -mountpoint /Volumes/TestDisk /Volumes/FAT32DSK/TestDisk.sparsebundle/
$ ls -l /Volumes
total 72
drwxr-xr-x  9 mgd   staff    374  7 Jun 22:48 TestDisk
lrwxr-xr-x  1 root  admin      1  4 Jun 17:02 Macintosh HD -> /
drwxrwxrwx  1 mgd   staff  32768  7 Jun 22:21 FAT32DSK
$ 

Whenever a file is created on the mounted disk, it gets me as owner – also if I create the file as root:

$ touch myfile
$ sudo touch rootfile
$ ls -l
total 0
-rw-r--r--  1 mgd  staff  0  7 Jun 23:00 myfile
-rw-r--r--  1 mgd  staff  0  7 Jun 23:00 rootfile
$ 

If I try to change the file owner afterwards, nothing happens:

$ sudo chown root:admin rootfile 
$ ls -l
total 0
-rw-r--r--  1 mgd  staff  0  7 Jun 23:00 myfile
-rw-r--r--  1 mgd  staff  0  7 Jun 23:00 rootfile
$ 

Changing permissions apparently works fine but the owner/group cannot be changed.

I am running Mac OS X Lion 10.7.3.

What did I do wrong?

share|improve this question
    
Changed title as it turns out (from the answer) that this is not an issue specifically related to the use of sparse bundle images. –  mgd Jun 8 '12 at 13:44

1 Answer 1

up vote 5 down vote accepted

If the disk is mounted to ignore file ownership, the owner is always reported as the current user, and cannot be changed. Attempting to change the owner will not produce an error message, but simply fail silently.

In the Finder, select the mounted disk corresponding to the sparse image in question and Get Info (I). At the bottom of the pane that opens, see if it looks like this: (i.e. the Ignore ownership on this volume box is checked)

enter image description here

If you uncheck that box, you should get the behavior you seek.

share|improve this answer
    
Spot on! Thank you. Also found out that adding option -owners on to hdiutil attach does the trick. However, that does not survive unmounting and remounting the volume. Any idea how to “uncheck” that checkbox from the command line? –  mgd Jun 8 '12 at 5:57
    
That's a great question, and probably deserves to be asked as its own question on the site. Feel free to link to this one in doing so. –  Daniel Lawson Jun 8 '12 at 11:45
    
I have created a new question addressing this issue: apple.stackexchange.com/questions/53215 –  mgd Jun 8 '12 at 14:25

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.