Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] SMR drives (WAS: cryptsetup close and device in use when it is not)
Date: Mon, 02 Aug 2021 06:13:19
Message-Id: 79367904-1d97-5d5e-ab0e-5f6cbb36071d@iinet.net.au
In Reply to: Re: [gentoo-user] [OT] SMR drives (WAS: cryptsetup close and device in use when it is not) by Frank Steinmetzger
1 On 2/8/21 5:55 am, Frank Steinmetzger wrote:
2 > Am Sun, Aug 01, 2021 at 11:36:36AM +0800 schrieb William Kenworthy:
3 >
4 >>>> Its not raid, just a btrfs single on disk (no partition).  Contains a
5 >>>> single borgbackup repo for an offline backup of all the online
6 >>>> borgbackup repo's I have for a 3 times a day backup rota of individual
7 >>>> machines/data stores
8 >>> So you are borg’ing a repo into a repo? I am planning on simply rsync’ing
9 >>> the borg directory from one external HDD to another. Hopefully SMR can cope
10 >>> with this adequatly.
11 >>>
12 >>> And you are storing several machines into a single repo? The docs say this
13 >>> is not supported officially. But I have one repo each for /, /home and data
14 >>> for both my PC and laptop. Using a wrapper script, I create snapshots that
15 >>> are named $HOSTNAME_$DATE in each repo.
16 >> Basicly yes: I use a once per hour snapshot of approximately 500Gib of
17 >> data on moosefs, plus borgbackups 3 times a day to individual repos on
18 >> moosefs for each host.
19 > So you have:
20 > Host A ──[hourly]──> Online-Borg A ─┐
21 > ├──[3/day]──> Offline-Borg
22 > Host B ──[hourly]──> Online-Borg B ─┘
23 > ?
24 >
25 >> 3 times a day, the latest snapshot is stuffed into a borg repo on moosefs
26 >> and the old  snapshots are deleted.
27 > How do you stuff just the latest snapshot of a repo into another repo?
28 >
29 >> 3. borgbackup often to keep changes between updates small - time to
30 >> backup will stay short.
31 > Apparently you are dealing with some kind of productive, high-availability
32 > or high-throughput system. I only have my personal stuff, so I don’t mind it
33 > taking a few minutes. That allows me to watch progress bars and numbers
34 > going up. :)
35 >
36 >> 4. borg'ing a repo into a repo works extreemly well - however there are
37 >> catches based around backup set names and the file change tests used.
38 >> (ping me if you want the details)
39 > But what is the point of that? Why not simply keep the last x hourly/
40 > daily/weekly snapshots? The only thing I can think of is to have a
41 > small(ish) short-term repo and keep the larger archival repo separate.
42 >
43 Hi Frank,
44
45 Not quite - I see I could have been clearer.  I "experiment" a lot -
46 which means things break so I need to get back running quickly.  So the
47 purpose of the online repos and snapshots is just for that - quick
48 recovery.  Longer term I want to have an offline copy for a real
49 disaster (yes, I have needed to restore almost 20TiB including the
50 online backups on the moosefs system three months ago - self caused :)
51 as well as often needing to step back a few days/weeks for a historical
52 copy of a file, or less often a system restore on a host.  By the way,
53 this discussion has been useful as I found some failed backups due to a
54 missing dependency in the borgbackup ebuild when looking closer at it -
55 has a bug.  Need to do some watcher scripts to detect that.
56
57
58 stage 1: online, immediately available
59
60 Hosts (those with actual attached storage - a mixture of intel, arm32
61 and arm64 devices are backed up to their own borg repo 3 times a day via
62 push.  One repo per machine on moosefs.
63
64 A separate script does an hourly backup of VM, LXC images, and various
65 data stores via a moosefs snapshot.
66
67 stage 2: resource management for the snapshots
68
69 3 times a day, a script does a borg create on the latest snapshop at the
70 time, and when complete deletes all previous snapshots (-1) so at that
71 point I have two older snapshots available + a couple created during the
72 borg run - note that large multi GiB snapshots can quickly use up all
73 memory (32GiB) on the moosefs master unless culled regularly.
74
75 stage 3: offline because disasters happen :)
76
77 All borg repos are on moosefs with a single root directory
78 (/mnt/mfs/backups) so once every day or so I manually mount the offline
79 disk and do a borg create on the backup directory.  I was doing this
80 once a week, but operationally its easier to do 5-10 minutes every day
81 than an hour once a week due to the scale of changes over the longer
82 time period.
83
84 So, its looks like:
85
86 Host A ──[3/day]──> Online-Borg A ─┐
87 ├─────────────────────────[common directory]---[manual, 1/day]──> Offline-Borg
88 Host ... ──[3/day]──> Online-Borg ... ─┘ |
89 ? |
90
91 Snapshots ──[hourly]──> Online-Borg "snaps" ─[3/day] ─────────────────┘
92
93
94 BillK

Replies