In these situations where the disk was not available at boot time, or the disk has failed before volume
group activation (pvdisplay failed), the lvreduce command fails with an error that it could not
query the physical volume. You can still remove the mirror copy, but you must specify the physical
volume key rather than the name.
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 like that, 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, which you 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 as follows:
# lvreduce -m 0 -A n –k /dev/vgname/lvname key (if you have a single mirror copy)
or:
# lvreduce -m 1 -A n –k /dev/vgname/lvname key (if you have two mirror copies)
Moving the Physical Extents to Another Disk
If the disk is marginal 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
The pvmove command will fail if the logical volume is striped.
Note: In the September 2008 release of HP-UX 11i v3, the pvmove command is enhanced with
several new features, including support for:
Moving a range of physical extents
Moving extents from the end of a physical volume
Moving extents to a specific location on the destination physical volume
Moving the physical extents from striped logical volumes and striped mirrored logical volumes
A new option, –p, to preview physical extent movement details without performing the move
Comentarios a estos manuales