HP-UX HB v13.00 Ch-13 - LVM
HP-UX Handbook – Rev 13.00 Page 14 (of 110)
Chapter 13 LVM
October 29, 2013
How the size of the VGRA is calculated
The VGRA size of any non-bootable disk must fit into the size of a single PE. For a
bootable disk the VGRA needs to start at offset 2144K while user data always starts at
offset 2912K. Due to these constraints the maximum VGRA size of bootable disks is
even more restricted as for regular disks.
However, it is good to know how the size of the VGRA depends on the VG’s
configuration at creation time. The folowing set or formulas calculates vgra_len in KB.
vgda_len = (ROUNDUP (16 * max_lv, 1024) +
(max_pv * ROUNDUP (16 + 4 * max_pe, 1024)) ) / 1024 + 2;
vgsa_len = ROUNDUP (36 + 12 * ROUNDUP (max_pv, 32) +
ROUNDUP(max_pe,8) * max_pv / 8, 1024) / 1024;
mcr_len = 8;
vgra_len = 2 * (ROUNDUP (vgda_len + vgsa_len, 8) + mcr_len);
The ROUNDUP() function used above rounds up arg1 to a multiple of arg2.
Calculating an optimal extent size for a version 1.0 volume
group.
Sometimes when creating a volume group (VG), the vgcreate(1M) command may abort
with a message that extent size is too small (too big error or with newer patches a more
informative error explaining that the VGRA is too big). In this situation the user is
expected to increase the extent size and re-issue the vgcreate(1M) command.
Increasing the extent size increases the data area marked stale when a write to a
mirrored logical volume fails and that can increase the time required for re-
synchronizing the stale data. Also, more space than intended may be allocated to the
logical volume since 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 given 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 VG with bootable PVs, the metadata must fit within 768 Kbytes. Therefore, a
vgcreate(1M) command with a set of values for MAXLVs, MAXPVs and MAXPXs that
succeed on a VG without bootable PVs, may fail on a VG with bootable PVs. In this