1825001 Members
2483 Online
109678 Solutions
New Discussion юеВ

Re: "vgreduce" command

 
Nimesh
Frequent Advisor

"vgreduce" command

Hi,

Basically we have 2 disks that were mirrored with MirrorUX (vgextend + lvextend). To break mirror, lvreduce but cnan not use Vgreduce.

Can any one please provide more help on "vgreduce" command.

Thanks,
Nimesh
6 REPLIES 6
Santosh Nair_1
Honored Contributor

Re: "vgreduce" command

First make sure that there are no LVs on the PV (pvdisplay -v PVNAME), then you should be able to a vgreduce VGNAME PVNAME to remove the disk from the VG.

-Santosh
Life is what's happening while you're busy making other plans
James R. Ferguson
Acclaimed Contributor

Re: "vgreduce" command

Hi:

What steps have you taken thus far, and what error(s) are you seeing?

# lvreduce -m 0 /dev/vgXX/lvolY /dev/dsk/cXtYdZ

...will remove mirrored extents on the disk of the logical volume specified.

# vgreduce /dev/vgXX /dev/dsk/cXtYdZ will eliminate the physical disk specified from the volume group.

Regards!

...JRf...
Thierry Poels_1
Honored Contributor

Re: "vgreduce" command

hi,

"lvreduce" is used to decrease the number of mirrors of a LVOL.
"vgreduce" is used to remove unused disks from a Volume Group.

so after "lvreduce -m 0 /dev/vg01/lvol1" etc, you should check if the disk is unused: "vgdisplay -v /dev/vg01" (or with pvdisplay).
"vgreduce /dev/vg01" will remove unused disk from your VG. "vgreduce /de/vg01 /dev/dsk/cxtxdx" will remove the specified disk.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Uday_S_Ankolekar
Honored Contributor

Re: "vgreduce" command


Hi,

First use lvreduce break mirror then use vgreduce
lvreduce -m 0 /dev/vg00/lvoln /dev/dsk/cXtYdZ

vgreduce /dev/vg00 /dev/dsk/cXtYdZ

Use vgdisplay -v /dev/vgnn and lvdisplay -v /dev/vgnn/lvolnn for details of the disks and other important informations

Good Luck

-USA..
Good Luck..
Michael Tully
Honored Contributor

Re: "vgreduce" command

Hi,

Firstly you must make sure that there are no
logical volumes in that group any more that
are on that disk.

# pvdisplay -v /dev/dsk/cXtXdX

If there are you need to remove them using
the lvreduce command prior to using vgreduce.

To remove all mirrors out of your volume group
you could do this.

# for i in /dev/vgxx/lv*
> do
> echo $i
> lvreduce -m 0 $i
> done
Check again that there no logical volumes on
the disk by running the pvdisplay command again,
the run you vgreduce
# vgreduce /dev/vgxx /dev/dsk/cxtxdx

HTH
-Michael
Anyone for a Mutiny ?
Bill McNAMARA_1
Honored Contributor

Re: "vgreduce" command

you should ensure that there is no extents of the pv you are trying to remove occupied. That generally is the only reason vgreduce will fail.

strings /etc/lvmtab

to find pv to vg grouping

pvdisplay /dev/dsk/cXtYd0

to ensure no Allocated PE for that PV. (you can use a -v if you like to find out which is occupied)


Later,
Bill
It works for me (tm)