flowmac

Q: Problem with OS X file permissions on devices running other file system than "hfs"

Hi folks,

 

sorry for this detailed thread, but i tryed to gather all required information.

 

I am experiencing a total file / folder permission mess when i am using "rsync" to mirror folders from OS X to a NAS.

 

When i create a file test.rtf in OS X, the file premission looks like this:

8 -rw-r--r--    1 flo  staff   331  7 Mär 19:16 test.rtf

 

When i copy this file via finder to a OS X Extended (Journaled) formated firewire harddisc (hfs), the permission looks like:

8 -rw-r--r--   1 flo  staff   331  7 Mär 19:16 test.rtf

 

all cool.

 

When i copy this file via finder to a XFS formatted NAS (OS X interprets NAS's file system as a "smbfs"), the permission looks like:

2 -rwxrwxrwx  1 flo  staff    331  7 Mär 19:16 test.rtf*

 

super uncool.

 

Now using rsync:

rsync'ing the initial file test.rtf from OS X to OS X Extended (Journaled) formated firewire harddisc, the permission looks like:

 

...flo$ rsync -av file-permissions-test/ /Volumes/officeWD/file-permissions-test/

building file list ... done

./

test.rtf

 

sent 471 bytes  received 48 bytes  1038.00 bytes/sec

total size is 331  speedup is 0.64

 

8 -rw-r--r--   1 flo  staff   331  7 Mär 19:16 test.rtf

 

all cool.

 

rsyncing the initial file from OS X to to a XFS formatted NAS, the permission looks like:

 

2 -rwxrwxrwx  1 flo  staff    331  7 Mär 19:16 test.rtf*

 

super uncool. (at least rsync and the finder copy operation does the same)

 

I assume the changed rights / permissions has to do with how a drive is formatted (hfs, ntfs, ext3) etc.?

When i sync to a linux on ext3 it the same problem.

 

So, is this all about file system, and will this problem be solved using a Time Capsule (is this thing running hfs and can i access it via network?)?

thank you!

Posted on Mar 7, 2015 11:26 AM

Close

Q: Problem with OS X file permissions on devices running other file system than "hfs"

  • All replies
  • Helpful answers

Page 1 Next
  • by Niel,

    Niel Niel Mar 7, 2015 11:29 AM in response to flowmac
    Level 10 (313,375 points)
    Mac OS X
    Mar 7, 2015 11:29 AM in response to flowmac

    1. Different filesystems have different permission models; the simpler ones, such as FAT32, don't support permissions at all.

    2. A Time Capsule's internal drive is formatted as Mac OS Extended (Journaled) and can be made available as network storage.

     

    (123619)

  • by VikingOSX,

    VikingOSX VikingOSX Mar 7, 2015 12:30 PM in response to flowmac
    Level 7 (21,061 points)
    Mac OS X
    Mar 7, 2015 12:30 PM in response to flowmac

    Read very carefully the -p, --perms discussion in the OS X rsync(1) man page. Useful information on what happens to files sent without the -p flag set, and target system's umask effect on file permissions.

  • by etresoft,

    etresoft etresoft Mar 7, 2015 5:21 PM in response to flowmac
    Level 7 (29,298 points)
    Mac OS X
    Mar 7, 2015 5:21 PM in response to flowmac

    You are talking about local, directly connected filesystems. When connecting to a networked system, everything is going to be a networked file system. Try the smbutil command line tool to see what version of SMB you are mounting. You are unlikely to see full functionality on anything other than an SMB2 volume and even then, all bets are off if you are mounting a NAS. It will be running some unknown version of the open source Samba. Apple is only going to support a Mac bound to a genuine Active Directory domain with Microsoft servers. For anything else, if you can read and write files, you are good to go.

     

    You mentioned Time Capsule. You aren't trying to backup to this drive are you? Time Machine is black magic. Time Machine with a Time Capsule is serious voodoo. I would not trust my files to serious voodoo with an unsupported, open-source, reverse-engineered version of a file system on top of a completely foreign filesystem written by people who have sworn the death of the system you are using.

  • by rccharles,

    rccharles rccharles Mar 8, 2015 1:24 PM in response to flowmac
    Level 6 (8,496 points)
    Classic Mac OS
    Mar 8, 2015 1:24 PM in response to flowmac

    I'd look at running NFS as it is the native Unix file sharing protocol.  It will be best if you make the shared users have the same numeric values for userid and groupid.  Using smb your permissions are being translated to windows terms.  Don't know the effects on ACLs.

     

    Robert

  • by Camelot,

    Camelot Camelot Mar 8, 2015 9:33 PM in response to flowmac
    Level 8 (47,290 points)
    Mac OS X
    Mar 8, 2015 9:33 PM in response to flowmac

    In addition to the above, at the very least you need to add the -E switch to your rsync:

     

           -E, --extended-attributes

                  Apple specific option to copy extended attributes, resource forks, and ACLs.  Requires at least Mac OS X 10.4 or suitably patched rsync.

  • by flowmac,

    flowmac flowmac Mar 9, 2015 1:59 PM in response to flowmac
    Level 1 (0 points)
    Mar 9, 2015 1:59 PM in response to flowmac

    Thanks guys.

    the switch -p does not change anything on the destination files in my test unfortunately, while -E makes the rsync command stop:

    sync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at /SourceCache/rsync/rsync-42/rsync/rsync.c(244) [sender=2.6.9]

    most likely, since the filesystem on NAS does not know how to handle this "Apple specific option"?

    (my rsync version is rsync 2.6.9  protocol version 29)

     

    @etresoft: Agreed, i do not trust TM at all. But you're saying that the apple #1 backup solution, TM in addition to TC, does not work properly? Is this based on experience or gut?

    I'm thinking to use TC, which is running native OS X Journaled file system, to then rsync my files and folders to the TC - and i am expecting the exact and correrct attributes on the destination network share provided by the TC. Isn't this all right?

  • by etresoft,

    etresoft etresoft Mar 9, 2015 6:18 PM in response to flowmac
    Level 7 (29,298 points)
    Mac OS X
    Mar 9, 2015 6:18 PM in response to flowmac

    flowmac wrote:

     

    Agreed, i do not trust TM at all. But you're saying that the apple #1 backup solution, TM in addition to TC, does not work properly? Is this based on experience or gut?

    I'm thinking to use TC, which is running native OS X Journaled file system, to then rsync my files and folders to the TC - and i am expecting the exact and correrct attributes on the destination network share provided by the TC. Isn't this all right?

    No. I think you've misunderstood. I am a big fan of Time Machine. It is black magic, but that's not bad thing. If you want to have trouble with Time Machine, connect it to a 3rd party NAS device or start making changes to it. Time Machine works best when you plug it in and let it go. I ran Time Machine with a 1st generation Time Capsule for a long time. The Time Capsule died eventually, but Time Machine never flaked out. People tell me that modern Time Capsules run even better. But the important takeaway is to flip the switch on Time Machine (however you connect it) and it it do its thing. Don't interfere. Don't try to do something with rsync. Just let it go.

  • by flowmac,

    flowmac flowmac Mar 12, 2015 2:50 PM in response to etresoft
    Level 1 (0 points)
    Mar 12, 2015 2:50 PM in response to etresoft

    ah, check, got it.

    so i need one TC and aim TM to it, and another TC, running as a fileserver in LAN, right? --> i assume TM will use all the space on a TC for TM backups. Or is it possible to use two partitions on TC, one for TM, one for file services. (This is what i'd expect from a NAS, is this all right with TC, too?) thx

  • by Niel,

    Niel Niel Mar 12, 2015 2:52 PM in response to flowmac
    Level 10 (313,375 points)
    Mac OS X
    Mar 12, 2015 2:52 PM in response to flowmac

    It isn’t possible to partition the Time Capsule in the normal way; use the Disk Utility to create a disk image of the desired size on it. Time Machine will eventually use up all the free space on the volume it’s backing up to, but won’t do so straight away.

     

    (124039)

  • by etresoft,Helpful

    etresoft etresoft Mar 12, 2015 5:50 PM in response to flowmac
    Level 7 (29,298 points)
    Mac OS X
    Mar 12, 2015 5:50 PM in response to flowmac

    flowmac wrote:

     

    ah, check, got it.

    so i need one TC and aim TM to it, and another TC, running as a fileserver in LAN, right? --> i assume TM will use all the space on a TC for TM backups. Or is it possible to use two partitions on TC, one for TM, one for file services. (This is what i'd expect from a NAS, is this all right with TC, too?) thx

    A Time Capsule has a USB port that you can use to plug in an external drive and share that. One volume would be for Time Machine and the other for whatever. It is only Time Machine that really needs a genuine Apple file server though. If you just want a fileserver, you don't have to use a Time Capsule. But the port is there if you want it.

  • by flowmac,

    flowmac flowmac Mar 13, 2015 3:24 PM in response to etresoft
    Level 1 (0 points)
    Mar 13, 2015 3:24 PM in response to etresoft

    all righty. thanks

  • by flowmac,

    flowmac flowmac Jul 28, 2015 1:53 AM in response to flowmac
    Level 1 (0 points)
    Jul 28, 2015 1:53 AM in response to flowmac

    Hi all,

     

    i have to re-open this.

    I have a Time Capsule now, which to my understanding is nativ HFS+ formatted.

    When i copy a file, using finder "drag n drop" or rsync, from my local mac harddrive via ethernet to time capsule, the file permissions of the initial file are also gone.

     

    original file on Desktop :

    344 -rw-r--r--@   1 flo  staff    173263 18 Dez  2012 0.caf

     

    copied by finder drag n drop or by rsync to time capsule:

    344 -rwxrwxrwx  1 flo  staff    173263 18 Dez  2012 0.caf*

     

    In finder:

    rsync-rechte.png

     

     

    Why should a simple copy job make a file "777", i don't get it. Can anyone with a Time Capsule double check, please? Thank you

  • by etresoft,

    etresoft etresoft Jul 28, 2015 4:28 AM in response to flowmac
    Level 7 (29,298 points)
    Mac OS X
    Jul 28, 2015 4:28 AM in response to flowmac

    Hello again flowmac,

    By default, external partitions have permissions turned off. This is a network volume, but something similar is likely going on. Even if permissions are turned on, your network login may simply report everything as 777. It is nothing to be concerned about.

     

    At TIme Machine volume is special, so you may see correct permissions there.

  • by flowmac,

    flowmac flowmac Jul 28, 2015 12:34 PM in response to flowmac
    Level 1 (0 points)
    Jul 28, 2015 12:34 PM in response to flowmac

    Nothing to be concerned about is one way to deal with it, okay. But when you move the file back from the TC to the mac, the permissions are still 777 I don't like that.

     

    Plus, then it's all right to use a third party NAS since the result is the same, no file permissions are handled at all.

    Just curious that this isn't a bigger concern for a Unix OS, thus inside the apple chain (OS X / Time Capsule).

    If you use a firewire or usb harddisk with hfs+ / journaled, the permissions remain the same.

Page 1 Next