public:using_btrbk_to_backup_my_home_partition
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
public:using_btrbk_to_backup_my_home_partition [2017/07/05 21:13] – created fangfufu | public:using_btrbk_to_backup_my_home_partition [2018/03/31 00:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using Btrbk to backup my home partition ====== | ====== Using Btrbk to backup my home partition ====== | ||
+ | Due to the [[public: | ||
+ | | ||
+ | |||
+ | It is much harder to understand, please read the man page. I am just going to document what I did to my own machine. | ||
+ | |||
+ | ===== Partition layout ===== | ||
+ | I created an empty Btrfs partition with a subvolum name '' | ||
+ | |||
+ | This is a snippet of my '' | ||
+ | < | ||
+ | # <file system> <mount point> | ||
+ | #Entry for / | ||
+ | UUID=" | ||
+ | |||
+ | #Entry for / | ||
+ | UUID=" | ||
+ | </ | ||
+ | |||
+ | Here is the top level directory layout of the partition that contains my home directory subvolume: | ||
+ | < | ||
+ | fangfufu@smithsonian: | ||
+ | home snapshots | ||
+ | </ | ||
+ | |||
+ | ===== Btrbk configuration ===== | ||
+ | Here is my Btrbk configuration: | ||
+ | < | ||
+ | lockfile | ||
+ | transaction_log | ||
+ | timestamp_format | ||
+ | |||
+ | volume /mnt/home | ||
+ | snapshot_preserve | ||
+ | snapshot_preserve_min | ||
+ | target_preserve | ||
+ | target_preserve_min | ||
+ | snapshot_dir snapshots | ||
+ | subvolume home | ||
+ | target send-receive / | ||
+ | |||
+ | volume ssh:// | ||
+ | ssh_identity / | ||
+ | target_preserve | ||
+ | target_preserve_min | ||
+ | snapshot_create | ||
+ | snapshot_dir snapshots | ||
+ | subvolume home | ||
+ | target send-receive / | ||
+ | target send-receive / | ||
+ | </ | ||
+ | |||
+ | Basically, my laptop is configured to save 24 hourly snapshots, 7 daily snapshots, 4 weekly snapshots. The external backup drive has 6 months of snapshots. | ||
+ | |||
+ | The extra '' | ||
+ | |||
+ | ===== Doing backup ===== | ||
+ | ==== Generating snapshots ==== | ||
+ | Btrbk needs to be run hourly, for the whole snapshot thing to work. In order to do that we create ''/ | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | echo > / | ||
+ | / | ||
+ | return 0 | ||
+ | #returning 0 to suppress cron warning emails. | ||
+ | </ | ||
+ | |||
+ | Do remember to run '' | ||
+ | |||
+ | Btrbk will attempt to send the Btrfs diffs to the external hard drive, if it is attached. If not, then only the snapshot will be created. | ||
+ | |||
+ | ==== Sending snapshots to the external hard drive ==== | ||
+ | All you have to do is type in '' | ||
+ | |||
+ | < | ||
+ | btrbk command line client, version 0.25.0 | ||
+ | Using configuration: | ||
+ | WARNING: Skipping target "/ | ||
+ | WARNING: Skipping target "/ | ||
+ | Using transaction log: / | ||
+ | Creating subvolume snapshot for: / | ||
+ | [snapshot] source: / | ||
+ | [snapshot] target: / | ||
+ | Cleaning snapshots: / | ||
+ | Deleted 0 subvolumes in: / | ||
+ | WARNING: Skipping cleanup of snapshots for subvolume " | ||
+ | Completed within: 0s (Fri Jul 7 09:27:21 2017) | ||
+ | -------------------------------------------------------------------------------- | ||
+ | Backup Summary (btrbk command line client, version 0.25.0) | ||
+ | |||
+ | Date: Fri Jul 7 09:27:21 2017 | ||
+ | Config: / | ||
+ | |||
+ | Legend: | ||
+ | === up-to-date subvolume (source snapshot) | ||
+ | +++ created subvolume (source snapshot) | ||
+ | --- deleted subvolume | ||
+ | *** received subvolume (non-incremental) | ||
+ | >>> | ||
+ | -------------------------------------------------------------------------------- | ||
+ | / | ||
+ | +++ / | ||
+ | |||
+ | 127.0.0.1:/ | ||
+ | !!! Target "/ | ||
+ | !!! Target "/ | ||
+ | |||
+ | NOTE: Some errors occurred, which may result in missing backups! | ||
+ | Please check warning and error messages above.</ | ||
+ | |||
+ | ===== Accesing snapshots ===== | ||
+ | Snapshots are accessible under ''/ | ||
+ | <note tip> You should add ''/ | ||
+ | |||
+ | |||
public/using_btrbk_to_backup_my_home_partition.1499289216.txt.gz · Last modified: 2018/03/31 00:38 (external edit)