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 23:11:03
Message-Id: e0bdc2e8-7c8b-e3d2-5200-b1e21716413d@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 3/8/21 5:52 am, Frank Steinmetzger wrote:
2 > Am Mon, Aug 02, 2021 at 01:38:31PM +0800 schrieb William Kenworthy:
3 >
4 >>> Yup. Today I did my (not so) weekly backup and rsynced the repo to the new
5 >>> drive. After that I wanted to compare performance of my old 3 TB drive and
6 >>> the new SMR one by deleting a snapshot from the repo on each drive. But Borg
7 >>> objected on the second deletion, because “the cache was newer”. But that’s
8 >>> okay. I actually like this, as this will prevent me from chaning two repos
9 >>> in parallel which would make them incompatible.
10 >>>
11 >> Keep in  mind that both repos have the same ID - you should also rsync
12 >> the cache and security directories as well as they are now out of sync
13 >> (hence the warning).
14 > That thought crossed my mind recently but I was unsure how to store the
15 > cache. But since the repo is a monolith, it should suffice to rsync
16 > the whole cache directory to the backup drive (or do it as a tar).
17 >
18 > The only problem is the temporal sequence:
19 > 1. Host A runs borg and gets a current cache.
20 > 2. Host B runs borg on the same repo and gets a current cache.
21 > 2a. Host A now has an outdated cache.
22 >
23 > Usually, Host B uses Host A via ssh as remote location of the repository.
24 > So I could simply run a borg command on Host A to update the cache somehow.
25 >
26 >> Be very careful on how you do this - you are one step away from losing the
27 >> while repo if the cache gets out of sync.  The docs warn against rsyncing
28 >> two repos and then using them at the same time for a good reason.
29 > I won’t use them at the same time. It will always be one direction:
30 > Hosts --[borg]--> Main backup drive --[rsync]--> secondary backup drive
31 >
32 You could delete and rebuild the cache each time (or I think there is a
33 way to do without it).  There are quite a few threads on the borg lists
34 about this in the past (usually people trying to recover trashed repos)
35 - you might ask there if there is a way to deal with changing the ID now?
36
37 In any case, I think doing it the way you are has a fairly high chance
38 you will irretrievably trash both repos.
39
40 BillK

Replies