Operating System - HP-UX
1834757 Members
2893 Online
110070 Solutions
New Discussion

eliminate disk from volume group

 
SOLVED
Go to solution
Dave Chamberlin
Trusted Contributor

eliminate disk from volume group

Greetings. I have a volume group that formerly consisted of 2 2G drives that were mirrored. I reduced the mirror, eliminated the 2nd disk, then replaced it with a 9G disk. I must have made a mistake adding the second disk (probably in the lvextend) because the vgdisplay shows:
Total PE 2676
Alloc PE 2169
Free PE 507
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg01/u01
LV Status available/syncd
LV Size (Mbytes) 8676
Current LE 2169
Allocated PE 2169
Used PV 2


--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Status available
Total PE 507
Free PE 0

PV Name /dev/dsk/c1t8d0
PV Status available
Total PE 2169
Free PE 507

The first 2G is in use and 2G of the new disk is unused. I want to remove the old 2G disk from the vg. How should I do that at this point?
Thanks
7 REPLIES 7
Juan Manuel López
Valued Contributor

Re: eliminate disk from volume group

Hi.
You have to use " vgreduce " command to eliminate a disk out vg.

So, please, give me all the vgdisplay -v exit command and explain to me a little more your problem.

I will try to help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
S.K. Chan
Honored Contributor
Solution

Re: eliminate disk from volume group

You mean you want to get rid of c0t5d0 ? What you can do is use pvmove to move all the extents from c0t5d0 to c1t8d0 thus freeing up c0t5d0 for removal.
# pvmove -n /dev/vg01/u01 /dev/dsk/c0t5d0 /dev/dsk/c1t8d0
Check again with "vgdisplay". You should see c0t5d0 now has "Free PE=507".
Now vgreduce it ..
# vgreduce /dev/vg01 /dev/dsk/c0t5d0
Mladen Despic
Honored Contributor

Re: eliminate disk from volume group

Dave,

It appears that you might have increased the size of your /dev/vg01/u01, when in fact, you wanted to mirror it (otherwise, how could 8676 Mb fit on your old 2Gb-disk?).

Is there a file system on /dev/vg01/u01, or is it a raw lvol?
pap
Respected Contributor

Re: eliminate disk from volume group

HI,
You might need to do mirror the lvols from the first disk to second disk. Once all the logical volumes have been mirrored, you can reduce the mirror for first disk, vgreduce the first disk from the vg and then you can remove it from the system.

Hope this helps.

-pap
"Winners don't do different things , they do things differently"
Dave Chamberlin
Trusted Contributor

Re: eliminate disk from volume group

Thanks for the replies. I do want to get rid of c0t5d0. If I use pvmove do I have to do an extendfs first?
S.K. Chan
Honored Contributor

Re: eliminate disk from volume group

If the FS is not mounted (ie you've lvextended it but have not extendfs it yet) yet, then there is no need to run extendfs before running pvmove. Extendfs it after pvmove is done.
Even if you choose to extendfs it now as it is so that the FS catches up with the LV, pvmove can still be run afterwards. If you choose to do this then obviously there is no need to extendfs afterwards.
Basically either way it'll work, extendfs is only run once.
Deshpande Prashant
Honored Contributor

Re: eliminate disk from volume group

Hi
You will use lvextend and extendfs only if you need to use the additional 2GB free space on new 9GB disk.

Thanks.
Prashant.
Take it as it comes.