1826703 Members
2517 Online
109696 Solutions
New Discussion

VGREDUCE PRoblem

 
SOLVED
Go to solution
Scott Dunkley
Regular Advisor

VGREDUCE PRoblem

Hi all,

we had a disk crash in our RAID array. the array needed rebuilding but I forgot to break some of the mirrors to another array and remove the physical disks from the VG.

So I have now realised my mistake and tried to vgreduce the VG to get the physical volumes out. In vgdisplay the volume in question is showing as unavailabe and has stale extents on it. What I need to do is get the PV out of the VG, pvcreate it and then add it back to the VG.

When I try an lvreduce -m 0 I get that the PV still has extents in use. So tried to vgreduce the Vg and got a message saying there was an IO error.

is there anyway to force remove the PV from the VG?
Better to regret something you have done, than something you havn't
6 REPLIES 6
Jeff Schussele
Honored Contributor

Re: VGREDUCE PRoblem

Hi Scott,

Force the vgreduce with -f

vgreduce -f /dev/vg_name

You do not need the PV as it will remove any/all missing PVs.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Patrick Wallek
Honored Contributor

Re: VGREDUCE PRoblem

Why remove it? That's going about it the hardware.

Just replace the bad disk with a new good one and do the following:

# vgcfgrestore -n /dev/vg?? /dev/rdsk/c?t?d?

# vgchange -a y vg??

# vgsync vg??


That's much easier than all the steps of manually rebuilding all of your mirrors on that disk.


Scott Dunkley
Regular Advisor

Re: VGREDUCE PRoblem

ok a bit more history as to why I ended up in this position:

We had a disk crash in our VA7110 and we dont use Hot spares, so we called in HP, the disk was pulled and then replaced. this was the wrong thing to do, the new disk should have been put in along side the crashed disk to allow the array to rebuild. It turns out we didnt have enough space in the array to do a rebuild. So they only way out was to completley rebuild the array, according to HP. We have now purchased hot spares for both arrays.

Hope that explains why we are doing it this way.

Tried a force on the vgreduce and got:

not all extents are free, please free the extents first using lvremove/reduce here is a list of the free extents.....

Any ideas?

Better to regret something you have done, than something you havn't
Robert-Jan Goossens
Honored Contributor
Solution

Re: VGREDUCE PRoblem

Hi Scott,

Check this doc.

http://www5.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063208748

Document description: LVM: splitting a stale mirror from a mirrored volume group
Document id: S3100003942

Regards,
Robert-Jan
Sridhar Bhaskarla
Honored Contributor

Re: VGREDUCE PRoblem

Hi Scott,

Unless you remove the disk from the definitions of the logical volumes, you will not be able to reduce the PV from the VG. There are two options. Easiest is to get the disk back, run 'vgcfgrestore' to only restore the LVM structures and reduce the mirrors. If you don't have that choice, you will need to use the painful and time taking process of reducing it through 'pvkey'. Find out all the LVs in that VG. Run 'lvdisplay -v -k /dev/vgxx/lvolx' and get the corresponding PV Key for the failed disk. Then run 'lvreduce -k -m 0 /dev/vgxx/lvolx ' to reduce the mirrors on the failed disk. Once it is done, you can be able to use 'vgreduce -f' to get rid of the failed disk.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Scott Dunkley
Regular Advisor

Re: VGREDUCE PRoblem

sorted it out, thanks guys. Not really sure what I done to correct it but eventually the disks came out of the VG ok.

Thanks.
Better to regret something you have done, than something you havn't