In order to prepare a DRBD resource for use as a Physical Volume, it is necessary to create a PV signature on the DRBD device. In order to do so, issue one of the following commands on the node where the resource is currently in the primary role:
Now, it is necessary to include this device in the list of
devices LVM scans for PV signatures. In order to do this, you
must edit the LVM configuration file, normally named
/etc/lvm/lvm.conf. Find the line in the
devices section that contains the
filter keyword and edit it accordingly. If
all your PVs are to be stored on DRBD
devices, the following is an appropriate
filter = [ "a|drbd.*|", "r|.*|" ]
This filter expression accepts PV signatures found on any DRBD devices, while rejecting (ignoring) all others.
By default, LVM scans all block devices found in
If you want to use stacked resources as LVM PVs, then you will need a more explicit filter configuration. You need to make sure that LVM detects PV signatures on stacked resources, while ignoring them on the corresponding lower-level resources and backing devices. This example assumes that your lower-level DRBD resources use device minors 0 through 9, whereas your stacked resources are using device minors from 10 upwards:
filter = [ "a|drbd1[0-9]|", "r|.*|" ]
This filter expression accepts PV signatures found only on the
/dev/drbd19, while rejecting (ignoring) all
You may of course use a different
configuration to match your particular system configuration.
What is important to remember, however, is that you need to
Accept (include) the DRBD devices you wish to use as PVs;
Reject (exclude) the corresponding lower-level devices, so as to avoid LVM finding duplicate PV signatures.
In addition, you should disable the LVM cache by setting:
write_cache_state = 0
disabling the LVM cache, make sure you remove any stale cache
entries by deleting
You must repeat the above steps on the peer node.
While it is possible to mix DRBD and non-DRBD Physical Volumes within the same Volume Group, doing so is not recommended and unlikely to be of any practical value.
 This is an emerging convention for stacked resources.