LVM and VxVM

Re: How find out the PVNUM of a PVlink in a VG ?

 
Jdamian
Respected Contributor

How find out the PVNUM of a PVlink in a VG ?

Hi

The command "lvdisplay -vk" shows the mapping of LEs onto the PEs, but the physical volumes are displayed using the PVnum.

lvdisplay(1M) man pages explain that the PVNUM should be displayed in the section of distribution of the logical volume:

PVNUM The Physical Volume Number in VG (if -k
option is specified).

But the output of "lvdisplay -vk" in my boxes don't show that column

How can I find out that PVnums ?
The disk list from the command "vgimport -p -f" is sorted using the PVnums ?

Thanx in advance
1 REPLY 1
whiteknight
Honored Contributor

Re: How find out the PVNUM of a PVlink in a VG ?

The pvnum is determined by the order the disk or pv(physical volume) was
added. The first pv will be pvnum 0 and the next is 1 and so forth. When a pv
is added it takes on the first available pvnum. For instance, if there were 4
pv's in a vg(volume group) and the second pv added (pvnum 1) was removed,
the next pv added would take pvnum 1. To view the pvnum, use the lvdisplay command
with the k option.

lvdisplay -vk /dev/vg00/lvol9

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c3t5d0 12 12

--- Logical extents ---
LE PV1 PE1 Status 1
00000 1 02045 current
00001 1 02046 current
00002 1 02047 current
00003 1 02048 current

This output shows that the pv, /dev/dsk/c3t5d0, is pvnum 1. By looking
under the PV1, this shows the pvnum.

A mirrored lv(logical volume) would look like the following:

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c2t3d0 8 8
/dev/dsk/c2t8d0 8 8

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 1 00000 current 2 00500 current
00001 1 00001 current 2 00501 current
00002 1 00002 current 2 00502 current
00003 1 00003 current 2 00503 current

This output shows that the first pv, /dev/dsk/c2t3d0, is pvnum 1 and the
second pv, /dev/dsk/c2t8d0 is pvnum 2.

Here is an example on how to change the pvnum of a pv.

If 3 pv's are in a vg having the device files of c1t6d0, c1t5d0, and
c1t4d0 and were added in that order, the pvnums would be:
pvnum 0 c1t6d0
pvnum 1 c1t5d0
pvnum 2 c1t4d0

To move c1t6d0 to pvnum 3, would require removing the pv from the vg,
adding another disk to take on the pvnum 0 slot, and then adding the
c1t6d0 pv back into the vg.

vgreduce /dev/vg01 /dev/dsk/c1t6d0
vgextend /dev/vg01 /dev/dsk/c3t3d0
vgextend /dev/vg01 /dev/dsk/c1t6d0
vgreduce /dev/vg01 /dev/dsk/c3t3d0


WK
Problem never ends, you must know how to fix it