[ClusterLabs] Removing DRBD w/out Data Loss?

Lars Ellenberg lars.ellenberg at linbit.com
Thu Sep 10 07:31:06 EDT 2020


On Tue, Sep 08, 2020 at 02:33:37PM +0000, Eric Robinson wrote:
> I checked the DRBD manual for this, but didn't see an answer. We need
> to convert a DRBD cluster node into standalone server and remove DRBD
> without losing the data. Is that possible? I asked on the DRBD list
> but it didn't get much of a response.
> 
> Given:
> 
> The backing device is logical volume: /dev/vg1/lv1
> 
> The drbd volume is: drbd0
> 
> The filesystem is ext4 on /dev/drbd0
> 
> Since the filesystem is built on /dev/drbd0, not on /dev/vg1/lv1, if we remove drbd from the stack, how do we get access the data?

As long as we still have a "full copy" of all data on each node
[okay, not on "diskless clients", obviously],
you can just pretend DRBD was not there, and mount directly: DRBD is
"transparent", and just for "internal metadata" reserves some blocks at
the very end of your backing device.

"transparent" was an intentional design choice, so you can easily add
DRBD to an existing non-replicated data set, once you recognize that you
want that.

[That will change when we introduce the "erasure coding" data layouts,
where we do no longer have a full copy of the data on each node,
but need several (but not all) nodes to reconstruct the full data set]

Some libblkid (what is used by mount to "guess" the file system type)
versions know how to recognize DRBD meta data, would "guess" a file
system type of "drbd" (for "internal" drbd meta data), and fail.

But you can explicitly specify the file system type:
"mount -t ext4 /dev/vg/lv /mnt/point"

You could also remove the DRBD meta data magic,
drbdmeta wipe-md should do it, or wipefs to just remove the DRBD
specific "magic" used by libblkid to identify it.


The "without Data Loss" part depends on whether the local copy was
"Consistent" (or better yet: UpToDate) before you decided to remove DRBD.

-- 
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker
: R&D, Integration, Ops, Consulting, Support

DRBD® and LINBIT® are registered trademarks of LINBIT


More information about the Users mailing list