Jump to content

Need to copy user areas and preserve permissions


Recommended Posts

Posted

Ive got a window of 2 days after we break up to move everyones mac user areas from one server to another. Should be easy, but every time I have tried, permissions are not preserved (they are from AD, but both servers are bound to it)

 

Tried both the simple 'drag and drop' GUI way and also through terminal, but the result is the same. What do I need to do?

 

I suppose one way would be to enable SMB on both shares and copy using a Windows machine, but that doesnt really seem like an ideal method

Posted (edited)

I assume using

 

cp -R  --preserve /source /destination

 

doesn't give you what you need?

Edited by pete
Posted
Nope that doesnt work. Well, with -P it doesnt work anyway. --preserve isnt recognised at all :confused:

 

Ah, the option is present, just different flag under OS X (my example was for GNU cp). Use a lowercase "-p", see here: Mac OS X Manual Page For cp(1)

 

try

cp -R -p /source /destination

 

Your example ("-P") tells it to ignore symbolic links, lower case ("-p") preserves attributes.

 

*nix - like a big friendly shire horse that'll happily trample over your feet if you tell it to.

 

edit: DMcCoy beat me to it

Posted

Even with lowercase -p it still refuses to copy any permissions :confused: this is really odd

 

This is the exact command I used:

 

cp -R -p /volumes/homes/itteam/user /volumes/Data/homes/itteam

 

homes being the mounted share of the old server. Did this as root

 

Oh and its 10.5.8 I'm doing this on

Posted

Probably a stupid question but how do I check that? There are shares on this server using ACLs

Both are connected to AD, thats where all the permissions are from. One is an OD master, the other is a replica

Posted
I had a similar issue and ended up using rsync which seemed todo the trick - if your going between machines you can 'pull' the files remotely via ssh.
Posted
On both servers, running that says ACL's are supported on both

 

I don't know if it works over the network, at minimum make sure you are connected to the remote server with AFP.

Posted (edited)

I've only used it between local volumes here, NFS may work though.

 

Edit: Assume it's ls -ale that is showing no ACLs?

Edited by DMcCoy
Posted

Ok I've mounted the 'old' homes share on the new server with NFS and it comes back with 'access control lists are not supported or currently disabled on homes'

Running it on the server its being shared from, on the local hard disk, it says they are supported

 

ls- ale just shows me the owner (admin) and staff. I'd been checking the ACL through server admin>file sharing

Posted
asr doesnt sound like a bad idea actually.

 

Theoretically could I use something like CCC to create an image of that drive and then restore it to the new one?

 

Even disk utility will do for a full image

Posted

Just done a incremental image as a test and it does indeed restore fine with all permissions.

Looks like the best way!

 

Thanks for all your help. Shame there isnt a more simple way of doing it!

  • 1 month later...
Posted

A simple straight copy could be done with :

 

sudo ditto -V /Volumes/Source /Volumes/Destination

 

Nice thing about ditto is that it preserves resource forks, meta-data, extended attributes and ACL's unless you tell it not to, good practice to run it as sudo also. :cool:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...