Managing HP Serviceguard A.11.20.10 for Linux, December 2012

5.1.12.5 Building Volume Groups and Logical Volumes
1. Use Logical Volume Manager (LVM) to create volume groups that can be activated by
Serviceguard packages.
For an example showing volume-group creation on LUNs, see “Building Volume Groups:
Example for Smart Array Cluster Storage (MSA 2000 Series)” (page 143). (For Fibre Channel
storage you would use device-file names such as those used in the section “Creating Partitions
(page 140)).
2. On Linux distributions that support it, enable activation protection for volume groups. See
“Enabling Volume Group Activation Protection” (page 142).
3. To store data on these volume groups you must create logical volumes. The following creates
a 500 Megabyte logical volume named /dev/vgpkgA/lvol1 and a one Gigabyte logical
volume named /dev/vgpkgA/lvol2 in volume group vgpkgA:
lvcreate -L 500M vgpkgA
lvcreate -L 1G vgpkgA
4. Create a file system on one of these logical volumes, and mount it in a newly created directory:
mke2fs -j /dev/vgpkgA/lvol1
mkdir /extra
mount -t ext3 /dev/vgpkgA/lvol1 /extra
NOTE: For information about supported filesystem types, see the fs_type discussion on
(page 182).
5. To test that the file system /extra was created correctly and with high availability, you can
create a file on it, and read it.
echo "Test of LVM" >> /extra/LVM-test.conf
cat /extra/LVM-test.conf
NOTE: Be careful if you use YAST or YAST2 to configure volume groups, as that may cause
all volume groups on that system to be activated. After running YAST or YAST2, check to
make sure that volume groups for Serviceguard packages not currently running have not been
activated, and use LVM commands to deactivate any that have. For example, use the command
vgchange -a n /dev/sgvg00 to deactivate the volume group sgvg00.
5.1.12.6 Distributing the Shared Configuration to all Nodes
The goal in setting up a logical volume infrastructure is to build a set of volume groups that can
be activated on multiple nodes in the cluster. To do this, you need to build the same LVM volume
groups on any nodes that will be running the same package.
NOTE: The minor numbers used by the LVM volume groups must be the same on all cluster nodes.
They will if all the nodes have the same number of unshared volume groups.
To distribute the shared configuration, follow these steps:
1. Unmount and deactivate the volume group, and remove the tag if necessary. For example, to
deactivate only vgpkgA:
umount /extra
vgchange -a n vgpkgA
vgchange --deltag $(uname -n) vgpkgA
144 Building an HA Cluster Configuration