cancel
Showing results for 
Search instead for 
Did you mean: 

vgexport and vgimport problem

SOLVED
Go to solution
V. V. Ravi Kumar_1
Respected Contributor

vgexport and vgimport problem

hi all,
i have two hp servers accessing auto raid 12H E-disk array. there i have two luns in a volume group. i have many logical volumes and raw devices in that volume group. the problem is the vg was active on machine A. i wanted it on machine B. by accident i did a vgexport on A with out creating map file. now vg is not available on both the machines. i tried vgimport on machine B but no use. can any body tell me how to come out of this problem.

thanks in advance
ravi
Never Say No
13 REPLIES
MANOJ SRIVASTAVA
Honored Contributor

Re: vgexport and vgimport problem

Hi Ravi


You can try just using a vgimport without a map file , it should come up with the lvols provide all the disks are the same . ie

do vgimport /dev/vgnew /dev/dsk/cxtydz /dev/dsk/cx1ty1dz1 and so on , this would bring back the logical volumes w/o any problem.



Manoj Srivastava
V. V. Ravi Kumar_1
Respected Contributor

Re: vgexport and vgimport problem

hi manoj,
i tried that but lvols names are changed it is giving lvol1, lvol2 and so on, instead of orginal names.
regds
Never Say No
Ian Dennison_1
Honored Contributor

Re: vgexport and vgimport problem

This is what a map file looks like,....

dcsux100 > cat /tmp/vgDCS6DB.map
1 lvol1
2 lvol2
3 lvol3
4 lvol4
5 lvol5
6 lvol6
7 lvol7
8 lvol8
9 lvol9
10 lvol10
11 lvol11
12 lvol12
13 lvol13
14 lvol14
15 lvol15
16 lvol16
17 lvol17
18 lvol18

use the -f file for a list of physical disk devices (in order). Preferable if there are too many disks devices to specify on 1 command line. Both of these files can be generated by a vgdisplay -v of the previous VG on the previous system which of course you do at a regular interval (try sysinfo script from the porting centre or print_manifest from ignite if you do not!)

Share and Enjoy! Ian
Building a dumber user
James R. Ferguson
Acclaimed Contributor

Re: vgexport and vgimport problem

Hi:

The mapfiles associated with volume group exports and imports are a convienence only.

If you use the default, standard names for logical volumes with volume groups, then the mapfile is superflous, since the logical volume names will be 'lvol1, lvol2', etc.

Otherwise, you can create a mapfile after the fact for use with the 'vgimport'; for example:

1 mylvol1name
2 mylvol2name

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: vgexport and vgimport problem

Well this was not a really good move but assuming that you have some sort of system documentation, you should be able to recover. I would actually get this VG going again on Machine A where you have presumeably known pv paths. Do the usual mkdir /dev/vgnn, mknod /dev/vgnn/group c 64 0xnnnnnn stuff, and vgimport -v /dev/vgnn /dev/dsk/cXtYd0 /dev/dsk/cXtYd1.

The naming of the lvols will be lost but you will habve all the data.

Next when you do a vgexport -m -m mapfile you can then edit the mapfile and put back in any custom vgnames for the vgimport on Machine B.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: vgexport and vgimport problem

Hi (again):

Remember that after the 'vgimport' you will need to activate the volume group:

# vgchange -a y /dev/vgXX

Regards!

...JRF...
S.K. Chan
Honored Contributor

Re: vgexport and vgimport problem

When you exported it, what was the command you used ? Did you use "-s" option ? Vgimporting without the mapfile would work nicely if you use the standard LV naming convention (ex: lvol1,lvol2,lvol3, ..). The mapfile is basically consisted of this kind of entries ..
1 lvol1
2 lvol2
3 lvol3
and so on. BUT if you use "-s" in your vgexport it'll include the VGID in the first line ..
VGID 77612e103c1a5e96
1 lvol1
2 lvol2
3 lvol3
So I need to know if you'd used "-s" or not in your vgexport. If not and if you know all the names of the lvols you can manually create the mapfile and try the vgimport with that map file. You must have had backup of your LVM config to determine those LVs names.
MANOJ SRIVASTAVA
Honored Contributor

Re: vgexport and vgimport problem

ofcouse ofter you get the lovl1 you need to them with the names

mount /dev/vgnew/lvol1 /test1


now the issues is which lvol on which mount point , what i suggest you is to look inot /etc/fstab of the old server and check what lvols where mounted on which mount points , and then mount them coresspondingly .

Incase you cannot get the names of the mount poijnts then u need to mount on some test directory check the contents and remount using the correct names .


You would need to a fsck -y /dev/vgnew/rl* to make the lvols mountable .


Essentially the map file ahs the list of lvols the old volume group was supoos to have .

Also please doa vgcfgback after you get the stuff up.

Manoj Srivastava
V. V. Ravi Kumar_1
Respected Contributor

Re: vgexport and vgimport problem

hi Clay,
iam using mknod on machine A as u suggested to create group. after iam trying vgimport with pv paths, but it is saying can not open control file /dev/vgtst/group , no such device.
what to do?
regds
Never Say No
Ian Dennison_1
Honored Contributor

Re: vgexport and vgimport problem

if you need to match up lvol names to mount points, surely somewhere there are the results of a 'bdf' lying around in a report or temporary file?

Can you get back /etc/fstab from an ignite tape or an old backup?

When u get your info, match up what you expect in the filesystem (omniback can show what is last backed up in there) with the lvol by mounting it on a temp mount point, and then identifying which lvol name it is by the contents.

I sympathise I have done this myself once or twice.

Share and Enjoy! Ian
Building a dumber user
MANOJ SRIVASTAVA
Honored Contributor

Re: vgexport and vgimport problem

Ravi


mkdir /dev/vgnew
mknod /dev/vgnew/group 64 0xabcbde


wher the abcde is a unique no check ls -lR /dev/vg | grep groups to know waht nos are already used.
and then doa vgimport .


Manoj Srivastava
S.K. Chan
Honored Contributor

Re: vgexport and vgimport problem

Another thought I had .. extract the VGID from the disk (only need this if you've exported the VG with -s) and use that to build your mapfile. To extract the VGID ..
# echo 0x2010?2X|adb /dev/dsk/
2010: 77612E10 3C1A5E96
With that the 1st line in your mapfile would be ..
VGID 77612e103c1a5e96
...
followed by all the LV names in order.

V. V. Ravi Kumar_1
Respected Contributor

Re: vgexport and vgimport problem

hi all,
thanks to all, the problem is solved with ur suggesstions.
regds
ravi
Never Say No