HP-UX HB v13.00 Ch-13 - LVM
HP-UX Handbook – Rev 13.00 Page 50 (of 110)
Chapter 13 LVM
October 29, 2013
secondary one, to the same single underlying PV - this means that a PV is effectively
included twice within the same VG, even though there is only one copy of the data
visible to LVM (the disk array "hides" any additional copy or data protection).
However, when LVs are set up using the "-D" option of lvcreate, it is compulsory for
them to be configured as "Group strict", in case Mirrordisk will be used as well. This
means that it is also compulsory to have at least one PVG (and usually ONE is the
correct number of PVGs to have in this case - having more than one may prevent an LV
being striped in the manner desired) in the relevant VG. The mechanism by which
lvcreate chooses which disks in which PVGs should have extents of a Logical Volume
when it is created does not appear to be documented - however it is clear that should a
mirror copy of the LV be created subsequently, then it will have its extents allocated on
different PVGs, if this is possible; if it is not, then the mirror copy cannot be created.
When lvcreate is used to create an extent-striped LV, it should be assumed that it will
place it in the first PVG in the VG with adequate space - it is not possible to specify a
PVG when using lvcreate. However the lvextend command does allow a PVG to be
specified, so if there is more than one PVG in a VG, it may be worth using lvcreate to
create the LV with no space allocated, and then using lvextend to allocate the storage in
the desired PVG.
At the time that an LV is created or extended, the PVG that it is in will determine which
disks are used to spread its extents across, though there is some flexibility - for instance
if one disk in the PVG is full, it will not be used, but as long as two disks have space,
then extents can continue to be created.
A common, and effective, method used to distribute extents across PVs in a cached
disk array, when there is no need for Mirrordisk replication, is as follows:
- Set up a single PVG for the entire VG. This means that when a striped LV is created,
it will use all the PVs in the VG, as will normally be desired.
- The Alternate links may also be in the PVG, though this is not essential.
- Allocate the PVs to the VG and PVG in the sequence that access is desired - for
instance, if two I/O channels are to be used, then alternate PVs across them (the
Alternate links will of course "alternate in the opposite sequence").
- To get this right, either: Create the VG without specifying PVGs, but making sure to
add all the alternate links, then create /etc/lvmpvg manually (perhaps using
vgdisplay , then check with vgdisplay, then create LVs.
Or, create the VG using the "-g pvgname" option on the vgcreate and vgextend
commands, taking care to specify all PVs in the desired access sequence.