Operating System - HP-UX
1834751 Members
3141 Online
110070 Solutions
New Discussion

Re: vgreduce fails, physical extents still in use

 
Michael Denney
Valued Contributor

vgreduce fails, physical extents still in use

Hi,

Recently I used host based mirroring to move data from 1 san array to another. After the lvextend -m 1 some_lvol /dev/new_disk finished, I then did a lvreduce -m 0 some_lvol /dev/old_disk. Both of the steps completed, the system is now rrunning on this "mirror".

However, when I do the final step of vgreduce /dev/dsk/old_disk the vgreduce fails: Physical volume "/dev/dsk/c13t0d0" could not ve removed since some of its physical extents are in use.

So I do a "pvdisplay -v /dev/dsk/c13t0d0"

Here is snipet of ouptput of that pvdisplay:

--- Physical volumes ---
PV Name /dev/dsk/c13t0d0
VG Name /dev/vgs01
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 32
Total PE 35758
Free PE 32633
Allocated PE 3125
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On


--- Physical extents ---
PE Status LV LE
00000 current ??? 00000
00001 current ??? 00001
00002 current ??? 00002
00003 current ??? 00003
00004 current ??? 00004
00005 current ??? 00005
00006 current ??? 00006
00007 current ??? 00007
00008 current ??? 00008
00009 current ??? 00009
00010 current ??? 00010
00011 current ??? 00011
00012 current ??? 00012
00013 current ??? 00013
00014 current ??? 00014
00015 current ??? 00015
00016 current ??? 00016
00017 current ??? 00017



The extents show up as used "??" in the LV column. What does this mean? (lvdisplay -v of all lvols shows no reference to this c13t0d0 disk.




7 REPLIES 7
Kevin Wright
Honored Contributor

Re: vgreduce fails, physical extents still in use

find the key of the PV with lvdisplay -v -k /lvol
lvreduce -m 0 -k /lvol key

may want to do a vgscan after that, ensure /etc/lvmtab is correct.
Calandrello
Trusted Contributor

Re: vgreduce fails, physical extents still in use

Friend
this record belongs which VG?
Michael Denney
Valued Contributor

Re: vgreduce fails, physical extents still in use

The volume group is vgs01.

lvdisplay -k only shows references to the current in use disk. No reference to old disk in "lvdisplay -k" is found. Since no reference is found to old disk in lvdisplay, is there a use for doing a "lvreduce -m 0 -k" ?




Kevin Wright
Honored Contributor

Re: vgreduce fails, physical extents still in use

lvreduce -m 0 -k takes the KEY argument for the PV that you need to reduce, therefore if you cannot see the KEY from lvdisplay, you cannot run lvreduce -k

Not sure if this is prod-test, or sandbox, or what the problem could be, but a pvcreate -f may reset the LVM info that obviously is not consistent.

Evert Ladrak
Advisor

Re: vgreduce fails, physical extents still in use

Have you tried running

lvreduce -m 0 -k /dev/vgs01/lvolXXX /dev/dsk/c13t0d0

-ETL
Evert
Michael Denney
Valued Contributor

Re: vgreduce fails, physical extents still in use

lvreduce -k did not work. All logical vols in vgs91 are not mirrored.
Michael Denney
Valued Contributor

Re: vgreduce fails, physical extents still in use

Solution found in itrc knowledge database. At one time, a logical volume was not removed correctly in this volume group. Someone deleted the logical volume device files by hand instead of using lvremove.

To fix, re-create the block lvol and character rlvol device files, then do a lvremove of the "phantom" lvol.

example:

ll /dev/vgs01 (find gaps in the minor numbers of the device files. create device files to fill in any gaps)

mknod /dev/vgs01/lv_test b 64 0x05000a
mknod /dev/vgs01/rlv_test c 64 0x05000a

If pvdisplay now shows the extents owned by lv_test, you found the right device minor number. Otherwise, keep creating lvol device files until you find the right minor number to use.

lvremove /dev/vgs01/lv_test

At this point, can vgreduce the disk from the vg.