In order to create a GFS filesystem on your dual-primary DRBD resource, you must first initialize it as a Logical Volume for LVM.
Contrary to conventional, non-cluster-aware LVM configurations, the following steps must be completed on only one node due to the cluster-aware nature of CLVM:
pvcreate /dev/drbd/by-res/resourcePhysical volume "/dev/drbdnum" successfully createdvgcreatevg-name/dev/drbd/by-res/resourceVolume group "vg-name" successfully createdlvcreate --sizesize--namelv-namevg-nameLogical volume "lv-name" created
CLVM will immediately notify the peer node of these changes; issuing lvs (or lvdisplay) on the peer node will list the newly created logical volume.
Now, you may proceed by creating the actual filesystem:
mkfs -t gfs -p lock_dlm -j 2 /dev/vg-name/lv-nameOr, for a GFS2 filesystem:
mkfs -t gfs2 -p lock_dlm -j 2 -t cluster:name /dev/vg-name/lv-nameThe -j option in this command refers to the
number of journals to keep for GFS. This must be identical to
the number of nodes in the GFS cluster; since DRBD does not
support more than two nodes, the value to set here is always
2.
The -t option, applicable only for GFS2
filesystems, defines the lock table name. This follows the
format
cluster:name,
where cluster must match your cluster
name as defined in
/etc/cluster/cluster.conf. Thus, only
members of that cluster will be permitted to use the filesystem.
By contrast, name is an arbitrary
file system name unique in the cluster.