You are not logged in.

#1 2017-08-30 15:35:56

UliSt
Member
Registered: 2017-08-30
Posts: 4

Unwanted realtime mirroring of a BTRFS bakup inside LUKS conainer

System Configuration:
According to the Arch Wiki
I created an encrypted system consisting of a Btrfs
filesystem, including a number of subvolumes on a dedicated drive partition
and all within a single LUKS Container.
For safety, I furthermore stored a copy of the
whole LUKS container on a smb network share, using the dd command and
finally re-mounted the ISO image as a loop device back to my
local filesystem.

Intention:
In this way I wanted to be able to keep the backup image up to date by using
the btrfs sent/receive commands.

Observation/Phenomenon:
But to my own surprise, this unfortunately does not seem to work.
The system behaves in such an unexpected way, that it always automatically
performs a kind of real time mirroring between the original and an the
mirror file system - similar to a kind of raid 1 behaviour.
As soon as I create or delete some file within one of the two systems,
the same change will be immediately be applied the other (orignial or backup)
system as well.
I had this observation on an Arch systen, last updated on Fri Aug 18th 2017.
I don't know whether the unwanted morroring will be triggered only 
by opening some folder or if it is a constant synchronisation process is being
carried out continuously in the background and all over the entire system.

Operational Impact:
Basically this behaviour would be fine, but I don't get any feedback
about the mirroring status from the system. So, I never know whether the
original is in sync with the backup or not. Also I cannot import any changes
reversely, from the backup onto the original, after some damage, while the
original had been disconnected from the backup image.

I would highly appreciate if somebody could at least give an explanation for
this phenomenon.

Many thanks in advance

Offline

#2 2017-08-30 16:11:59

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Unwanted realtime mirroring of a BTRFS bakup inside LUKS conainer

When you loop mount the backup image does it still have the same UUID and label as the native filesystem?

If so then I'd bet on this being the issue, you have no guarantee which drive is being accessed any time you make a request.
An extra layer of confusion is that btrfs uses identical UUIDs and labels on all members of a RAID set, you may be hitting an edge case in the btrfs code that causes it to believe that the drives should be a mirror - although this is just speculation.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-08-30 17:01:02

UliSt
Member
Registered: 2017-08-30
Posts: 4

Re: Unwanted realtime mirroring of a BTRFS bakup inside LUKS conainer

Yes, since ISO image is an exact replication of the native system, the UUIDs and Labels are identical
as well.
Thank you for your quick reply. This confirms my own suspicions
and therefore I now think it is worthwile to try
this approach as next.

Offline

Board footer

Powered by FluxBB