Skip to contentSkip to conversation

btrfs userspace question - where's the utility to dump/restore?

DISCUSSION Valdis Kletnieks 2 participants 3 messages Jan 17, 2013 – Jan 19, 2013

lore
Share & tools
lore
#0 lore raw

So I'm looking at playing with btrfs, and I start looking at the userspace pieces I'll need. What I can't find is an equivalent of the ext[34] "dump/restore" package to dump data to an external backup device. Is 'tar cf --acls --selinux --xattrs /external/fs.dump' as good as it gets, or is something else recommended?

#1 lore raw
Quoted 5 lines · Valdis Kletnieks

So I'm looking at playing with btrfs, and I start looking at the userspace pieces I'll need. What I can't find is an equivalent of the ext[34] "dump/restore" package to dump data to an external backup device. Is 'tar cf --acls --selinux --xattrs /external/fs.dump' as good as it gets, or is something else recommended?

tar doesn't handle reflinks(+), so the above won't quite give you a
complete duplicate. In the btrfs tool, there's send/receive, which should(*) be sufficient to deal with reflinks.

Hugo.

(+) aka CoW copies, or snapshots
(*) I regret to say that I've not had the opportunity to play with send/receive myself yet, so I can't advise on the details of making it work yet.

Signature · 3 lines
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
               --- Prisoner unknown:  Return to Zenda. ---               
#2 lore raw
Quoted 10 lines · Hugo Mills
Quoted 5 lines · Valdis Kletnieks

So I'm looking at playing with btrfs, and I start looking at the userspace pieces I'll need. What I can't find is an equivalent of the ext[34] "dump/restore" package to dump data to an external backup device. Is 'tar cf --acls --selinux --xattrs /external/fs.dump' as good as it gets, or is something else recommended?

tar doesn't handle reflinks(+), so the above won't quite give you a
complete duplicate. In the btrfs tool, there's send/receive, which should(*) be sufficient to deal with reflinks.

So I decided to try it out on the filesystem that I stash all my music (mostly because I can survive without that filesystem if I trash it, and I have a known good backup).

Apparently, send/receive isn't in the manpage, which is why I didn't see it. Fortunately, there's --help

[~] btrfs send --help
usage: btrfs send <command> <args>

btrfs send [-v] [-i <subvol>] [-p <parent>] <subvol>
Send the subvolume to stdout.

[~] btrfs send -v /mp3 > /disk2/backups/mp3.btrfs
ERROR: /mp3 is not read-only.
[~] mount -o remount,ro /mp3
[~] btrfs send -v /mp3 >| /disk2/backups/mp3.btrfs
ERROR: /mp3 is not read-only.

Bah. Obviously this isn't anywhere near as easy as it is for ext4.

/me wanders off to find more caffeine...