1833777 Members
2064 Online
110063 Solutions
New Discussion

vgreduce problem

 
sheevm
Regular Advisor

vgreduce problem

I want to reduce one of the disks from the vg00. I cannot reduce it says it has some data in the disk. When I do pvdisplay on that disk I do see some of the extent are used. But I do not need this data. I tried to go to lvm maint mode but my system crashes when I tried to boot it on lvm maint mode.

Is there any other way to remove this disk from the volume group?

Thanks
be good and do good
10 REPLIES 10
pap
Respected Contributor

Re: vgreduce problem

Hi Raji,

You can do following things to solve your problem.

1. Identify the disk which you want to remove from volume group.

2. FInd out which logical volume resides in that disk.
You can do vgdisplay -v /dev/vgXX that will give you the name of Logical volume residing on the disk unser consideration.

3. remove all the LVs from the disk using lv remove.
Before doing so, please make sure that those LV you do not need.

Once all LVs have been removed from that disk, you can do vgreduce /dev/vgXX /dev/dsk/cAtBdC......

you are all set now.

let me know if you have any questions.

-pap
"Winners don't do different things , they do things differently"
Helen French
Honored Contributor

Re: vgreduce problem

Hi Raji:

You don't need to boot in LVM maintenance mode for reducing a VG, unless something related to root filesystems.

Before removing the PV, you have to remove or reduce the file systems from that. check it with:

# pvdisplay -v /dev/dsk/cxtydz

Remove those LVs, if not needed and then do a vgreduce. You have to unmount the file systems first.

HTH,
Shiju
Life is a promise, fulfill it!
MANOJ SRIVASTAVA
Honored Contributor

Re: vgreduce problem

Hi Raji

1. Do a vgdisplay -v to find the status of the disk you wnat to remove in terms of lvols .

2. Remove the logical volumes .

3. vgreduce the volume group.


Manoj Srivastava
Jeff Schussele
Honored Contributor

Re: vgreduce problem

Raji,

Be careful when reducing out of vg00 - you don't want to reduce out any of the disks containing boot or swap info. You really don't want to lose /var or /usr either.
definitely do the vgdisplay -v & determine just WHAT exactly you're reducing out BEFORE you go too far.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
sheevm
Regular Advisor

Re: vgreduce problem

How can I do the lvremove on the disk.

/dev/vg00/lvol6 is currently used. But /dev/vg00/lvol6 on the disk I want to get rid of is part of the mirror I forgot to reduce.

Thanks

be good and do good
Christopher McCray_1
Honored Contributor

Re: vgreduce problem

Hello,

To remove the mirror:

# lvreduce -m 0 /dev/vg00/lvol6 /dev/dsk/c#t#d# (the disk you want to reduce)

Hope this helps

Chris
It wasn't me!!!!
Helen French
Honored Contributor

Re: vgreduce problem

Hi Raji:

Try this:

# lvreduce -m 0 /dev/vg00/lvol6 PV_path
# pvdisplay -v PV_path

If there is no other FS on this disk, then:

# vgreduce /dev/vg00 PV_path

HTH,
Shiju
Life is a promise, fulfill it!
sheevm
Regular Advisor

Re: vgreduce problem

Shiju:

I cannot lvreduce -m 0 on that disk because it says no mirror copies.

This the procedure I did:

lvextend -m 1/dev/vg00/lvol6 /dev/dsk/c3t2d0
(mirrored fine because I had room for lvol6)

But my original lvol6 spanned across two disks.

When I reduced it

I said

lvreduce -m 0 /dev/dsk/old1

I should have said

lvreduce -m 0 disk1 disk2

Now disk2 has /dev/vg00/lvol6 on some of the extents.




The problem is when I first reduced this /dev/vg00/lvol6 I should have give two disks(because lvol6 spanned on two disks)



instead I only gave one disk
be good and do good
Helen French
Honored Contributor

Re: vgreduce problem

Hi Raji:

In this situation, If you have a good backup of vg00/lvol6, then I would remove this entire LV and recreate it on the new disk, then restore it from backup. This may save a lot of your time.

However, as it is saying there is no mirror copies now. Confirm it with:

# lvdisplay -v /dev/vg00/lvol6 ( check for mirror copies)

HTH,
Shiju
Life is a promise, fulfill it!
Tom Danzig
Honored Contributor

Re: vgreduce problem

You can use pvmove to move the physical extends of this lvol to another disk. See man pvmove.