Operating System - Linux
1753266 Members
5082 Online
108792 Solutions
New Discussion юеВ

Re: Delete vg on linux redhat

 
SOLVED
Go to solution
moumen
Occasional Contributor

Delete vg on linux redhat

Hi,
I wont to delete a vg from redhat, after doing vgexport the vg still exist :

[root@OTAUC4N1 ~]# vgdisplay -v vgORACLE
Using volume group(s) on command line
Finding volume group "vgORACLE"
Volume group vgORACLE is exported
--- Volume group ---
VG Name vgORACLE
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 41
VG Access read/write
VG Status exported/resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GB
PE Size 4.00 MB
Total PE 25599
Alloc PE / Size 0 / 0
Free PE / Size 25599 / 100.00 GB
VG UUID gNqnNV-8l1a-R5o8-Fwae-1OBG-QxDV-L1gMZu

Volume group vgORACLE is exported
--- Physical volumes ---
PV Name /dev/dm-5
PV UUID oawp5I-4cv5-0EyT-I00D-J110-qC8j-Qca4dh
PV Status allocatable
Total PE / Free PE 25599 / 25599





You can that the vg exist, with the additional line "Volume group vgORACLE is exported"

How to delete completly the vg
thanks
6 REPLIES 6
Matti_Kurkela
Honored Contributor

Re: Delete vg on linux redhat

In Linux, there is a "vgremove" command.

Please see "man vgremove".

MK
MK
moumen
Occasional Contributor

Re: Delete vg on linux redhat

Hi,

Thanks, I dobne this command but the vg still exist !


[root@OTAUC4N1 ~]# vgremove vgORACLE
Volume group vgORACLE is exported



[root@OTAUC4N1 ~]# vgdisplay -v vgORACLE
Using volume group(s) on command line
Finding volume group "vgORACLE"
Volume group vgORACLE is exported
--- Volume group ---
VG Name vgORACLE
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 41
VG Access read/write
VG Status exported/resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 100.00 GB
PE Size 4.00 MB
Total PE 25599
Alloc PE / Size 0 / 0
Free PE / Size 25599 / 100.00 GB
VG UUID gNqnNV-8l1a-R5o8-Fwae-1OBG-QxDV-L1gMZu

Volume group vgORACLE is exported
--- Physical volumes ---
PV Name /dev/dm-5
PV UUID oawp5I-4cv5-0EyT-I00D-J110-qC8j-Qca4dh
PV Status allocatable
Total PE / Free PE 25599 / 25599



Any help is welcome
Steven E. Protter
Exalted Contributor

Re: Delete vg on linux redhat

Shalom,

use:
lvremove

#To remove all logical volumes

vgremove

#To remove the volume group.

vgdisplay -v
vgidsplay

# to get the info

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
Honored Contributor
Solution

Re: Delete vg on linux redhat

An exported VG cannot be manipulated. You must first re-import it, before it can be deleted.

In Linux LVM2, exporting a VG is not at all the same thing as in HP-UX LVM.

In HP-UX, exporting a VG removes the VG information from the lvmtab file and puts it into a map file, which can be used to re-import the VG in the same or another HP-UX host.

In Linux, exporting a VG is more like "securing the VG for transport". It does not remove the system's knowledge about the VG: it just marks the VG as temporarily non-activatable.

An exported VG is lower in priority than a non-exported one: if you move a VG from one Linux host to another and the moved VG happens to have the same name as another already existing VG on the same host, moving the VG in exported state avoids a conflict. You can then use vgrename to rename the moved VG before importing it.

MK
MK
skt_skt
Honored Contributor

Re: Delete vg on linux redhat

can you do a pvcreat( assuming you DONT NEED data any more) and see if that makes any difference how the system sees the VG?
moumen
Occasional Contributor

Re: Delete vg on linux redhat

thnks,

I rmoved the vg after importing it and I created again the vg successfuly, but when I wont creat the lv I have this error


[root@OTAUC4N1 ~]# lvcreate -L 700M -n undo vgORACLE
Aborting. Failed to activate new LV to wipe the start of it.