Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 2795  / 1 Year ago, wed, november 23, 2022, 6:48:37

I am using snapshots for backing up data of my @home subvolume. But I would like to backup the real important data (like all my files, which are in @home, but not hidden directories because I am not interested in backing up .cache and other stuff which changes often, because this would lead to much waste of space in my incremental backup solution.



Could I somehow achieve it, that my real data are a subvolume in home without creating a directory in home which contains all data and is a own subvolume, or is this impossible by design?



My backup method is similar to: https://btrfs.wiki.kernel.org/index.php/Incremental_Backup


More From » btrfs

 Answers
5

Dot-files have no special meaning to the filesystem, and btrfs send cannot currently (Feb 2014) exclude files or directories from the target subvolume.



However, btrfs subvolume snapshot does exclude subvolumes which are contained in the target subvolume (it creates empty directories in the snapshot), so




  • You may replace the directories that you want to exclude with subvolumes.



rsync, or a graphical frontend such as grsync, can exclude files and directories and allows for incremental backups.



If you give the parameter --inplace to rsync, it only overwrites the different portions in the files that have changed, rather than rewriting the entire contents of the files. This is an incremental backup, by definition, and saves space on btrfs.



Instructions:




  • Backup @home the first time with btrfs send/receive.
    To do further backups: create a snapshot of the backup of @home, then run rsync to copy the current home over the newly-created snapshot, and remember to give rsync the parameter --inplace.



rsync allows for extensive customization of the backup process, you can read the list of parameters by running man rsync on the terminal.



For completeness, I'll add another approach, which is not useful once you know how to use rsync: deduplicate after a "normal" copy (rsync or cp or whatever else).




  • Copy the files normally, then deduplicate with bedup. (A new bedup branch was introduced that supports kernel 3.12, but it is not applicable on Ubuntu at the time of writing, because not even Ubuntu 13.10 has such a recent kernel). This is not necessary if you pass --inplace to rsync, as suggested above.



Speaking of back-ups: Remember that btrfs is experimental and so is bedup.


[#26972] Friday, November 25, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
iriousutur

Total Points: 321
Total Questions: 112
Total Answers: 106

Location: Sweden
Member since Mon, Dec 7, 2020
3 Years ago
;