138 lines
4.1 KiB
Markdown
138 lines
4.1 KiB
Markdown
|
+++
|
||
|
title = 'HowTo backup'
|
||
|
date = 2024-08-10
|
||
|
hidden = true
|
||
|
+++
|
||
|
|
||
|
In short: 3-2-1 backup strategy.<!--more-->
|
||
|
|
||
|
|
||
|
|
||
|
## Backup strategy
|
||
|
|
||
|
You should have:
|
||
|
- 3 copies of data
|
||
|
- on 2 different types of storages
|
||
|
- including 1 off-site copy
|
||
|
|
||
|
### Why so many copies?
|
||
|
|
||
|
What if your main drive with data will die? That's the reason to have backup nearby.
|
||
|
|
||
|
What if your main storage Server will die with all drives in it due to power spike (flood,etc...)? That's the reason to have off-site backup.
|
||
|
|
||
|
![](https://imgs.xkcd.com/comics/backup_batteries.png)
|
||
|
|
||
|
### 3 copies of data
|
||
|
|
||
|
You should have:
|
||
|
- Original data
|
||
|
- 1 backup at place (another drive)
|
||
|
- 1 backup in another place (encrypted in cloud, HDD stored in another remote location (friend's house))
|
||
|
|
||
|
Backups which should be made regularly (daily or more frequently for critical data, +depends how "hot" data (how fast it changes))
|
||
|
|
||
|
### 2 types of storages
|
||
|
|
||
|
You need to have different 2 types of storage to metigate if some error may affect all devices of 1 type.
|
||
|
|
||
|
Storage types examples:
|
||
|
- Internal HDD/SSD (we will focus on them)
|
||
|
- External HDD (them)
|
||
|
- USB drive/SSD
|
||
|
- Tape library
|
||
|
- Cloud storage (and them)
|
||
|
|
||
|
### 1 off-site copy
|
||
|
|
||
|
It's pretty simple:
|
||
|
- encrypted cloud backup
|
||
|
- encrypted HDD with backup in another town in friend's house (secured by bubble wrap)
|
||
|
- or at least encrypted HDD in another house (also secured by bubble wrap)
|
||
|
|
||
|
The more distant this off-site backup the better.
|
||
|
|
||
|
{{< spoiler Examples >}}
|
||
|
|
||
|
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
|
||
|
|
||
|
### Enterprise-ish (Expensive at start, hard setup, easy to maintain)
|
||
|
|
||
|
Ceph cluster:
|
||
|
- requires 3 servers (at least) (OS - Proxmox)
|
||
|
Ideally server motherboard, ECC RAM, Intel Xeon E5 v4 CPU Family or better / AMD Epyc analog
|
||
|
- any number of drives (but at least 3 drives)
|
||
|
Ideally enterpise-class (or with "RAID support"). The more IOPS - the better
|
||
|
- [automatic snapshots](https://github.com/draga79/cephfs-snp)
|
||
|
- 10Gb network (if you expect total 9-ish (or more) HDD drives or some SSDs)
|
||
|
- and ideally SSD cache (at least 2 SSDs with PLP) (1tb each more than enough for 10TB of raw storage)
|
||
|
|
||
|
Off-site backup:
|
||
|
|
||
|
Cloud storage + [dublicati](https://github.com/duplicati/duplicati)
|
||
|
OR
|
||
|
Proxmoxx Backup Server at another city (e.g. at friend's house) with RAID1/5/6
|
||
|
(thou you should set it up so if malware/hacker would get to root user it won't overwrite backups)
|
||
|
|
||
|
#### Pros
|
||
|
- Low chances of loosing data because you essentially have 3 copies (by default, 2 min) of data + hourly/daily/weekly/montly snapshots
|
||
|
So if you get 2 dead drives in a same time - you still won't loose your data
|
||
|
Essentially it covers 2 copies of data
|
||
|
- If drive fails - you simple take it out, put new drive in and say that you want add this drive to pool via WebGUI
|
||
|
- With SSD cache you can throw in any trashy HDD drives until they start to fail
|
||
|
- You can add any number of drives
|
||
|
- And if you need/want to be able to freely shutdown one of a servers and still be able to access data - you need to distribute drives so their raw storage would be even on each server.
|
||
|
Or just add in few more server and distribute drives between them so you would still be able to access this storage
|
||
|
- If you get your house+servers destroed - you wouldn't loose your data
|
||
|
|
||
|
#### Cons
|
||
|
- Expect 30% usable space from raw storage (you can use Erasure Coding (RAID5 analog) but it will be slow as hell)
|
||
|
- Bad/Slow (in terms of IOPS and delay times) drives without PLP SSD cache can have amazingly bad total speed
|
||
|
- Power usage might be a burden if you don't have any
|
||
|
- More performance comes with more drives because speed = available IOPS and avarage access time for 2-3 drives that have that data. So more drives, more IOPS we have (excluding SSD cache case)
|
||
|
|
||
|
|
||
|
### Home-server (Medium setup, hard to maintain)
|
||
|
|
||
|
#### Pros
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
|
||
|
#### Cons
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
### Home PC (Medium setup, hard to maintain)
|
||
|
|
||
|
#### Pros
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
|
||
|
#### Cons
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
### Portable Laptop (easy setup, hard to maintain)
|
||
|
|
||
|
#### Pros
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
|
||
|
#### Cons
|
||
|
-
|
||
|
-
|
||
|
-
|
||
|
{{< /spoiler >}}
|
||
|
|
||
|
{{< source >}}
|
||
|
https://www.techtarget.com/searchdatabackup/definition/3-2-1-Backup-Strategy
|
||
|
{{< /source >}}
|
||
|
|