[DRBD-user] how to restore lvm snapshot?

Robert Altnoeder robert.altnoeder at linbit.com
Tue Jan 28 15:01:28 CET 2020


On 1/28/20 12:19 AM, Paul O'Rorke wrote:
>
> Having said that, I think others recommend stopping DRBD and restoring
> to the backing device, then forcing a sync with
>
> drbdadm secondary <resource>
> drbdadm connect --discard-my-data <resource>

--discard-my-data does not do anything in this situation, and you would
end up with corrupted data sooner or later.

For a cluster with nodes A, B, C, where A is the node where the snapshot
is restored to the backend device, a possible process is:
- on B, drbdadm disconnect resource
- on B, drbdadm invalidate resource
- on C, drbdadm disconenct resource
- on C, drbdadm invalidate resource
- on A, drbdadm detach resource
- on A, restore the snapshot to the backend device WITHOUT modifying
DRBD meta data
  If the volume has external meta data, restore only the volume
contents, but not the meta data volume
  If the volume has internal meta data, make sure the restore modifies
only the data region, but not the meta data region
- on A, drbdadm attach resource
- on B, drbdadm connect resource
- on C, drbdadm connect resource

B and C run a full-sync from A

Another possible process that is much easier for restoring the backend
device WITH DRBD meta data to a volume containing internal meta data is:
- on all nodes, drbdadm down resource
- on B, drbdadm create-md resource
- on C, drbdadm create-md resource
- on A, restore the snapshot to the backend device, including internal
DRBD meta data contained in the snapshot
- on all nodes, drbdadm up resource

Note that you must recreate meta data with the correct parameters
(commonly the same parameters that were used to create meta data on A)

B and C run a full-sync from A

br,
Robert



More information about the drbd-user mailing list