Ever since my old HDD started dying and filling up with bad sectors I have been thinking about a solid backup solution for my system.
I have;
1 internal HDD (btrfs)
1 external HDD (btrfs)
Arch Linux
The Problem
How can we fully backup our system?
Discussion
There are 2 types of backup.
One type is where the data is protected from failure of the primary medium. This is where the data is typically backed up to another storage medium like an external drive. Examples include the disk dying or being stolen.
The other type is protection against accidental deletion and corruption of data. Think Apple 'timemachine' or a snapshot of your data at a particular time.
They are different. Let's explain the 'timemachine' concept with one example; you may have a corrupted file and your backup program also backed up the corrupted file, so you cannot recover the file from your normal backup. Instead, if you have a snapshot of how your data looked at a certain time you could restore the file from an earlier time where maybe it wasn't corrupted.
BTRFS
Introducing btrfs. A relatively unstable and heavily in-development File System.
One feature over other File Systems (FS) is that this FS allows for snapshots-in-time, effectively letting you restore files as they were when you made the snapshot. The great thing about it is that it doesn't actually take up much space because it just records the changes made to files.
The Solution
Let's create snapshots and backup our data in full. This should give us a full backup solution covering both types of backup. We are protected if data is corrupted or destroyed and we are also protected in case of unintentional modifications or deletions.
We can create a script of which there are 3 components;