[DRBD-user] Any way to jump over initial sync ?

Lars Ellenberg lars.ellenberg at linbit.com
Wed Aug 29 17:34:00 CEST 2018

On Wed, Aug 29, 2018 at 08:32:27AM -0400, David Bruzos wrote:

> * Typical way to skip the sync (at least this is my proven method):

Um, well, while it may be "your proven method" as well,
it actually is the method documented
in the drbdsetup man page and the User's Guide.
What did you think where the guys you copied it from found it?

>     # drbdadm create-md <resource>  -  (do this on both nodes)
>     # drbdadm up <resource>  -  (do this on both nodes)
>     # drbdadm -- --clear-bitmap new-current-uuid <resource>  -  (do this on secondary node)
>     # drbdadm primary <resource>  -  (do this on primary node)

The last two steps can be done on any node,
even on the same node.
Obviously, after "primary", that node will be Primary.

Don't forget to now do "mkfs"
or otherwise initilize the content of this DRBD volume.

>     # cat /proc/drbd  -  (Enjoy!)

Additional notes:

If you happen to have "huge" volumes,
and pre-existing data (so you must not skip the initial resync,
which would also skip replication of all the pre-existing data),
and you use a "fstrim" capable file system that is only partially used,
(and sufficiently recent kernel and DRBD),
you can speed up the initial resync by promoting and mounting the
pre-existing data, then fstrim on the mount point.

For "progress reports" during that fstrim,
you may want to look into fstrim options -v -o -l -m ...

If you are faced with "huge" amounts of pre-existing data
and an "unsatisfactory" replication link bandwidth,
you may want to look into the second typical use case of
"new-current-uuid", which we coined "truck based replication",
which is also documented in the drbdsetup man page.
(Or, do the initial sync with an "on-site" secondary,
then ship that secondary, or its disk(s) to the remote site).


: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker

DRBD® and LINBIT® are registered trademarks of LINBIT
please don't Cc me, but send to list -- I'm subscribed

More information about the drbd-user mailing list