1826496 Members
2870 Online
109692 Solutions
New Discussion

corrupted vg00.conf file

 
SOLVED
Go to solution
Jerome Salyers
Advisor

corrupted vg00.conf file

hi, we have a problem that our vg00.conf file under /etc/lvmconf is corrupted and so our /etc/lvmtab is also corrupt... i need to know how to recreate the vg00.conf file...

the problem is in my vg00.conf file, when i do a strings, i get multiple entrys of 1ia after my entries of LVMREC01, and all other entries...

i've checked other vg00.conf files on other machines, and this line with 1ia does not appear...

on our corrupt system, the 1ia line then appears in the lvmtab file...

we've tried using vgscan to recreate the lvmtab file, but the 1ia line still appears...

the system is a HPL200 running hpux11...

thanks for any help

jerome
8 REPLIES 8
T G Manikandan
Honored Contributor
Solution

Re: corrupted vg00.conf file

#vgcfgbackup -u /dev/vg00.

It updates the latest LVM configuration and creates files in /etc/lvmconf.

check for the man pages of
vgcfgbackup.

Thanks
Stefan Farrelly
Honored Contributor

Re: corrupted vg00.conf file


Hmm. After removing lvmtab and running vgscan to recreate it when you then do a strings /etc/lvmtab it still comes back corrupt ?? can we see the output ?

If so it looks like the LVMREC on the header of the disk is possible corrupt. It doesnt look good - you may need to blask the disk and start again.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Dietmar Konermann
Honored Contributor

Re: corrupted vg00.conf file

You cannot really check the consistency of that files using strings(1)! The files are binary and it is of course possible that other patterns "look like" C strings for the strings(1) command.

I appended a tool that dumps the lvmtab contents in a more reliable way...

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Stefan Farrelly
Honored Contributor

Re: corrupted vg00.conf file

Dietmar,

your attachment is no good - can you check/retry ?

Cheers,

Stefan
Im from Palmerston North, New Zealand, but somehow ended up in London...
Dietmar Konermann
Honored Contributor

Re: corrupted vg00.conf file

2nd trial..
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Dietmar Konermann
Honored Contributor

Re: corrupted vg00.conf file

Oh my dear... something's wrong here.

Ok, here is the source.

# cc -o dumplvmtab dumplvmtab.c


---
/* dumplvmtab, @(#)dumplvmtab.c (2000-01-17) dietmar_konermann@hp.com */
#include
#include
#include
#include
#include

main (argc, argv)
int argc;
char ** argv;
{
char header[12];
char vg_info[1054];
char pv_info[1028];

size_t fd;
int vg_cnt, pv_cnt, vgno, pvno;

if ((fd = open("/etc/lvmtab",O_RDONLY)) == -1)
{
perror ("Unable to read /etc/lvmtab");
exit (1);
}

if (read (fd, &header, sizeof (header)) != sizeof (header))
{
perror ("Unable to read lvmtab header");
exit (1);
}

vg_cnt=*(int*)(header+0x04);
printf ("vers_no:%04hX zero:%04hX vg_count:%08X\n",
*(short*)header,
*(short*)(header+0x02),
vg_cnt=*(int*)(header+0x04));

for (vgno=0; vgno {
if (read (fd, &vg_info, sizeof (vg_info)) != sizeof (vg_info))
{
perror ("Unable to read vg_info");
exit (1);
}

vg_info[1023]=0;
printf ("vg_path:%s\n vg_id:%08X%08X vg_state:%04X vg_incno:%08X pv_cnt:%08X\n",
vg_info,
*(int*) (vg_info+0x400),
*(int*) (vg_info+0x404),
*(short*) (vg_info+0x408),
*(short*) (vg_info+0x40c),
pv_cnt=*(short*) (vg_info+0x410));

for (pvno=0; pvno {
if (read (fd, &pv_info, sizeof (pv_info)) != sizeof (pv_info))
{
perror ("Unable to read pv_info");
exit (1);
}

pv_info[1023]=0;
printf (" pv_path:%s\n", pv_info);
}
}

close (fd);

}
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jerome Salyers
Advisor

Re: corrupted vg00.conf file

dieter, that one doesn't work either... i'm very interested in this tool...

thanks

jerome
Hamdy Al-Sebaey
Regular Advisor

Re: corrupted vg00.conf file

Jerome,

Just have a look at the man pages of
vgcfgbackup.

regards,
Hamdy
Thanks for sharing knowledge