You are not logged in.

#1 2017-06-22 15:40:50

7thSon
Member
Registered: 2017-05-07
Posts: 186

[SOLVED] Backup with rsync to Synology NAS

Has anyone set up a backup using rsync to a Synology NAS?
I'm trying to do this, but from what I understand the Synology packaged rsync is an old version and doesn't support Linux ACLs.
I've installed rsync 3.1.2-2 from entware-ng but I still get an error when running rsync from my PC:

"rsync: this server does not support ACLs

I can see that the entware version of rsync is the one used ("which rsync"), but the system still wont allow me to do the backup via ssh:

sudo rsync -aAXv -e ssh --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found", "/home/*"} / rsync@192.168.1.100:/volume1/Backup/ArchLinux/system

Also - are ACLs absolutely necessary for a system backup, or is there another method of backing up and restoring permissions?

Last edited by 7thSon (2017-10-25 14:14:34)

Offline

#2 2017-06-24 05:06:37

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED] Backup with rsync to Synology NAS

Why not mount your shares with cifs and use rysnc on your arch?

Offline

#3 2017-06-24 21:37:21

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

Docbroke wrote:

Why not mount your shares with cifs and use rysnc on your arch?

Would that work in order to get Unix ACLs to work? I read somewhere that Synology uses "syno-ACL" and not regular Unix ones even though their system is Unix/Linux based?
Will give your suggestion a try, thanks.

Offline

#4 2017-07-06 17:20:20

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

So coming back to this I am getting a lot of errors when I run "sudo rsnapshot hourly"

rsync: chown "/mnt/DiskStation/Backup/ArchLinux/hourly.0/localhost/etc/opera" failed: Operation not permitted (1)

And after about 30 seconds the process freezes on this line in the terminal

/usr/bin/make

I tried pointing the backup to another local drive in my computer instead of to the NAS, and that works fine.
So this has something to do with Synology, I have the same usernames on the NAS as I have on my desktop, but still the chown command fails.
If anyone has a working rsync/rsnapshot setup toward a Synology NAS, I would love to get some input.

Offline

#5 2017-08-13 14:34:01

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

Is there any way to have rsync make a separate file with an index of file owners and permissions, since my NAS can't store the files as usual as described above?
I'm thinking if you could make an index file of all the metadata for the backed up files you could then use it to restore the data with owners and persmissions later on.

If anyone has successfully backed up their arch system to a Synology NAS, I would very gladly learn how it was done.

Offline

#6 2017-08-14 06:06:45

monodromy
Member
Registered: 2014-02-08
Posts: 62

Re: [SOLVED] Backup with rsync to Synology NAS

I unfortunately own a Synology NAS, which I did not realize until too late is very linux unfriendly! My solution isn't perfect; in particular, I run into group permission issues. But it works.

What I do is have the share automounted via systemd; that is, in my /etc/fstab I have the following line:

ip.of.synology.nfs:/volume1/homes/$USER     /mnt/syn        nfs     nfsvers=3,rw,rsize=8192,wsize=8192,users,nofail,noauto,x-systemd.automount,x-systemd.device-timeout=10  0 0

On the NAS, I have "Apply default UNIX permissions" unchecked and NFSv4 disabled. Under Shared Folders, I have "homes" shared with "Map all users to admin." Finally, I run rsync from a script with the options

rsync -aiy --no-perms --no-owner --no-group

The script runs on a systemd timer.

I *think* that's everything---it took me quite a bit of fiddling to get it to work at all, and then I was too mentally exhausted to address any flaws.

Hope this helps!

Offline

#7 2017-08-15 06:11:10

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

monodromy wrote:

I unfortunately own a Synology NAS, which I did not realize until too late is very linux unfriendly! My solution isn't perfect; in particular, I run into group permission issues. But it works.

What I do is have the share automounted via systemd; that is, in my /etc/fstab I have the following line:

ip.of.synology.nfs:/volume1/homes/$USER     /mnt/syn        nfs     nfsvers=3,rw,rsize=8192,wsize=8192,users,nofail,noauto,x-systemd.automount,x-systemd.device-timeout=10  0 0

On the NAS, I have "Apply default UNIX permissions" unchecked and NFSv4 disabled. Under Shared Folders, I have "homes" shared with "Map all users to admin." Finally, I run rsync from a script with the options

rsync -aiy --no-perms --no-owner --no-group

The script runs on a systemd timer.

I *think* that's everything---it took me quite a bit of fiddling to get it to work at all, and then I was too mentally exhausted to address any flaws.

Hope this helps!

I have to try this out, but I'm guessing your backup doesn't store any file ownerrs or permission at all?
Will it work to backup my root filesystem and restore it in case of a failure, if the backup is set up like yours?

Offline

#8 2017-08-15 16:55:47

monodromy
Member
Registered: 2014-02-08
Posts: 62

Re: [SOLVED] Backup with rsync to Synology NAS

I have to try this out, but I'm guessing your backup doesn't store any file ownerrs or permission at all?
Will it work to backup my root filesystem and restore it in case of a failure, if the backup is set up like yours?

You are correct on the first question. I only back up my /home, so I'm not sure about the second question---as you say, the permissions are going to be an issue. The problem with synology is that it uses UIDs instead of usernames, and the way it assigns UIDs is nonstandard. Thus, while I was the first user created both on my laptop and on the NAS, my UID on the laptop is 1000 while on the NAS it is 1024. There are supposedly methods for mapping UIDs. If this could be done, then one would turn off root squashing on the NAS, and I think everything would work fine. But I lost patience and never figured out how to do that; and in any case, since I only back up /home, it's a very small issue for me.

Offline

#9 2017-10-08 14:31:03

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

I've been looking further into this, and it seems that backing up to a tar file might be the way to go for me. A tar file can store the owners and permissions etc, regardless of the filesystem it resides in?
I tried using duplicity to do the backup, but it's very limited in configuration, what are the best tools I can choose from in order to backup to tar (both / and /home)?

Also, what would you suggest is a good way to test that my backup is correct? I don't want to see my working Arch installation destroyed by a backup that's not up to par smile

Last edited by 7thSon (2017-10-08 14:37:20)

Offline

#10 2017-10-25 14:14:17

7thSon
Member
Registered: 2017-05-07
Posts: 186

Re: [SOLVED] Backup with rsync to Synology NAS

To let any future reader of the thread know how this was solved, I used borg backup in the end.
Borg uses a repository and stores permissions etc. without placing the files directly on the backup filesystem.

Offline

Board footer

Powered by FluxBB