For the purposes of this recipe, we will assume that the /dev/sdb device has been dedicated to PostgreSQL use. Follow these steps as the root user on two servers to create the first LVM layer:
- Create and verify a single LVM partition on the device with these commands:
parted /dev/sdb mklabel gpt parted /dev/sdb mkpart primary 1 100% parted /dev/sdb set 1 lvm on parted /dev/sdb print
- Register /dev/sdb as an LVM physical device with this command:
pvcreate /dev/sdb1
- Create a single volume group to contain /dev/sdb1 with this command:
vgcreate VG_DRBD /dev/sdb1
- Create a single logical volume as 100% of the outer volume group with this command:
lvcreate -n LV_DATA -l 100%VG VG_DRBD
- Verify that the new volume exists ...