1. Using GParted, we created a new partition with unknown file system type.
3. We loaded its kernel module, then backed up the drbd configuration file and created a new one on both servers.
4. We then initialized the meta data storage and started DRBD on both servers/nodes.
6. On server 2, we used cat /proc/drbd to see some progress on synchronization.
7. Then on server 1, we also used cat /proc/drbd. This was the output:
8. Also on server 1 (only), we created an ext4system filesystem and a directory (named data) then mounted the filesystem on that directory:
mkfs.ext4 /dev/drbd0
mkdir /data
mount /dev/drbd2/data
To checked if it was mounted, we used the command mount and df -h.
9. To test the configuration we made, we created files on the /data directory and checked if they were replicated to server 2.
10. We unmounted the /data directory on server1 then assigned the secondary role to it: drbdadm secondary r0.
11. We assigned the primary role to server 2: drbdadm primary r0 and checked the output of cat /proc/drbd to know if it was the primary server. Then a directory /data was created and /dev/drbd2 was mounted on it.
12. We checked the contents of the data directory. The files that we created on server 1 were there.
It took us almost three hours to do this exercise successfully. We repeated some steps more than once because of some errors that appeared. There were times that we needed to restart our computers. But all of our efforts paid off.
References:
http://www.howtoforge.com/setting-up-network-raid1-with-drbd-on-ubuntu-11.10







