Operating System - HP-UX
1834391 Members
2049 Online
110066 Solutions
New Discussion

Re: VGimport disks without mapfile.

 
SOLVED
Go to solution
Andrew Hoffman
Occasional Contributor

VGimport disks without mapfile.

I have a D230 system with HASS 8x4.3Gb disks, the boot disk died with a physical hardware fault. I have replaced the boot disk and re-installed HP-UX 11. How can I import the data on the other 7x4.3Gb disks. Do I use VGScan then VGimport, (but don't have mapfile). Suggestions required. Thanks @ndy
Warning You are SuperUser......Shit Happens
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor

Re: VGimport disks without mapfile.

I would do a vgscan -p -v. This will show you which disks comprise which of the old VG's. Next manually vgimport the disks. You really don't need a mapfile unless you need non-standard LVOL names and even then you can rename the lvol and rlvol nodes after the vgimport.
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: VGimport disks without mapfile.

Yes, you can use vgscan to check which disks are part of which VG. With the output of vgscan, determine how many VGs you need to create and then:
1) Create vg directories:
# mkdir /dev/vg_name
2) Create group file:
# mknod /dev/vg_name/group c 64 0x0?0000

The last number is the minor number and it's normally 0x01000 for vg01, 0x020000 for vg02 etc. It should be unique.
3) Now do the vgimport:
# vgimport /dev/vg_name physical_disk_paths

Specify all disks reported to be part of the same VG. eg: /dev/dsk/c0t6d1
4) Activate VG:
# vgchange -a y /dev/vg_name
5) check vgdisplay and lvdisplay outputs
6) Create mount points and mount each file system.
7) Update /etc/fstab with mount options.
8) For any file system error or details, check fsck outputs.
Life is a promise, fulfill it!
Patrick Wallek
Honored Contributor

Re: VGimport disks without mapfile.

If all 7 other disks were part of the same VG then you can do:

First create a file with your list of 7 disks:

# cat /tmp/list_disk
/dev/dsk/c1t0d0
/dev/dsk/c1t1d0
/dev/dsk/c1t2d0
/dev/dsk/c1t3d0
/dev/dsk/c1t4d0
/dev/dsk/c1t5d0
/dev/dsk/c1t6d0

Now make your VG dir and group file:

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000

Now import your VG:

# vgimport -f /tmp/list_disk -v vg01

That should do it.
James R. Ferguson
Acclaimed Contributor

Re: VGimport disks without mapfile.

Hi:

There is no need to do a 'vgscan'. The absence of an LVM mapfile is not an impediment to a successful 'vgimport'. A mapfile merely equates logical volume numbers (as represented by the minor number of their device files) to names. A mapfile can be built after-the-fact, before a 'vgimport' if desired. It would look like:

1 lvol1
2 lvol2
3 mylvol

In the absence of a mapfile, default names are used for the logical volumes (lvol1, lvol2, etc.).

To "import" your non-vg00 volume groups use 'vgimport':

# vgimport -v -m /tmp/vg01.mapfile /dev/vg01 /dev/dsk/c0t5d0 /dev/dsk/c0t7d0

Again, if you don't have, or want to make a mapfile, drop the '-m mapfile' argument from the above. Do a 'man vgimport' for more information.

Regards!

...JRF...
Andrew Hoffman
Occasional Contributor

Re: VGimport disks without mapfile.

When I do a vgscan -p -v I get the following information giving the physical_disk_path but not the OLD VG information. Any Help

# vgscan -p -v | more
vgscan: The physical volume "/dev/dsk/c0t6d0" is already recorded in the "/etc/lvmtab" file.
Physical Volume "/dev/dsk/c2t2d0" contains no LVM information

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/c0t3d0

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/c0t4d0

/dev/vg00
/dev/dsk/c0t6d0

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/c1t3d0

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.
# ev/dsk/c1t4d0

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/c1t5d0

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/c1t6d0
Warning You are SuperUser......Shit Happens
Sridhar Bhaskarla
Honored Contributor
Solution

Re: VGimport disks without mapfile.

Hi,

You will need to know which disks belonged to which volume group before.

Your "vgscan -p -v" shows that each disk was on a seperate volume group. If it is true, then use 'vgimport' as mentioned before. If you are sure that was not the configuration, then there is a work around. For each disk do the following -

echo 0x2010?2X|adb /dev/dsk/cxtydz|awk '{print $3}'

Prepare a file mapping the disks and the corresponding above values.

For all the disks in a volume group, the above value should match. So, pick out the disks having the same value and put them in a volume group using 'vgimport'.

Once it is done, do a vgchange -a y. Mount each logical volume under the volume group and find the contents. Based on the contents, you should be able to figure out the corresponding mount point.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: VGimport disks without mapfile.

The vgscan -p -v can only reveal which PV's share a common VGID (Volume Group ID); it can't tell you that dev/dsk/c1t5d0 once belonged to to vg04, for example.

It should be able to tell you which disks sharre a common GVID and thuis should be imported as multiple PV's into a common VG. In your case, it looks like each disk was a VG.

You have just learned a valuable lesson about documenting your systems. It's always a good idea run bdf's, vgdisplay's, strings /etc/lvmtab, or the Ignite tool print_manifest and print these and store them in a safe place. It's a better idea to mirror so that this would have been absolutely trivial.

If it ain't broke, I can fix that.
Andrew Hoffman
Occasional Contributor

Re: VGimport disks without mapfile.

Thanks Problem resolved... I will forward your comments to the Lab Manager when get gets back from sick leave.

Many Thanks

@ndy
Warning You are SuperUser......Shit Happens