Operating System - HP-UX
1753424 Members
4694 Online
108793 Solutions
New Discussion юеВ

LVM: Remove disk from volume group

 
Zenith Tang
Occasional Contributor

LVM: Remove disk from volume group

The system has a volume group (17G) that is combined from two disks. The disk has 2G and 15G respectively. These two disks are also have data and are using in the volume group. I want to remove the 2G disk from the volume group by executing the vgreduce command. Does it has any data lost after I remove the 2G disk from volume group? Does the vgreduce command able to preserve all data from the 2G disk to 15G disk?

3 REPLIES 3
Rajeev  Shukla
Honored Contributor

Re: LVM: Remove disk from volume group

No vgreduce will not preserve any data. What you have to do is first move the data from the 2GB disk to 15GB disk if it has room for it and then do vgreduce.
1. do a pvdisplay of both the disks and see it 15GB disk has free extents to accomodate the used extents of 2GB disk
2. If it has then run pvmove for each LV that is on 2GB disk and move it to 15GB disk
3. Then do vgreduce and remove the 2GB disk
Albert_31
Trusted Contributor

Re: LVM: Remove disk from volume group

Hello Tang,

Actually if there are some logical volume configured on the 2GB disk, the vgreduce will not work, it will complain about the lvols being configured.

# pvdisplay -v /dev/dsk/ | more

will tell which all lvols have their data on this disk, based on this, you can decide how to go about.

If there is data on this disk, then it has to be moved to another location, though there are commands like pvmove, i wouldnt advice on it.. try to create teh new lv on the 15GB and copy the data..something simpler though it consumes time.
Zenith Tang
Occasional Contributor

Re: LVM: Remove disk from volume group

The pvmove method is not work, as I checked the free extents is not enough in the 15G disk. I decided to use lvreduce to resize the volume group, as my main purpose is to use these free space in other volume group. Thanks for all of you.