Cheat sheet for manually configuring DRBD disks

  1. Create a partition on each server:
    sudo lvcreate -m1 --nosync -L 4192m --name TunaData /dev/SalmonGuests
    sudo lvcreate -m1 --nosync -L 4192m --name TunaData /dev/grouper

Note that this is for a 4096M (4G) partition that will be copied.

  1. Add new resources to /etc/drbd.d/*.res, and copy it to each.
    resource tuna_r3 {
      on grouper {
        device    /dev/drbd3;
        disk      /dev/grouper/TunaData;
        address   ipv6 [2607:f0b0:f:9::10]:7791;
        meta-disk internal;
      on salmon  {
        device    /dev/drbd3;
        disk      /dev/SalmonGuests/TunaData;
        address   ipv6 [2607:f0b0:f:9::11]:7791;
        meta-disk internal;
  1. Reload DRBD on each:
    sudo /etc/init.d/drbd reload
  1. Create the meta-data on both systems:
    sudo drbdadm create-md tuna_r3
  1. Mark the resource as up:
    sudo drbdadm up tuna_r3
    sudo drbdadm primary tuna_r3 --force
  1. Copy the disk image in:
    someotherserver% sudo dd if=/dev/grouper/TunaData | pv | nc -l -p 9988
    nc -w 10 someotherserver 9988 | pv | sudo dd of=/dev/drbd/by-res/tuna_r3 conv=sparse