Configure LVM for DRBD
- Edit the LVM Config File.
nano /etc/lvm/lvm.conf
- Add your block device to the LV Filter.
filter = [ “r|/dev/vd*|”, “r|/dev/zd*|”, “a|/dev/drbd*|” ]
Set the write cache state to 0, default is 1.
write_cache_state = 0
Remove the LVM Cache.
rm -f /etc/lvm/cache/.cache
After this you’ll want to create a Volume Group with the /dev/drbdX your
DRBD Setup generates and a Logical Volume inside it.
Output
$ vgcreate "{VOL_GRP_NAME}" "{DRBD_DEVICE_NAME}"
{vg_drbd0} {/dev/drbd0}
Volume group “{VOL_GRP_NAME}” successfully created
$ lvcreate -l "{SIZE IN GB HERE}" -n "{LOG_VOL_NAME}" "{VOL_GRP_NAME}"
{20} {drbdvol0} {vg_drbd0}
Logical Volume {LOG_VOL_NAME} created