Operating System - HP-UX
1752295 Members
4532 Online
108786 Solutions
New Discussion юеВ

Recreating /etc/lvmtab problem

 
SOLVED
Go to solution
Aharon Chernin_1
Occasional Contributor

Recreating /etc/lvmtab problem

I have a customer who has somehow managed to remove all the volume groups except for /dev/vg00 from the lvmtab. Either that, or the file has become corrupted. Also, at the same time the controller number of the disk devices (c#1t3d0) for both paths has changed to a different number. So, who knows what they were up to over there.

I had them strings the /etc/lvmtab file, and as I thought, only /dev/vg00 was in there.

I then had them do a vgscan -a -v -p to see if we could rebuild the /etc/lvmtab file from the lvm headers on the disk. The /dev/vg* directories and group info are all still there, so I thought this should work?

Here is the output:

vgscan: The physical volume "/dev/dsk/c0t6d0s2" is already recorded in
the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c3t6d0" is already recorded in the
"/etc/lvmtab" file.
Couldn't stat physical volume "/dev/dsk/c1t2d0":
Invalid argument
Physical Volume "/dev/dsk/c9t0d0" is not part of a Volume Group
Physical Volume "/dev/dsk/c14t0d0" is not part of a Volume Group


/dev/vg00
/dev/dsk/c0t6d0s2
/dev/dsk/c3t6d0


Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d1
/dev/dsk/c14t0d1

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d2
/dev/dsk/c14t0d2

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d3
/dev/dsk/c14t0d3

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d4
/dev/dsk/c14t0d4

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d5
/dev/dsk/c14t0d5

Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c9t0d6
/dev/dsk/c14t0d6

The Volume Group /dev/vg_d01 was not matched with any Physical Volumes.
The Volume Group /dev/vg_d02 was not matched with any Physical Volumes.
The Volume Group /dev/vg_d03 was not matched with any Physical Volumes.
The Volume Group /dev/vg_d04 was not matched with any Physical Volumes.
The Volume Group /dev/vg_d05 was not matched with any Physical Volumes.
The Volume Group /dev/vg_d06 was not matched with any Physical Volumes.
The Volume Group /dev/vg_migrate was not matched with any Physical
Volumes.


Shouldnt this have worked? I thought vgscan compared the group device major and minor from /dev/vg-whatever to the lvm headers on the disk.

Is there any other action I can take? I do not know which physical disk device belongs to what volume group.

Thanks in advance!
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Recreating /etc/lvmtab problem

vgscan -a

This will re-create the /etc/lvmtab file.

mv /etc/lvmtab /etc/lvmtab.save

first.

The problem here is that you may be forced to vgimport your volume groups, depending on what was actually done to corrupt /etc/lvmtab

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Uday_S_Ankolekar
Honored Contributor

Re: Recreating /etc/lvmtab problem

You ran (vgscan -a -v -p) in preview mode. It will not recreate lvmtab.
vgscan -av will do it for you. before that take a backup of lvmtab file.

-USA..
Good Luck..
Aharon Chernin_1
Occasional Contributor

Re: Recreating /etc/lvmtab problem

Thanks for the replies.

I ran it in preview mode first to see what changes it would do. Most of the disks came back with "Unable to match these Physical Volumes to a Volume Group.", so I figured there wouldnt be any changes the command would be making to the lvmtab file.

I do not have any of their mapfiles, can I do a vgimport without a mapfile? Can I even do a vgimport without knowing what volume group these devices belong to?
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Recreating /etc/lvmtab problem

If you think the physical disks are good and have data then you can test create a VG and mount it to see what data it has.

Here is the doc that explains the process

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000076088069

-USA..
Good Luck..
D Block 2
Respected Contributor

Re: Recreating /etc/lvmtab problem


My guess, the VGEXPORT removed the volgroup definitions from /etc/lvmtab.

maybe next time, this might help:

EXPORT on System B:

vgexport -v -m /etc/lvmconf/vgXX.map /dev/vgXX

vgchange -a n /dev/vgXX

on the other sytem you would like to import them, do:

rcp or ftp the /etc/lvmconf/vgXX.map file over to the other system A.

IMPORT on System A:
mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0x0?000
where the '?' is a unique number on your system.

vgimport -v -m /etc/lvmconf/vgXX.map /dev/vgXX /dev/dsk/cXtXdX <.> <.>
<.> all the associated extended disks that are needed.

vgchange -a y /dev/vgXX

Golf is a Good Walk Spoiled, Mark Twain.