1846205 Members
3982 Online
110255 Solutions
New Discussion

Re: remove VG

 
kholikt
Super Advisor

remove VG

Hi,

I need to remove one of the vg that is no longer in use. I have deleted all the LV. should I just vgremove /dev/myvg? Do I need to do a vgscan -v to update my lvmtab again.

I need to release the pv in /dev/myvg and use it to extend other vg. Should I do pvremove first and pvcreate again before I can do vgextend to the other vg?
abc
8 REPLIES 8
Joseph Loo
Honored Contributor

Re: remove VG

hi,

no need to vgscan but u may confirm it by referring to /etc/lvmtab if the vg is still there:

# strings /etc/lvmtab

perform "pvcreate -f" on the pv u like to vgextend. this will delete any file system still present.

regards.
what you do not see does not mean you should not believe
Denver Osborn
Honored Contributor

Re: remove VG

To remove the VG you need to remove the lvols, then remove all but one of the physical volumes from the vg using vgreduce. After there are no lvols and one pv left in the vg, you can do vgremove to remove the vg from the system.

You could then pvcreate the freed up pv's and use vgextend to add them to other volume groups.

You shouldn't need to run vgscan.

to sum it up...

lvremove
vgreduce
vgremove
pvcreate
vgextend

Hope this helps,
-denver
njia_1
Trusted Contributor

Re: remove VG

Hi

I always do a pvremove first before I use it again for another vg. Because if I see an error message I know it is being used by another vg. So I do not need to remember and double check if I pick up the correct one.

Do a pvremove and create new pv using pvcreate without -f option. That is my advice.

pvcreate -f works just fine.

thanks
Sivakumar TS
Honored Contributor

Re: remove VG

Hi Kholikt,

You can just do

#vgexport

to remove all reference to that vg from the system, including dev files.

Latter you can do

#pvcreate -f < the disks> , to the disks which are part of this vg now, to use for another vg.

With Regards,

Siva.
Nothing is Impossible !
Rick Garland
Honored Contributor

Re: remove VG

vgexport will remove the references to the VG.
After you remove the LVs with the lvremove command, you can use the vgexport command.

This will remove the /dev/, remove the reference in the lvmtab, no need to vgscan.

melvyn burnard
Honored Contributor

Re: remove VG

If you really no longer wish to use it, just vgexport the vg
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
so_2
Regular Advisor

Re: remove VG

you have to use vgreduce command to bring the volume group holding only one PV in it.
you could youse multiple PV arguments with vgreduse command for this.

you have to reduce alternate links also if any.

One you come to a position were only one PV is presrent in the VG , you could remove the VG using vgreomve command.

The best and recomended method for removing a vg is using a vgexport command which will remove all the entries about VG and PVs belonging to that VG from /etc/lvmtab.

shinoj
Devender Khatana
Honored Contributor

Re: remove VG

Hi,

You can remove vg through both methods. First is vgreduce and other is vgexport ? The second one is more appropriate and will require very less efforts.

In case of first you require to reduce VG to only one disk and this is applicable even if you have more than one link for one disk. But in the second case all the disks will be released even if your VG have 10 disks with 4 links each.

After removing the VG by either method you need to pvcreate it using -f option. This is requires as the charaterstics of the VG to which the disk/disks are being added now could be different.

Also do assign points to the responses to your threads. Your unassigned threads are listed here

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA610806&listType=unassigned&forumId=1

HTH,
Devender
Impossible itself mentions "I m possible"