Rsync and ownership/permissions

Now I have a question...

I am creating a backup of my entire owncloud data directory but when I check the result, the ownership and permissions are not the same. What am I doing wrong?

sudo rsync -aAxvhz /media/data/ownclouddata/ /media/backup --delete

On the source it has for one of the folder...

drwxr-xr-x 7 www-data www-data 4.0K Oct 3 14:25 Edwin

And on the destination it has...

drwx------ 2 root root 4.0K Oct 20 07:03 Edwin

???

3

2 Answers

The backup device has an incompatible file system, such as Windows FAT. FS doesn't have owners or permissions. USB and external drives are supplied like that for convenience, but it is bad for Linux users. You may need to delete the partition, create new of proper type, then run mkfs. I am staying conservative on file systems, only ext4.

Because drive tech and connection methods have changed, I cannot guess which way will suit you. In old days, "/sbin/fdisk /dev/sdXXX" (XXX might be b or c for you) would be the way to start. Now if your eternal is SSD, different way needed. There is good chance GNU parted can work to remove old partition and create new, but I worry about device types.

Thanks for your help!!! In fact, the permissions were not correct during the rsync progress but once finished, all permissions/ownerships were just as on the source drive.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like