Jump to content
maxse

Need a simple off-site unraid-unraid incremental backup solution

131 posts in this topic Last Reply

Recommended Posts

Hi guys,

 

Now that I've finally set up everything on unraid 6 to work smooth again, I need to work on the next step which is true backup.

I'm a relative newbie so I really need something simple. My main goal is to have a true back-up to protect the main server from a possible crypto virus. From what I understand, cloning shares would be simpler but would not provide any protection from a crypto virus since it would also propagate to the remote server...

 

So I will have another unraid server just used for backups off-site. I need a simple solution that can backup certain shares incrementally and with encryption. I've read a bunch about rsync it just seems very complicated to me and I'm not sure it can do incremental backups? Learning curve seems very steep also

 

Additionally, how would my main unraid server connect to the remote location unraid every night? I'm not sure that a constant VPN connection would be ideal. I'm assuming there's a solution that can turn it on as needed right before the backup and automatically login, etc... I'm sure some of you guys have done this successfully but I'm mostly seeing people just cloning which seems simpler however, doesn't provide true backup protection so I'm not interested in that. I know crashplan had it in the past with the app running on both machines but that got discontinued... I think I would like something similar I would pay a program to do that and just keep them always running on both machines... Definitely no duplcati as I've read more than a few posts of it not working well and erroring out. I also do not want to back up to the cloud, only to the off-site unraid sever...

 

Would really appreciate your help guys, this is the last step but it's very important for me to have a backup of certain shares on my server and I don't want to have that sent to another company, especially since I will have a second unraid server at a remote location.

 

Thank you in advance!

Share this post


Link to post

You can use btrfs on the backup server and make snapshots before syncing, that's what I do on all my backup servers.

Share this post


Link to post

I thought that btrfs is not as stable as xfs for now? That's why I went with XFS

 

What about how I would connect them to speak to each other remotely? And what do you use to sync I'm assuming some rsync command? I haven't read about the snapshot in btrfs thing, I would love to know more about it and your work flow, or anyone else for that matter as well. 

 

Also what happens if it syncs a crypto virus? Wouldn't that encrypt the backup server? How would I access it to restore from an image that was taken before the virus, if everything would not be encrypted by the crypto virus?

Share this post


Link to post

I don't know much about btrfs and snapshots.

I installed BackupPC docker on the second Unraid and enjoy automatic, incremental backups.

Sent from my SM-G955F using Tapatalk

Share this post


Link to post
6 hours ago, maxse said:

I would love to know more about it and your work flow

Turn on backup server, it automatically snapshots all disks at array startup, then I run rsync over ssh between both servers.

 

6 hours ago, maxse said:

Also what happens if it syncs a crypto virus?

Go back to previous snapshot, snapshots are read-only and can't be modified/encrypted.

Share this post


Link to post
Go back to previous snapshot, snapshots are read-only and can't be modified/encrypted.
Hey quick question. How do you connect via ssh to the servers. Through VPN or you opened SSH via port forward?

I'm assuming this servers are in different locations

Sent from my Pixel 2 XL using Tapatalk

Share this post


Link to post
On 1/27/2019 at 12:39 PM, johnnie.black said:

No, they are on the same network.

Thanks I'm looking at different locations though... Also, both servers are always on 24/7, if the snapshot only occurs at array start-up doesn't that mean it won't really be effective unless the server goes down?

I plan to encrypt the drives, so really want this up 24/7 otherwise someone will need to know the password and manually type it in physically at the remote location...

Share this post


Link to post

You can schedule the snapshots at any time and take as many as you like, they don't use any space unless changes are made to the existing files, I only do it at array start time since the backup servers are off except for when I sync them.

Share this post


Link to post

@johnnie.black I would love to try this across the world sometime.  Totally different continents.  I have rsync backups over ssh working fine, but somethings would be better snapshotted.  I used to have rsnapshot on old RFS drives using code from https://rsnapshot.org   But this was in the old v5 days.  How is btrfs different? 

 

Some of my disks are still XFS and some are BTRFS.  Do I need both ends of the snapshot converted to BTRFS in order to do this?

 

Edited by tr0910

Share this post


Link to post

@johnnie.black  That link Method 2 suggests both source and destination need to be on the same volume for snapshots.  This won't work across the world will it?

 

Method 1 uses cp.  Is there any way this can be accomplished with rsync.  It seems more resilient to bad internet connections.

 

I want to snapshot between USA and Asia.

Edited by tr0910

Share this post


Link to post
That link Method 2 suggests both source and destination need to be on the same volume for snapshots.  This won't work across the world will it?

If you scroll down you'll see send/receive, that's what's used to send snapshots from one server to another, locally or remotely, but you need to keep one thing in mind, with Unraid each disk is an independent file system, so you can't for example snapshot an user share that spans more than one disk and send/receive to another server, there are two options:  

1 - both source and destination server have the same disk config, same number of disks with the same capacity (can be larger on dest):

snapshot each disk on source, use send receive to send the initial snapshot to the equivalent disk on the backup server, then keep using send/receive to send incremental snapshots of each disk, as long as snapshots for all disks have the same name, e.g. backup_20190129, they can be browsed all together as an user share both on source and dest.

 

2 - source and destination have a different disk config, this is the one I use since I reuse old upgraded disks on my backup servers, so they always have more but smaller disks than source:

snapshot each disk on the destination server (you can also keep snapshots on the source server to protect from accidental deletes or ransomware but not needed for this, in fact source can even be using a different filesystem), rsync both servers, as long as snapshots for all disks have the same name, e.g. backup_20190129, they can be browsed all together as an user share.

 

 

 

 

 

Share this post


Link to post

Interesting, have you used it this way?  International data connections are hit and miss.  I wonder how resilient this might be?

 

What if I only want to snapshot a /mnt/disk1/sometopfolder/somesubfolder  Is that ok?

 

Not all data deserves this level of protection.  I would only snapshot a very small fraction of my data.

 

Share this post


Link to post
19 minutes ago, tr0910 said:

International data connections are hit and miss.  I wonder how resilient this might be?

If the connection isn't stable best to use rsync since it can resume a transfer.

 

19 minutes ago, tr0910 said:

What if I only want to snapshot a /mnt/disk1/sometopfolder/somesubfolder  Is that ok?

Yes, last subfolder would need to be a subvolume, but it would just need to be created, it looks like a normal folder.

 

 

Share this post


Link to post

I would just add to this to be very careful if you are moving into BTRFS snapshots for the first time. I got caught out by a user who moved 3Tb of data from one folder to another without letting me know they were going to do a bulk move of data. Obviously the backup server the other side and BTRFS is not aware of anything moving, just data being deleted and added. Therefore, all of this data ended up being duplicated via the snapshots. For a day or two I was wondering where all my disk space had disapeared to (as BTRFS snapshot size reporting is not quite up to scratch).

 

As soon as I realized what had happened and deleted the old snapshots I reclaimed 3Tb of disk space instantly. Not a problem if you are the only person accessing the NAS, but if you have family/work members also using it as storage without knowing the technical ins and outs then advice is to be aware of large data moves!

Edited by Ascii227

Share this post


Link to post
On 1/29/2019 at 4:09 AM, johnnie.black said:

If you scroll down you'll see send/receive, that's what's used to send snapshots from one server to another, locally or remotely, but you need to keep one thing in mind, with Unraid each disk is an independent file system, so you can't for example snapshot an user share that spans more than one disk and send/receive to another server, there are two options:  

1 - both source and destination server have the same disk config, same number of disks with the same capacity (can be larger on dest):

snapshot each disk on source, use send receive to send the initial snapshot to the equivalent disk on the backup server, then keep using send/receive to send incremental snapshots of each disk, as long as snapshots for all disks have the same name, e.g. backup_20190129, they can be browsed all together as an user share both on source and dest.

 

2 - source and destination have a different disk config, this is the one I use since I reuse old upgraded disks on my backup servers, so they always have more but smaller disks than source:

snapshot each disk on the destination server (you can also keep snapshots on the source server to protect from accidental deletes or ransomware but not needed for this, in fact source can even be using a different filesystem), rsync both servers, as long as snapshots for all disks have the same name, e.g. backup_20190129, they can be browsed all together as an user share.

Wow thanks! Seems like BTRFS is the answer? So this is a stable long term viable solution? I feel like I was reading that btrfs is still not stable with unraid?

 

So this server is ONLY going to be used for remote backup purposes. That will be it's only use. The only files that will be written to it will be files from the main server.

 

But I just read that you can only back up drives and not shares? The disk config will not be the same between the servers and I want to select say 3 shares out of 6 on the main server to be backed up to the remote server with data on the shares being spread out on multiple disks on the main server... Would this not work then? Not sure I understand that part.

 

Also, what would be the best way then to connect the remote server to the main server across the internet? VPN? If so, is the VPN going to be something that's always connected? not sure if that's the best way to always have a VPN connection live? But I could be wrong? And if that's the answer then I don't want other traffic from dockers on the main server to be using this VPN for other traffic. I'm assuming there's a way to have the VPN (assuming that's the way to do it) be used only for the traffic to the backup server?

On 1/29/2019 at 4:09 AM, johnnie.black said:

 

 

 

 

 

 

Share this post


Link to post
2 hours ago, maxse said:

I feel like I was reading that btrfs is still not stable with unraid?

https://forums.unraid.net/topic/77338-xfs-encryption-questions/?do=findComment&comment=715562

 

2 hours ago, maxse said:

But I just read that you can only back up drives and not shares?

With the 2nd option you can backup just one or more shares.

 

For the remote connection search the forum for VPN, not really sure which one is the best/easier to config since I never needed to use one.

Share this post


Link to post

Right, I will definitely start researching on the best client, but I was just asking in terms of the set up and technology-wise. If a VPN is what I will need to do what I need to to do... 

As opposed to I guess, running some kind of docker app on the client and on the server and have it communicate with each other on its own...

 

Damn, seems like a such a steep learning curve just to have a remote backup to another unraid server :( But at least now I know what kind of set up I will need. BTRFS on the remote server, and some kind of a VPN connection to connect to the remote back up server.

 

Does anyone know that has experience with this type of VPN set up if it's going to be something that's always connected to the remote backup or it's something that can get kicked off as part of the nightly backup process?

 

Johnnie.black, just to make sure I have this right.... You're recommending some kind of an rsync clone script that will encrypt and clone the main server to the backup unraid server, and then have snapshots set up on the backup server say for every day. Then if I need to restore a share, I roll back to the appropriate snapshot on the remote server, then have another rsync script to copy files from backup server back to main server. Correct?

Share this post


Link to post

Yes, get ready for a steep learning curve.  The unRaid experts are quite willing to help in their area of expertise, and this is quite deep in the area of local data hoarding.  However, when venturing beyond local operations, expect to do some pioneering on your own.  I too would love to have snapshots working over large distances but I already have something working.  I presently use rsync over ssh to backup servers from USA to other countries including behind the Great Firewall of China.  This testifies to the resiliance of rsync over ssh.  It just works.

 

I have set up this using rsync that works quite well over ssh. 

See

 

Share this post


Link to post

Yikes, that learning curve is to steep for me at the moment... I don't even know what SSH really means at this point...

 

Isn't there a docker that I can use like Cloudberry that would make things simpler? Any thoughts BTW, on Cloudberry docker? I realize that I would need to be $120 for the software to have greater than 5tb limit but I would be okay with that if it makes things simpler. How about integrating something like nextcloud to connect the two computers?

 

Also anyone heard of Resilio Sync? I saw it mentioned on reddit and has a docker for unraid

Share this post


Link to post

I started using Resilio but after a time just got rsync working. Resilio would sometime work and sometimes not. No experience with the others.

Sent from my chisel, carved into granite

Share this post


Link to post

What do you think of syncthing?

Sent from my Pixel 2 XL using Tapatalk

Share this post


Link to post
4 hours ago, tr0910 said:

I started using Resilio but after a time just got rsync working. Resilio would sometime work and sometimes not. No experience with the others.

Sent from my chisel, carved into granite
 

Oh boy, okay thanks so much. I guess I will have to take the time to learn what SSH is and rsync from your thread. 

So you would recommend doing the rsync with SSH, and have btrfs filesystem running on the remote unraid server doing the daily snapshots, correct?

 

Also, with this method I could have rsync encrypt  the data before it is sent (Im pretty sure the answer is yes I just want to make sure before investing a lot of time into this method), and in the case I would need to recover backed up data, I take it it's pretty straight forward to do?

Share this post


Link to post




Damn, seems like a such a steep learning curve just to have a remote backup to another unraid server  



Yeah I have asked before and suggested that if unraid could build in (or a plugin) support for unRAID to unraid backups I'm sure many more people would have proper backups this way. I'm sure it would increase sales. It's definitely not simple to setup. After learning rsync/vpn etc it's much easier but it's a big initial hurdle that some never get over.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.