1834939 Members
2459 Online
110071 Solutions
New Discussion

Re: vgimport query

 
SOLVED
Go to solution
Adam Noble
Super Advisor

vgimport query

Hello,

I have a cluster, within that cluster I have a volume group which shares the same disk. Unfortunately the controller ids are different on each server. I am adding an additional logical volume and need to re-import the volume group to the second server. These are the steps I believe I need to take is this correct:-

vgchange -a n /dev/vg01
vgexport -f /tmp/disk /dev/vg01 (I don't need mapfile do I?)

Then scp /tmp/disk to system 2.

On system 2:-
edit /tmp/disk to reflect correct controller ids
vgimport -f /tmp/disk /dev/vg01
vgchange -a y /dev/vg01

Is this right?
10 REPLIES 10
Pete Randall
Outstanding Contributor

Re: vgimport query

Adam,

I think you would rather use -s than -f:

vgexport -s /dev/vg01

- and -

mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
vgimport -s /dev/vg01
vgchange -a y /dev/vg01

As far as maps are concerned, you don't need them unless your logical volume names are non-standard (anything other than lvol01, lvol02, etc)


Pete

Pete
Adam Noble
Super Advisor

Re: vgimport query

Pete but its my understanding that I need to use the -f option because the disk ids are different on the second server. i.e c7 instead of c6, therefore if I imported them with a mapfile it would fail
Gary L. Paveza, Jr.
Trusted Contributor

Re: vgimport query

You don't need to go through all that work:

On first system:

vgexport -m -p -s /dev/vg01

ls -la /dev/vg01/group (make a note of the minor number)

Copy the mapfile over to the second system.

On second system

vgchange -a n /dev/vg01 (shouldn't be needed)
vgexport /dev/vg01

mkdir /dev/vg01
mknod /dev/vg01/group c 64 0xYY0000 (where YY is the minor number above)

vgimport -m -s /dev/vg01


This is the process I use when doing what you're asking about.
A. Clay Stephenson
Acclaimed Contributor

Re: vgimport query

Because the controller paths are different, your -f file will be wrong on the 2nd host. Normally, you would want to use the -s option and a mapfile. -s writes the VGID into the mapfile along with the LVOL names.
If it ain't broke, I can fix that.
Hilary Nicholson
Frequent Advisor

Re: vgimport query

Don't you need the -p option on the vgexport, so that you don't actually export all of the volume group information from machine 1

Regards,

Hilary
Adam Noble
Super Advisor

Re: vgimport query

Yes I agree I'm aware that the disk file would be different but I would then edit the file to reflect the appropriate disk ids. If I use a mapfile will it not look for the same disk id's as on the 1st server and fail?
Gary L. Paveza, Jr.
Trusted Contributor
Solution

Re: vgimport query

If you use the -s option, vgexport will write the VGID on the disks, and the vgimport (with -s) will scan all your disks looking for the correct VGID. So it won't matter what device files they are.
Adam Noble
Super Advisor

Re: vgimport query

Gary thats exactly the confirmation I was looking for ok I will do as you say.

Thanks all
Patrick Wallek
Honored Contributor

Re: vgimport query

The easiest cleanest way to do it is:

# vgexport -m /var/tmp/mapfilename -p -v -s vg??

Copy mapfile to other machine.

Then on the other machine:

# mkdir /dev/vgname
# mknod /dev/vgname/group c 64 0x0?0000
# vgimport -m /var/tmp/mapfilename -v -s vgname

The mapfile with the VGID will scan all drives and import those with the appropriate VGID. This eliminates having to worry with device file names.

It doesn't matter if the device files are different or the same. It will still work.
Bharat Katkar
Honored Contributor

Re: vgimport query

Hi,
What i do is:
On Server 1..
No need tp deactivate the VG01
#vgexport -m /var/tmp/mapfilename -p -v -s vg01

Copy mapfile to other Server 2.

Then on Server 2:

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x0?0000
# vgimport -m /var/tmp/mapfilename -v -s vgname <..>

Make sure you are using the same PV's that belongs to vg01 on server1. You can make this looking at the H/w path in IOSCAN output on both the servers.

Hope that helps.
Regards,

ps. Gary's suggestion would be the best one but i have never tried in that way.
You need to know a lot to actually know how little you know