[DRBD-user] Initialize empty volume

dbarker dbarker at visioncomm.net
Fri Mar 12 22:07:42 CET 2010

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

I tried and failed many times to quickly create empty drbd disks. The best
instructions I found appeared to work, but at the final connect, the entire
volume (with no filesystem installed at all) resyncd. This occurred even
using the "Truck Based" instructions.

However, if I define a 1G disk, and let that sync (that happens quickly),
and then resize the disk to 200G (or whatever) using the process for Growing
Offline, it's nearly instant! Then, I define or expand the file system and

I must be doing something wrong with the  --clear-bitmap new-current-uuid,
but what I've found to work may be helpful to someone else. All the
instructions I found were very hazy on which commands occurred on which drbd
instance, and in what order. Also, there were missing steps or the
instructions didn't match 8.3.0.

Both drbd.8.3.0 instances are virtual machines running Debian 503 on ESXi
4u1. Each ESXi has two, local disks (besides the boot volume). iscsi-target
serves up both disks to either host. Both LUN are primary/primary on both
sides. Failover is not needed - if one drbd or disk or ESXi fails, I can add
to inventory, power on any affected vm using the other ESXi and plan my
recovery at my leisure.

Add a 1G disk, provisioned thin to each drbd vm, and synchronize normally.
My config is below. Note: Without the csums-alg statement, the target of the
sync grows to full size. With the csums-alg, the thin provisioning of my
disks is honored.

Example showing expanding r1 while impacting r0 for as little as possible.

Suspend any machines on r0 or r1

On both drbd vm:
  ietadm --op delete --tid=1 --lun=1
  drbdadm dump-md r1 > metadatar1
  resize disk using the VI Client

Power on any machines on r0

  edit la-size-sec to new total 
    (use cfdisk, u, and add the two numbers - 25G = 52419967, 100G =
  drbdadm create-md r1
  drbdmeta_cmd=$(drbdadm -d dump-md r1)
  ${drbdmeta_cmd/dump-md/restore-md} metadatar1
  drbdadm up r1
  drbdadm primary r1
  ietadm --op new --tid=1 --lun=1 --params

rescan using the VI Client
add new extent to datastore using the VI Client
(rescan on the other vm too)

Power on any machines on r1   


Dan Barker

global {
  usage-count yes;
common {
  protocol C;
  syncer {
   rate 25M;
   csums-alg md5;
  net { allow-two-primaries; }

resource r0 {
  startup { become-primary-on both; }
  device    /dev/drbd1;
  disk      /dev/sdb;
  meta-disk internal;
  on Storage00 {
  on Storage01 {

resource r1 {
  startup { become-primary-on both; }
  device    /dev/drbd2;
  disk      /dev/sdc;
  meta-disk internal;
  on Storage00 {
  on Storage01 {

Target iqn.2010-03.com.visioncomm.Storage00:Storage00
Lun 0 Path=/dev/drbd1,Type=blockio,ScsiSN=SPIDSK-090311-00
Lun 1 Path=/dev/drbd2,Type=blockio,ScsiSN=SPIDSK-090312-00
Alias iDISK0

View this message in context: http://old.nabble.com/Initialize-empty-volume-tp27882839p27882839.html
Sent from the DRBD - User mailing list archive at Nabble.com.

More information about the drbd-user mailing list