You are not logged in.

#1 2017-05-16 19:36:23

maggie
Member
Registered: 2011-02-12
Posts: 255

Want to use BTRFS for incremental backups with snapshots

I want to use BTRFS for incremental backups using snapshots to save space by only writing the changes but it is confusing how to do it the right way. I made a BTRFS partition and made a sub-volume on a fresh disk. I am using rsync to send over /home/mags to the BTRFS partition

# mkfs.btrfs -L backups /dev/sdb1
# mount -o compress=lzo /dev/sdb1 /mnt/backup
# btrfs subvolume create /mnt/backup/first
# rsync -aP --exclude=.cache /home/mags /mnt/backup/first/

When I am ready for the incremental part in a week, do I take a snapshot and just repeat?

# btrfs subvolume snapshot -r /mnt/backup/first "/mnt/backup/"
# rsync -aP --exclude=.cache /home/mags /mnt/backup/first/

I will be left with /mnt/backup/first that holds the old data and /mnt/backup/first_2017-0516 that holds just the different parts right?

Last edited by maggie (2017-05-16 21:39:28)

Offline

#2 2017-05-16 19:46:53

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Want to use BTRFS for incremental backups with snapshots

It's the other way round.

/mnt/backup/first_2017-0516 will contain the old data and /mnt/backup/first will contain then newly synced data


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-05-16 21:41:21

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: Want to use BTRFS for incremental backups with snapshots

I understand it now. Some guides I found say to run rsync with the --hard-links --inplace switches but I don't see why that is needed. Am I doing it right with just the -aP switch? http://www.sanitarium.net/golug/rsync+b … _2011.html

Offline

#4 2017-05-17 19:38:25

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Want to use BTRFS for incremental backups with snapshots

I think the guide you linked is pretty dated.  I don't see why you would want either of those switches though.  If btrfs is doing the snapshots linking them, I don't think it cares if rsync or cp or cat file > /path/to/backup writes the data.  Correct me if I am mistaken.

Offline

Board footer

Powered by FluxBB