Operating System - HP-UX
1838661 Members
9256 Online
110128 Solutions
New Discussion

Re: Vgreduce problems, after reboot

 
SOLVED
Go to solution
likid0
Honored Contributor

Vgreduce problems, after reboot

Hy,

I have a 11.23 server with a mirror, I split the disks because I was going to patch, after the reboot, somehow I or another admin got to delete(duh!) the lvols device files, so now i have this situation:



vmf:/dev/vg00# vgdisplay -v vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 18
Open LV 9
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 5072
VGDA 4
PE Size (Mbytes) 16
Total PE 10134
Alloc PE 5970
Free PE 4164
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1

LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 256
Used PV 1

LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1

LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1

LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Size (Mbytes) 11952
Current LE 747
Allocated PE 747
Used PV 1

LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Size (Mbytes) 4032
Current LE 252
Allocated PE 252
Used PV 1

LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Size (Mbytes) 10240
Current LE 640
Allocated PE 640
Used PV 1

LV Name /dev/vg00/lvol8
LV Status available/syncd
LV Size (Mbytes) 7184
Current LE 449
Allocated PE 449
Used PV 1

LV Name /dev/vg00/lvol9
LV Status available/syncd
LV Size (Mbytes) 7184
Current LE 449
Allocated PE 449
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c0t2d0s2
PV Status available
Total PE 5062
Free PE 2077
Autoswitch On

PV Name /dev/dsk/c0t0d0s2
PV Status available
Total PE 5072
Free PE 2087
Autoswitch On


the disk that the devices lvolb deleted:

vmf:/dev/vg00# pvdisplay -v /dev/dsk/c0t2d0s2 | more
--- Physical volumes ---
PV Name /dev/dsk/c0t2d0s2
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 16
Total PE 5062
Free PE 2077
Allocated PE 2985
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
Standard input


but now i can't remove it,because it still has the pe in use.

vmf:/dev/vg00# vgreduce vg00 /dev/dsk/c0t2d0s2
vgreduce: Physical volume "/dev/dsk/c0t2d0s2" could not be removed since some of its
physical extents are still in use.


any idea?
Windows?, no thanks
13 REPLIES 13
OFC_EDM
Respected Contributor

Re: Vgreduce problems, after reboot

I think your lvols are still mirrored since they show as sync'd in your post.

Can you do an lvdisplay on the lvols and post?
The Devil is in the detail.
OFC_EDM
Respected Contributor

Re: Vgreduce problems, after reboot

I'm old school...This is for HP-UX 11i v1 but may offer help

Unmirror a logical volume: Do this before reducing the disk out of the VG.

lvreduce -m 0 /dev/[volume-group]/[logical-volume] /dev/dsk/[physical-volume]

Example:
lvreduce -m 0 /dev/vg01/lvsap /dev/dsk/c3t10d0
The Devil is in the detail.
OFC_EDM
Respected Contributor

Re: Vgreduce problems, after reboot

When you post the lvdisplay Use "lvdisplay -v"

Example

lvdisplay -v /dev/vg00/lvol1
The Devil is in the detail.
likid0
Honored Contributor

Re: Vgreduce problems, after reboot

lvdisplay from lvol9 for example:

vm:/root# lvdisplay -v /dev/vg00/lvol9
--- Logical volumes ---
LV Name /dev/vg00/lvol9
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 7184
Current LE 449
Allocated PE 449
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t0d0s2 449 449

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c0t0d0s2 02536 current
00001 /dev/dsk/c0t0d0s2 02537 current
00002 /dev/dsk/c0t0d0s2 02538 current
00003 /dev/dsk/c0t0d0s2 02539 current
Windows?, no thanks
likid0
Honored Contributor

Re: Vgreduce problems, after reboot

As you can see, the lvm doesn't now it has a mirror, but it thinks the disk still has pps in use
Windows?, no thanks
TwoProc
Honored Contributor

Re: Vgreduce problems, after reboot

Do you have a backup? Just recover those device files for the lvols from a backup...
We are the people our parents warned us about --Jimmy Buffett
sreekanthtm
Trusted Contributor

Re: Vgreduce problems, after reboot

# for i in `vgdisplay -v /dev/vg00| grep "LV Name" | awk {'print $NF'}`
do
lvdisplay -v $i | grep c0t2d0
done

Please post o/p of this script

This will show, weather /dev/dsk/c0t2d0 is used by any Logical Volume.
killer1
Advisor

Re: Vgreduce problems, after reboot

Hi there..

Please check with the following command , and let us know, whether did it help.

/usr/sbin/vgcfgrestore -n vg00 /dev/rdsk/c0t2d0s2

vgchange -a y vg00

Regards
likid0
Honored Contributor

Re: Vgreduce problems, after reboot

TwoProc , i thought about restoring the devices files, but because its the split of the mirror which are mising /dev/vg00/lvol9b, i don't have a backup, that would shorly get me going but I don't have a bakcup of the lvolb files



vmf:/root# for i in `vgdisplay -v /dev/vg00| grep "LV Name" | awk {'print $NF'}`
> do
> lvdisplay -v $i | grep c0t2d0
> done
vmf:/root#

there is nothing.


I have tried vgcfgrestore, but it doesn't help, the problem is I don't have the device files for lvols on disk /dev/dsk/c0t2d0s2.

I don't need them, but i can't delete them or vgreduce de disk.


Thnx!
Windows?, no thanks
killer1
Advisor

Re: Vgreduce problems, after reboot

Hi There

I believe you needed to mirror the lvols with the disk c0t2d0s2.

If nothing helps you, Please start from the scratch as follows.

1. Create PV

pvcreate -f -B /dev/rdsk/c0t2d0s2

2. Extend the VG.

vgextend vg00 /dev/dsk/c0t2d0s2

3. You may Mirror all Logical volumes , using the following command syntax

lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t2d0s2


Please let us know, whether it helps..

Regards.
TwoProc
Honored Contributor
Solution

Re: Vgreduce problems, after reboot

Well, how about this one...
If you look at the device numbers for lvols, they are quite simple. 0x000001 for lvol 1, 2 for lvol 2, etc. The only thing I don't know is what is different in the device file names for a split mirror... So...

Can you just go and split the mirror on another computer and observe how the lvols get split? Look at the device files that are there for the split up lvols. My guess is that the pattern is just as simple, and pretty much follows the form and pattern of the original (unsplit) special files.

What I'm saying is, that if you split a mirror elsewhere, and see how the system handles the lvol names, then by looking at the lvol names you've got for the unsplit lvol, you could probably create the missing devices files with mknod.
We are the people our parents warned us about --Jimmy Buffett
likid0
Honored Contributor

Re: Vgreduce problems, after reboot

Yep, that worked fine, i just mknoded following the the minor number order of the lvols i had working, and its working fine now:

vmf:/dev/vg00# mknod lvol1b b 64 0x010001
vmf:/dev/vg00# mknod rlvol1b c 64 0x010001
vmf:/dev/vg00# mknod lvol2b b 64 0x010002
vmf:/dev/vg00# mknod rlvol2b c 64 0x010002


LV Name /dev/vg00/lvol1b
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 64
Used PV 1

LV Name /dev/vg00/lvol2b
LV Status available/syncd
LV Size (Mbytes) 4096
Current LE 256
Allocated PE 256
Used PV 1


--- Physical volumes ---
PV Name /dev/dsk/c0t2d0s2
PV Status available
Total PE 5062
Free PE 2077
Autoswitch On

PV Name /dev/dsk/c0t0d0s2
PV Status available
Total PE 5072
Free PE 2087
Autoswitch On



thnx
Windows?, no thanks
likid0
Honored Contributor

Re: Vgreduce problems, after reboot

thnx
Windows?, no thanks