How to restore raw backups
- Dominant language
- Perl
- Stars
- 2.1k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
I would appreciate some help understanding how to go about restoring raw backups, especially incremental ones. I love some of the features of raw backups, like compatibility with any SSH host regardless of filesystem, encryption with gpg, compression, and splitting. But I'm a little confused on how to restore !
With the verbose logs, it's not too hard to piece together a command to pipe the file or files back over ssh, decrypt, decompress, and then send them to `btrfs receive`. I don't know how to use mbuffer well, so I used pv to show progress; I was testing with lz4 compression and gpg encryption too; and came up with a command sort of like this:
`ssh -i $ssh_id -p $ssh_port $ssh_user@$ssh_host "cat ${btrbk_target_dir}/ROOT.*.btrfs.lz4.gpg.split_*" | pv --size $total-size | gpg --decrypt | lz4 -d -c | btrfs receive /some/local/subvolume`
This works well to restore the initial backup, but is not the right way to restore overall. This fails once the first backup completes; gpg actually complains that the archive has ended and bails, though if that didn't happen I'm guessing this would still be wrong.
My next guess is that I'll need to restore each _backup_ individually, one at a time. Sort of like:
```bash
for $backup_date in $list_of_backup_dates; do
long_restore_command_on "${btrbk_target}/ROOT.${backup_date}.btrfs.lz4.gpg.split_*" | btrfs receive /some/local/subvolume
done
```
I guess this will make a sequence of subvolumes locally:
```
/some/local/subvolume
- /ROOT.20210101T0000 <---- the initial backup; lots of data
- /ROOT.20200102T0000 <---- incremental snapshots; less data in the archive, will it still look like a full snapshot?
- ... <---|
```
Will btrfs be smart enough that each of these subvolumes build on each other, and look like the full snapshot at the point-in-time, even though the only data used to generate it was the incremental delta data? From that point, can I proceed with the advice on making the rw snapshot from the README from the latest subvolume?
Thanks for any advice on getting this working! If possible to make this straightforward, I'd love to add something to the README or FAQ about this. And in the future, I'd love for btrbk to use some of the context from `btrbk.conf` to automate some of this, though I understand for now btrbk doesn't help with restores.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue does not name a repository file or test; start with the README's raw-backup and restore guidance and the verbose restore pipeline described here. Work out how initial and incremental archives should be processed with btrfs receive, then document a complete restore sequence in the README or FAQ, including the final read-write snapshot step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, shell
- Domain
- documentation, operating-systems
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100