[DRBD-user] drbdadm attach - how to allow non-exclusive access ?

Lars Ellenberg lars.ellenberg at linbit.com
Thu Aug 26 15:30:37 CEST 2021


On Mon, Aug 16, 2021 at 07:07:41AM +0100, TJ wrote:
> I've got a rather unique scenario and need to allow non-exclusive
> read-only opening of the drbd device on the Secondary.

> Then I thought to use a device-mapper COW snapshot - so the underlying
> drbd device is never changed but the snapshot can be mounted at
> /srv/tftp and any local changes won't affect the Primary.
> 
> Snapshot works great.

Assuming

DBRD (Secondary) <-> ...
LV

You of course can do a lvcreate --snapshot of LV,
and access that snapshot (RW, or RO, does not matter),
while still being able to attach DRBD to the "origin" LV.

What I suspect happened is: you "kpartx"d the LV,
and that kept the LV open, so DRBD would refuse to attach.

What I suggest you do:
take that snpshot below DRBD,
kpartx and cryptsetup the snapshot (to find your .../boot/)

but make sure to not open or kpartx the origin LV.

    Lars



More information about the drbd-user mailing list