Using btrfs send/receieve for backups

If this is somewhere in the documentation, I’m sorry for not being able to find it.

On my main computer I use btrfs. If I wanted to backup my /home subvol to Rockstor by using btrfs send/receive instead of something slow like rysnc, is it possible?

Yep that is the idea behind though it can be a bit weird to do.

There are some utilities for automating it on the BTRFS wiki that you can use other wise you can do it by hand through ssh.

IIRC to do that it is: [replace home with your volume]

btrfs sub snap -r /home /snapshots/homebckup [makes the initial snap]
btrfs send /snapshots/homebckup | ssh root@remote-server “btrfs receive /backups/home” [should make subvol /backups/home/homebckup]

Then you can make a new snap

btrfs sub snap -r /home /snapshots/homebckup-date
btrfs send -p /snapshots/homebckup-date | ssh root@remote-server “btrfs receive /backups/home” [should make subvol /backups/home/homebckup-date now using diff]

That should be it pretty sure I didn’t forget anything

3 Likes

I’d like to do this too soon, hopefully and add some support in the UI. I am curious, how is your btrfs laid out on your main computer?

I have two main subvols - /home and /media/Photos . And I’m also snapshotting /home hourly which, internally, are subvols - I’m pretty sure

Not sure how Rockstor’s replication works, but presumably these commands have the benefit of being encrypted in transit by ssh? If so, perhaps more suited to sending/receiving over the internet.

I’m going to resurrect this one since its relevant to my question about send|receive…essentially, is this still in the pipeline to provide users the functionality to do a send|receive via the UI to another pool/disk?

For my use case, I want to have the flexibility of doing a ‘backup’ of a share on one pool that is then sent to a different pool on the same machine. I have a primary pool of SSDs then I have HDD storage for backups and non-performance oriented tasks. Additionally, it’d be great to be able to plug in say a large external USB drive and then do ‘backups’ to that periodically.

I manually run the send|receive process today and it works flawlessly in the CLI but automating it is beyond my scope right now (although a fun learning experience probably) and of course if ya’ll are already working on it I can just potentially wait :slight_smile:

Interested in hearing @suman_chakravartula and/or @phillxnet perspectives.

@t3kka Super belated welcome to the Rockstor community by the way.

As far as I understand it yes, a local replication, via btrfs send/receive between pool subvols would be a really nice feature. But the focus is currently on more base features such as disaster recovery improvement and better feedback of ‘error’ states and guidance on getting them sorted. But this ‘in system’ replication idea has definitely been discussed and was seen in a generally favourable light the last time it came up. I had it in mind when I was working on “enhance disk role/management subsystem. Fixes #1494 #1622” with the teaser there being the as yet unimplemented Archive role. The following open issue is relevant in this case:

https://github.com/rockstor/rockstor-core/issues/1157

Our current replication system has been cleaned up of late so should be amenable to the alterations necessary but again, we have some bigger fish to fry before we can get to the ‘nice’ feature set side of things. But of course pull requests are always welcome, although this one would be a rather large one to start off with.

Hope that answers your question. I for one would really like to see this feature but we must take care of the more basic features / requirements that we are currently missing first.