HP-UX System Administrator's Guide: Logical Volume Management HP-UX 11i v3 (B3921-90053 September 2011) Transform used: ESS version 2.2

The physical volume key of a disk indicates its order in the volume group. The first physical volume
has the key 0, the second has the key 1, and so on. This need not be the order of appearance in
/etc/lvmtab file although it is usually the case, at least when a volume group is initially created.
You can use the physical volume key to address a physical volume that is not attached to the volume
group. This usually happens if it was not accessible during activation, for example, because of a
hardware or configuration problem. You can obtain the key using lvdisplay with the k option
as follows:
# lvdisplay -v k /dev/vg00/lvol1
--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 0 00000 stale 1 00000 current
00001 0 00001 stale 1 00001 current
00002 0 00002 stale 1 00002 current
00003 0 00003 stale 1 00003 current
00004 0 00004 stale 1 00004 current
00005 0 00005 stale 1 00005 current
Compare this output with the output of lvdisplay without k, that was used to check the mirror
status. The column that contained the failing disk (or ???) now holds the key. For this example,
the key is 0. Use this key with lvreduce. For example, if you have a single mirror copy:
# lvreduce -m 0 -A n k /dev/vgname/lvname key
Or, if you have two mirror copies:
# lvreduce -m 1 -A n k /dev/vgname/lvname key
Moving the Physical Extents to Another Disk
If the disk is partially available and you can still read from it, you can move the data onto another
disk by moving the physical extents onto another disk. The pvmove command moves logical
volumes or certain extents of a logical volume from one physical volume to another. It is typically
used to free up a disk; that is, to move all data from that physical volume so it can be removed
from the volume group. In its simplest invocation, you specify the disk to free up, and LVM moves
all the physical extents on that disk to any other disks in the volume group, subject to any mirroring
allocation policies. For example:
# pvmove pvname
NOTE: The pvmove command will fail if the logical volume is striped.
The pvmove command provides many features to move data from a disk. See “Moving Data to a
Different Physical Volume” (page 73) for more information and pvmove examples. The pvmove(1M)
manpage describes all the command's features and options.
Removing the Disk from the Volume Group
After the disk no longer holds any logical extents, you can use the vgreduce command to remove
the physical volume from the volume group so it is not inadvertently used again. Check for alternate
links before removing the disk, since you must remove all the paths to a multipathed disk. Use the
pvdisplay command as follows:
# pvdisplay /dev/dsk/c0t5d0
--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Name /dev/dsk/c1t6d0 Alternate Link
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 4
Disk Troubleshooting and Recovery Procedures 127