I have backed up my home folder to an external (ext4) hard drive, preserving ownership and permissions. Now I want to do a fresh Linux install and then restore my home folder from the backup. But the ownership is just a UID number, and when I plug the drive into a different machine as a test, I see that the UID is associated with a different, incorrect user name on this machine. Is there a way to tell rsync to translate the UIDs on the backup files to the correct UIDs on the new machine when it restores the files?
rsync has two options to map userids and groupids during the copy. For example,
-o -g --usermap=1000:abc,1001:def --groupmap=1000:abc,1001:def
will convert user and group id 1000 in the backup to the name abc
in the copy, and similarly 1001 to def
. The -o -g
options are included by -a
, so you often won't need them explicitly.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments