paperlined.org
apps > drbd
document updated 13 years ago, on Apr 28, 2011
If you initialize both disks to zero (using dd if=/dev/zero), it STILL takes forever to do the initial sync.

It's far faster to do something akin to truck-based synchronization, but don't actually synchronize if you know both disks are definitely all-zeros.

One problem though: the disk isn't literally all-zeros. For truck-based authentication to work, it has to have the metadata too. If you're using internal metadata, you have to make sure that's copied across.

Copying the internal metadata

Do this on both nodes!



# drbdadm -- 6::::1 set-gi resource
# drbdadm up resource
# drbdadm down resource
# drbdadm dump-md resource > /tmp/md.txt
# sed -i -r -e 's/0xF{16}/0x0000000000000000/g' /tmp/md.txt

Important. You need to know EXACTLY how to reload the meta information. To do that, run:
# drbdadm -d dump-md <resource>

Copy the output. It should look something like : drbdmeta /dev/drbd0 v08 /dev/sda1 internal dump-md
Modify it to look like:
# drbdmeta /dev/drbd0 v08 /dev/sda1 internal restore-md /tmp/md.txt

Run this on both nodes!
# drbdadm up resource

Done! It should not ask for full-resync unless you invalidate the device.



If you wish to double-check that the above worked, use:
# drdbadm verify resource
and watch /proc/drbd for the status