0

I’m going to use Rsync to make a copy of all the user data on my Mac. There are 6 users. I have also set up a Shared directory, which is user 7, but this isn’t really shared as explained here. I solved this problem as is suggested here with a group. That seems to work.

In the future I will be moving away from Mac OS X (the reason is off topic). When I make a backup now and preserve all permissions, how will that affect restoring data from the copy back to a Shared directory on the new system for example Ubuntu? Can I just recreate the group on the new system? I imagine that won’t work, because I think that on the background the groups will not have the same Id, so the permissions don’t match up. Should/could I copy the group information as well? Could I just only ignore the group permissions. Restoring data, creating a new group and applying this to all contained files of a certain folder seems doable.

I have a feeling that using a NAS and control access there will make this problem go away, but I don’t have that now. So for now I just want to know what parameters I need to use when copying the files with Rsync. Should I add the preserve file permissions parameter? I do want the keep all the data of all the users separated, but I don’t want to run into accessibility problems in the future because of a poor made choice now. I seems to me that keeping the file permissions now will make restoring data per user easier.

1 Answer 1

0

Your expectations are generally correct.

When I make a backup now and preserve all permissions, how will that affect restoring data from the copy back to a Shared directory on the new system for example Ubuntu?

When you preserve ownership and permissions with rsync the owner/group is written to the filesystem as an id number. Do an ls -ln to see numbers instead of usernames.

When I make a backup now and preserve all permissions, how will that affect restoring data from the copy back to a Shared directory on the new system for example Ubuntu?

If

  1. you're copying the files to a filesystem that Ubuntu can read, and
  2. the filesystem supports ownership, and
  3. you preserve ownership again when restoring (e.g. rsync),

then, it will copy over the uid numbers to your restore device. If a user doesn't exist with that uid, you'll just see a number.

You can then use something like find /path -uid OLD_ID -exec chown USERNAME "{}" \; on Ubuntu to make the files owned by the right users.

Can I just recreate the group on the new system? I imagine that won’t work, because I think that on the background the groups will not have the same Id, so the permissions don’t match up. Should/could I copy the group information as well? Could I just only ignore the group permissions. Restoring data, creating a new group and applying this to all contained files of a certain folder seems doable.

You can either make sure it has the same gid (option when creating the group), or you could migrate the file data by going through and making sure they all match the new group id, e.g. find /path -gid GROUP_ID -exec chgrp GROUPNAME "{}" \;

So for now I just want to know what parameters I need to use when copying the files with Rsync. Should I add the preserve file permissions parameter?

Use -a to preserve most things ("archive"). Consider -H to create hard links as hard links if you have any.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .