High-performance, standalone backup restore tool for backy. backy-extract restores a specified backup revision to stdout or a file/block device target.
- Pick a backup revision, for example using
backy status
. - Create a restore target, for example with
lvm
orrbd image
. - Extract backup:
backy-extract /srv/backy/vm/Nym6uacWoXGb8VnbksM3yH /dev/rbd0
backy-extract
tries to acquire the purge lock before proceeding. So if it
does not seem to start, check if there are running backy
processes operating
on the same backup.
Block devices are assumed to be zeroed (discarded) before restoring. If this is
not the case, invoke backy-extract
with --sparse=never
.
In general, cargo build --release
should do the right thing. This application
depends on liblzo2 being availabe.
If you get compiler/linker errors, try compiling again with export LIBRARY_PATH=/path/to/liblzo2
.
A Makefile is supplied to create a statically linked release which should run on virtually every Linux x86_64 system.
backy-fuse
provides access to individual revisions via FUSE (filesystem in
userspace). This allows to mount backup images and retrieve single files.
- Start
backy-fuse
to access all backups of a given VM via FUSE:backy-fuse -d /srv/backy/vm /mnt/backy-fuse
- Mount the revision of interest:
mount -o ro,loop /mnt/backy-fuse/tAGKE5rrxReggVMtoPSr7 /mnt/restore
When finished, the above stops must be reversed:
- Unmount loop device:
umount /mnt/restore
- Finish FUSE:
fusermount -u /mnt/backy-fuse
Note that in case the image contains a partition table, the loop device must be
set up explicitly using for example:
losetup -f -P --show /mnt/backy-fuse/tAGKE5rrxReggVMtoPSr7
lostup will create subdevices for each partition, e.g. /dev/loop0p1
.
Don't forget to remove the manually created loop devices with losetup -D
after
use.
backy-fuse
maintains two caches: A read-only cache to speed up read operations
and a dirty cache to store pages which have been written to. Both caches have
the same size, which may be specified with the -c
flag. Note that chunk will
spill into the backy directory if the dirty cache gets too full. This is
generally not a problem because the next backy purge
run will clean it up.
However, it is strongly recommended to mount FUSE volumes with the ro flag.
Set RUST_LOG=info
or even RUST_LOG=debug
in the environment for FUSE
protocol diagnostics.
backy-fuse
is not compiled by default due to restricted portability. To
compile it, run cargo build --release --features fuse_driver
. Note that both
liblzo2 and libfuse must be detectable by the linker.
Please create issues and submit pull requests at https://github.com/flyingcircusio/backy-extract/.
Contact Christian Kauhaus for questions, suggestions, and bug fixes.