1834248 Members
2060 Online
110066 Solutions
New Discussion

Re: Trying to delete VG

 
Steve Sheraon
Occasional Contributor

Trying to delete VG

I have a VG that everything has been deleted on except the entry in lvmtab. The physical devices show available. However, I can not use them (I even tried a meadiainit). I get the message that the physical devise is already in the lvmtab. How do I get this information out of the lvmtab file?
7 REPLIES 7
Rajeev  Shukla
Honored Contributor

Re: Trying to delete VG

Hi,
How did you delete the VG?
You need to export the vg by using vgexport command this will remove the VG from lvmtab and freeup that PV linked to the vg.
Do a man on vgexport for more information.

Thanks
Rajeev
Jeff Schussele
Honored Contributor

Re: Trying to delete VG

Hi Steve,

That pesky ole lvmtab just won't let go, huh?

Just force it with

vgexport /dev/vg_name

Be VERY careful w/the VG name as this boots it out of lvmtab as well as the /dev/vg_name dir structure.

BTW - don't use mediainit on newer drives - just use

pvcreate -f /dev/rdsk/cxtydz

to force the new VG info onto the disk.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Tully
Honored Contributor

Re: Trying to delete VG

As stated, how did you attempt to remove the volume group ? Sounds to me like the files have been just removed (/dev/yourvg) and that's it.

The correct manner is to either use 'vgexport' or 'lvremove' each volume, then 'vgreduce' each disk from the group and then finally do a 'vgremove'.
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: Trying to delete VG

Hi Steven,

You will need to de-activate the volume group else it won't let you vgexport. To de-activate you need to unmount all the logical volumes associated with the volume group. Once all the file systems are unmounted do the following (ex., vg01)

#vgchange -a n vg01
#vgexport vg01

Then do pvcreate on each of the disks that were in vg01 and create a new volume group.

But the glitch here is that you manually deleted /dev/vg01 directory.

If you are unable to vgexport vg01 for any reason (please post the errors you got), then you may need to reboot the box and get it into single user mode. Once in single user mode, you can export the volume group as by default it wouldn't be activated by that time.

Please continue posting your issues so that someone can assist you in fixing the problem.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Steve Post
Trusted Contributor

Re: Trying to delete VG

Here's a good guess.
You can't create the new physical volume because it says it in the lvmtab file.

The pvcreate command might just be telling you that the disk was once in a volume group. Perhaps that volume group information is still on the disk, but no where else? The pvcreate command sees volume group information on disk. It does not know if this info is real or not. It assumes it is. So pvcreate tells you the disk is in use. But it's not.

If the disk is NOT really in use, then use pvcreate -f .

But be careful. You do NOT want to use a disk that is ALREADY in use. Run ioscan. Run vgdisplay -v. Make sure.


MANOJ SRIVASTAVA
Honored Contributor

Re: Trying to delete VG

to get the inforamtion out of the lvmtab file for a volume group which si nto exisitng , I assume you have deleted everything , ie /dev/vg


1. do a pvcreate -f /dev/rdsk/cxtydz for the disks which were a part of the VG . This will not remove the information from the lvmtab file

2. To do this you can also do a mv /etc/lvmtab and do a vgscan -a again this will recreate the /etc/lvmtab file .



Manoj Srivastava
Ravi_8
Honored Contributor

Re: Trying to delete VG

Hi,

#vgchange -a n vgxx
#vgremove /dev/vgxx
#vgscan -a
never give up