Skip to main content
Topic: [SOLVED] How use btrbk (Read 329 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] How use btrbk

I am new to btrfs.
I have /boot ext4 and /btrfs partitions, on luks.

How can I backup to external drive? Does it need to be btrfs too?
How do I make snapshots on the same drive?

I tried to make a snapshot:
Code: [Select]
cat /etc/btrbk/btrbk.conf
timestamp_format        long
snapshot_preserve_min   18h
snapshot_preserve       48h

snapshot_dir /btrbk_snapshots
volume /dev/mapper/root

`btrbk run` doesn't make it.

 

Re: How use btrbk

Reply #1
Code: [Select]
# snapshot directory on backed up partition 
snapshot_dir               .snapshots
# snapshot name format <name>.YYYYmmddTHHMM
timestamp_format           long
# zstd compression for backup transfer
stream_compress            zstd
# path to log
transaction_log            /var/log/btrbk.log
# stream buffer size
stream_buffer              256m

# the daily backup is the first one after midnight
preserve_hour_of_day       0
# Monday is the first day of week
preserve_day_of_week       monday
# preserve all temporary snapshots for at least one day
snapshot_preserve_min      1d
# preserve 14 latest daily, 8 weekly, 6 monthly, 1 annual snapshots
snapshot_preserve          14d 8w 6m 1y
# do not preserve temporary snapshots
target_preserve_min        no
# preserve 6 latest daily, 4 weekly, 6 monthly, 1 annual snapshots
target_preserve            6d 4w 6m 1y
# preserve all snapshot archive
archive_preserve_min       all
# exclude
archive_exclude /swap

# root partition
volume /
  # backup at /mnt/backup/
  target /mnt/backup/my_device
  # backup main partition
  subvolume .
    # partition name in snapshot rootfs
    snapshot_name rootfs

That is if you do NOT boot from a subvolume.

https://digint.ch/btrbk/doc/faq.html
Quote
If your linux root filesystem is btrfs, I recommend booting linux from a btrfs subvolume, and use the btrfs root only as a container for subvolumes (i.e. NOT booting from "subvolid=5"). This has the big advantage that you can choose the subvolume in which to boot by simply switching the rootflags=subvol=<subvolume> kernel boot option