User Tools

Site Tools


public:btrfs_incremental_backup_to_external_drive_with_snapper

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:btrfs_incremental_backup_to_external_drive_with_snapper [2016/03/24 21:39] fangfufupublic:btrfs_incremental_backup_to_external_drive_with_snapper [2017/07/26 15:51] (current) – removed fangfufu
Line 1: Line 1:
-====== BTRFS incremental backup to external drive with Snapper ====== 
-Snapper creates timeline for your BTRFS file system. You can send those timelines to an external hard drive for backup. This method is way better than rsync, as every single change to your filesystem is preserve.  
  
-A better way of doing this kind of thing might be Btrbk, but it is not available in the default Debian repository. Although it is available in Neurodebian repository. I have Snapper set up already, so I didn't bother with trying to set up Btrbk.  
- 
-===== Bootstrapping ===== 
-The bootstrapping process will take a long time.  
- 
-<code bash> 
-# $i is the ID of the backup 
-# $DRIVE is the mount point for the backup drive. 
-# $chosen_date is the date for the snapshot 
- 
-mkdir /media/fangfufu/$DRIVE/home-$i-$chosen_date 
-btrfs send /home/.snapshots/$i/snapshot | btrfs receive /media/fangfufu/$DRIVE/home-$i-$chosen_date 
-</code> 
- 
-===== Subsequent backup ===== 
-We are transferring the diff between two backups. It is relatively fast.  
- 
-<code bash> 
-# $i is the ID of the previous backup 
-# $j is the ID of the new backup 
-# $DRIVE is the mount point for the backup drive. 
-# $chosen_date is the date for the snapshot 
- 
-mkdir /media/fangfufu/$DRIVE/home-$j-$chosen_date 
-btrfs send -p /home/.snapshots/$i/snapshot /home/.snapshots/$j/snapshot | btrfs receive /media/fangfufu/$DRIVE/home-$j-$chosen_date 
-</code> 
- 
-===== Other notes ===== 
-BTRFS subvolume can be set up in any subdirectory. In fact, assuming that Snapper is covering your ''/home'', snapshots will be created at ''/home/.snapshots/$i/snapshot'', where ''$i'' is the snapshot ID.  
- 
-If you want to set up multiple BTRFS subvolumes in the same directory, they must have unique names. Because every single subvolume created by Snapper has the name ''snapshot'', you have to put them into different sub-directories.  
- 
-You have to have the parent snapshot, in order to receive the diff snapshot. Otherwise the filesystem will throw error. **So you have transfer backup to the external drive at least once within the maximum retention period specified by your Snapper configuration.** If you forget to do that, you have to redo the bootstrapping process.  
- 
- 
-===== References ===== 
-https://btrfs.wiki.kernel.org/index.php/Incremental_Backup 
- 
-https://wiki.archlinux.org/index.php/Snapper 
public/btrfs_incremental_backup_to_external_drive_with_snapper.1458855590.txt.gz · Last modified: 2018/03/31 00:38 (external edit)