Operating System - HP-UX
1833777 Members
2199 Online
110063 Solutions
New Discussion

Re: Problems with vgchange

 
Tom Frencel
Occasional Contributor

Problems with vgchange

I have a problem removing a volume group that was imported from an EMC BCV device. When I try to issue a vgdisplay command on my volume group I get:
Information in "/etc/lvmtab" differs from that in "/etc/lvmpvg".
VG "/dev/vg04_1" is not defined in file "/etc/lvmtab".
vgdisplay: Volume group "/dev/lvemcNMES" does not exist in the "/etc/lvmtab" file.
vgdisplay: Cannot display volume group "lvemcNMES".

When I try to diactivate the volume group, because vgimport is complaining that it already exist, I get:
# vgchange -a n lvemcNMES
vgchange: Volume group "/dev/lvemcNMES" does not exist in the "/etc/lvmtab" file.
#

Now, my conclusion is that the /etc/lvmatab file is not consistent. How can I "safely" remove this volume so that I can reimport it properly from my BCV.
Any help would be much appreciated
7 REPLIES 7
Jeff Schussele
Honored Contributor

Re: Problems with vgchange

Hi Tom,

I would rename lvmtab to lvmtab.old & try a vgscan -a to recreate the "true" VG defs. You can always go back to the org lvmtab. You can also run vgscan w/o renaming & it'll just "add" missing entries.

If the /dev/vgxxx directory already exists & you are truly not using it now, you could just delete the directory & try to reimport.

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

Re: Problems with vgchange

Hi Tom

Here is waht acan be done.

1. Make a copy of lvmtab file say lvmtab.old.
2. Do a vgscan -a -v , this will recreate a new lvmtab file which will have information of all the vg's.
3.Then go ahead with the vg operations.

It is safe bcoz you have a copy of lvmtab , you can alos try -p option which will preview thte stuff.

Also donto forget to do a lvlnboot -R after the work is done.


Manoj Srivastava
S.K. Chan
Honored Contributor

Re: Problems with vgchange

Did you try to re-create lvmtab file ?

# cd /etc
# mv lvmtab lvmtab.old
# vgscan -v
pap
Respected Contributor

Re: Problems with vgchange

Hi Just do following.

#cp lvmtab lvmtab.org
#vgscan -v

Check the lvmtab file conteants using

#strings /etc/lvmtab

Look for the existing Vg in lvmtab defination.

Now your vg whichj you want to remove will not be in lvmtab and hence you will be able to remove it.

-pap
"Winners don't do different things , they do things differently"
James R. Ferguson
Acclaimed Contributor

Re: Problems with vgchange

Hi Tom:

Two comments in addition to the advice you have already been given. (1) Did you use 'vgchgid' on the BCV volume before you attempted the 'vgimport'? (2) Remember that the '/etc/lvmpvg' can be manually edited as well as modified by LVM commands like 'vgcreate', etc.

Regards!

...JRF...
Helen French
Honored Contributor

Re: Problems with vgchange

Hi Tom,

Renaming /etc/lvmtab and recreating with 'vgscan -v' is a good suggestion.

Just curious, are you using PVG ( physical volume groups ) ?

HTH,
Shiju
Life is a promise, fulfill it!
Tom Frencel
Occasional Contributor

Re: Problems with vgchange

Yes, I am issuing vgchgid on the BCV before I try to import the volume group.
I did try to recreate the /etc/lvmtab. In fact here is the output of the new /etc/lvmtab:
# strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t5d0
#
As you can see there is no mention of lvemcNMES - so that is good. However,
when I try importing - I still get an error.

sapsplit: Error importing disk group lvemcNMES [Error executing command 'vgimport -m /nsr/tmp/map_lvemcNMES.14228 lvemcNMES /dev/dsk/c15t0d4 /dev/dsk/c15t2d1' [Volume group "/dev/lvemcNMES" is still active.]]
sapsplit: Error constructing primary host environment

Where is the OS getting the information about lvemcNMES still being active - beats me.

Here is the contents of lvmpvg:
# more lvmpvg
VG /dev/vg04_1
PVG pvg04_1
/dev/dsk/c7t8d0
#
There must be another file on the system that still contains information about lvemcNMES being active.
I know what I can do. I can reboot the machine, but I definitely don't want to do this every time I run into this issue:(
Thanks for everyones replies so far, they are all good, but no solution yet:)