8.2. Allocate a Disk Volume for DRBD
DRBD will need its own block device on each node. This can be a physical disk partition or logical volume, of whatever size you need for your data. For this document, we will use a 512MiB logical volume, which is more than sufficient for a single HTML file and (later) GFS2 metadata.
[root@pcmk-1 ~]# vgdisplay | grep -e Name -e Free
VG Name centos_pcmk-1
Free PE / Size 255 / 1020.00 MiB
[root@pcmk-1 ~]# lvcreate --name drbd-demo --size 512M centos_pcmk-1
Logical volume "drbd-demo" created.
[root@pcmk-1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
drbd-demo centos_pcmk-1 -wi-a----- 512.00m
root centos_pcmk-1 -wi-ao---- 3.00g
swap centos_pcmk-1 -wi-ao---- 1.00g
Repeat for the second node, making sure to use the same size:
[root@pcmk-1 ~]# ssh pcmk-2 -- lvcreate --name drbd-demo --size 512M centos_pcmk-2
Logical volume "drbd-demo" created.