
C Volume Group Provisioning Tips
This appendix contains recommendations for parameters to use when creating your volume groups.
Choosing an Optimal Extent Size for a Version 1.0 Volume Group
When creating a Version 1.0 volume group, the
vgcreate
command may fail and display a
message that the extent size is too small or that the VGRA is too big. In this situation, you must
choose a larger extent size and run
vgcreate
again.
Increasing the extent size increases the data area marked stale when a write to a mirrored logical
volume fails. That can increase the time required to resynchronize stale data. Also, more space
may be allocated to each logical volume because the space is allocated in units of extent size.
Therefore, the optimal extent size is the smallest value that can be used to successfully create the
volume group with the desired configuration parameters.
The minimum extent size for a volume group is calculated using the maximum number of logical
volumes (MAXLVs) and physical volumes (MAXPVs) in the volume group and the maximum number
of physical extents (MAXPXs) per each physical volume.
For a volume group with bootable physical volumes, the metadata must fit within 768 KB. Therefore,
running
vgcreate
with a set of values for MAXLVs, MAXPVs and MAXPXs that succeed on a
volume group without bootable physical volumes may fail on a volume group with bootable physical
volumes. In this situation, if you must add a bootable physical volume to a volume group, recreate
the volume group by giving lesser values for these arguments. By far the biggest factor in the size
of the metadata is the values for MAXPVs and MAXPXs. Alternatively, convert the bootable physical
volume to a normal physical volume by running
pvcreate
on that physical volume without the
–B
option and then adding it to the volume group. For a physical volume that is already part of a
volume group, you can use
vgmodify
to change a physical volume from a bootable to a normal
physical volume.
Sample Shell Script
The following shell script creates and compiles a small program that displays the minimum extent
size for a given volume group:
#!/usr/bin/sh
cat << EOF > vgrasize.c
#include <stdio.h>
#define BS 1024 /* Device block Size */
#define roundup(val, rnd) (((val + rnd - 1) / rnd) * rnd)
main(int argc, char *argv[])
{
int i, length, lvs, pvs, pxs;
if (argc != 4) {
/* Usage example:
* Maximum LVs in the VG = 255
* Maximum PVs in the VG = 16
* Maximum extents per PV = 2500
*
* $ vgrasize 255 16 2500
*/
printf("USAGE: %s MAXLVs MAXPVs MAXPXs\n", argv[0]);
exit(1);
}
lvs = atoi(argv[1]);
pvs = atoi(argv[2]);
pxs = atoi(argv[3]);
length = 16 + 2 * roundup(2 +
(roundup(36 + ((3 * roundup(pvs, 32)) / 8) +
(roundup(pxs, 8) / 8) * pvs, BS) +
Choosing an Optimal Extent Size for a Version 1.0 Volume Group
155