Operating System - HP-UX
1833780 Members
2044 Online
110063 Solutions
New Discussion

vgremove: need to remove a vg

 
masood bt
Regular Advisor

vgremove: need to remove a vg

hi
I want to create a vg with a disk. By mistake I selected a wrong disk to create this vg(this disk is already a part of another vg)

The vg has been created with the available space on the wrong disk.

I want to remove this vg now and create it again with the correct disk.

vgreduce and vgremove didnt worked..any help please?
Behind every Great fortune, there is a crime
16 REPLIES 16
Pete Randall
Outstanding Contributor

Re: vgremove: need to remove a vg

vgexport


Pete

Pete
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

when I say vgremove ..i output I got is the vg is not present in lvmtab etc..

so you mean i should do
vgexport -a n ?
Behind every Great fortune, there is a crime
Jeeshan
Honored Contributor

Re: vgremove: need to remove a vg

no, just do vgexport.
a warrior never quits
Suraj K Sankari
Honored Contributor

Re: vgremove: need to remove a vg

Hi,

unmount all lv's then with "lvremove lvname" remove all lv
then remove vg with "vgremove vgname"

Suraj
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

sorry I did not understand.
#vgexport

or

#vgexport


??

also..FYI

in /etc/lvmtab this newly created VG is not present.

Behind every Great fortune, there is a crime
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

suraj

I didnt created any lv in this new vg
i create this vg with a command and realised that I mentioned a wrong disk while creating.
now I am trying to remove this new vg
Behind every Great fortune, there is a crime
Ganesan R
Honored Contributor

Re: vgremove: need to remove a vg

Hi,
>>The vg has been created with the available space on the wrong disk.<<

I have a doubt here. LVM will not allow to create the VG if the is part of another VG unless that vg is exported. Not sure how did you created without any warning message or error.

Now do the following
First step would be, remove the new VG you just created. Then only you can free up the disk which is part of another VG. Simple step to remove a VG is export it.

# vgexport -v /dev/vgname

Now create the new VG with new disk

#mkdir /dev/vgname
#mknod /dev/vgname/group c 64 0x100000
#vgcreate vgname disk

But remember that, you need to restore the LVM headers on the disk which you have added wrongly. Use vgcfgrestore command to restore the VG configuration on it.



Best wishes,

Ganesh.
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

serverxx:/ # vgexport -v /dev/newvg
Beginning the export process on Volume Group newvg".
vgexport: Volume group "/dev/newvg" does not exist in the "/etc/lvmtab" file.
vgexport: Couldn't export volume group "/dev/newvg".
serverxx:/ #
Behind every Great fortune, there is a crime
Ganesan R
Honored Contributor

Re: vgremove: need to remove a vg

Hi,

So, the vg is not created at all.

You go ahead and create the new VG with new disk.
Best wishes,

Ganesh.
Ashish Parashar
Frequent Advisor

Re: vgremove: need to remove a vg

Hello MAssod .


Are you sure that your Vg was created sucessfully that time ...could your please send me the output of vgdisplay -v vgname.


if its not showing any output means your Vg was not created that time ....

and if its there then please let me know if you did pvcreate forcefully.

Regards

Ashish
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

I didnt do it forcibly
I did it like this:

mkdir /dev/newvg

mknod /dev/newvg/group c 64 0x0a0000

pvcreate /dev/rdsk/c12t0d5

vgcreate -s 64 newvg /dev/dsk/c8t0d4
(I donot have the output with me now..but I remember it said vg is created and extended to 1759 PEs)

When I went to the vg which is already having this disk c8t0d4 ..vgdisplay shows allocated PE 1759..no free PE etc

serverxx:# vgdisplay -v newvg
vgdisplay: Volume group "/dev/newvg" does not exist in the "/etc/lvmtab" file.
vgdisplay: Cannot display volume group "newvg".
serverxx:#
Behind every Great fortune, there is a crime
Ganesan R
Honored Contributor

Re: vgremove: need to remove a vg

Hi,

Don't make things complicated...Just do pvdisplay on old disk.

#pvdisplay /dev/dsk/c8t0d4

Look the VG Name which this disk part of. If it shows old VG name then there is no issue. Nothing has been done on the disk.

You can go ahead and create the new VG with new disk.
Best wishes,

Ganesh.
masood bt
Regular Advisor

Re: vgremove: need to remove a vg



serverxx:/ # pvdisplay /dev/dsk/c8t0d4
--- Physical volumes ---
PV Name /dev/dsk/c8t0d4
PV Name /dev/dsk/c10t0d4 Alternate Link
PV Name /dev/dsk/c12t0d4 Alternate Link
PV Name /dev/dsk/c14t0d4 Alternate Link
VG Name /dev/othervg
PV Status available
Allocatable yes
VGDA 2
Cur LV 4
PE Size (Mbytes) 64
Total PE 1759
Free PE 0
Allocated PE 1759
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
Proactive Polling On

serverxx:/ #
Behind every Great fortune, there is a crime
Ganesan R
Honored Contributor

Re: vgremove: need to remove a vg

Hi,

>>>VG Name /dev/othervg<<<

So it is clear that, the disk is part of /dev/othervg, not part of /dev/newvg.

Go ahead and create new VG now.

Best wishes,

Ganesh.
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

Yes I will now. :-)
Behind every Great fortune, there is a crime
masood bt
Regular Advisor

Re: vgremove: need to remove a vg

The vg has not been created at all
Behind every Great fortune, there is a crime