Operating System - HP-UX
1827422 Members
4062 Online
109965 Solutions
New Discussion

Re: Removing missing VG configuration

 
SOLVED
Go to solution
STC ITRC user_1
Occasional Advisor

Removing missing VG configuration

I created a new VG with one logical volume and by mistake someone deleted this volume group using:
$rm -r /dev/vgxxx

but that's still remaining in /etc/lvmtab and other configuration files, so how I can delete that configuration for this volume group to recreate it again?
Champion
7 REPLIES 7
Norman_21
Honored Contributor

Re: Removing missing VG configuration

Salams Abdul,

You do not need to remove the configuration, do the following:


#mkdir /dev/vg01
#mknod /dev/vg01/group c 64 0x010000
#vgcreate /dev/vg01 /dev/dsk/cxtxdx

This will create a new VG. then create a map file, it'll help you for a quick restore in the future.
#vgexport -p -v -s -m /etc/vg01.map /dev/vg01
When you restore
#vgimport -p -v -s -m /etc/vg01.map /dev/vg01

Good luck
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Norman_21
Honored Contributor

Re: Removing missing VG configuration

#vgscan -v
to recreat the /etc/lvmtab
#strings /etc/lvmtab
to show the contents


"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Norman_21
Honored Contributor

Re: Removing missing VG configuration

Abdul,

Try this, you might be able to import the old VG configuration:

#vgimport -v /dev/vg01 /dev/dsk/cxtxdx
to import the old VG to your HD
#vgchange -a y vg01
to activate vg01

Please keep us updated!
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Tim D Fulford
Honored Contributor
Solution

Re: Removing missing VG configuration

I'm not sure what XMAN is trying to do.. I agree with his last option only, the other two will dig the hole a little deeper!

IF the user ONLY deleted the volume group directory /dev/vgxx, then there are two options.

1 - Recreate dir /dev/vgxx, this method has a cowboy hat & spurs to go with it, but is the most direct method .. HP might balk though
# mkdir /dev/vgxx
# mknod /dev/vgxx/group c 64 0x??0000
where ?? is unique (do ls -l /dev/vg*/group)
# mknod /dev/vgxx/rlvol1 c 64 0x??0001
# mknod /dev/vgxx/lvol1 b 64 0x??0001
# vgchange -a y vgxx

2 Variation of above, still a cowboy!
restore /dev/vgxx from tape backup.

3 - Less "ye-ha" more "HP"
# mkdir /dev/vgxx
# mknod /dev/vgxx/group c 64 0x??0000
where ?? is unique (do ls -l /dev/vg*/group)
# vgimport /dev/vgxx /dev/dsk/cXtYdZ (other disks if appropriate)
# vgchange -a y vgxx

** DO NOT DO pvcreate on the disks, if you do so the hole just gets REALLY DEEP **

ALL methods may suffer from the problem that the kernel has probably already registered the OLD minor number and has effectively LOCKD it in. If so, just use another (unique) minor number (a minor number is 0x??0000 & ?? is what may be locked in kernel)

Good luck & chop off the fingers or remove root access from the guy/gal that did rm -r /dev/vgxx...

Tim
-
Norman_21
Honored Contributor

Re: Removing missing VG configuration

Tim,

I appreciate your CowBoy Moves!!! but if you realize at the end of his question, he is asking to remove the old configuration from the /etc/lvmtab so that's why I posted
vgscan -v

Abdul,
Please tell us how you fixed it!!!

Thanks.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
STC ITRC user_1
Occasional Advisor

Re: Removing missing VG configuration

Thnx XMAN & Tim,

Appreciate your help but Tim is giving the correct answer.
Hope we are dealing as one internationatiol team work, so no bother who is giving the correct answer.

~Abdullah
Champion
Norman_21
Honored Contributor

Re: Removing missing VG configuration

Maybe I didn't understand your post.
Take it easy pale!
Asalam Alaikum
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003