Operating System - HP-UX
1834953 Members
2262 Online
110071 Solutions
New Discussion

vgexport, vgimport, remapping instance numbers

 
Joe Hege
Occasional Advisor

vgexport, vgimport, remapping instance numbers

Need to move to a couple of new scsi cards. Here's what I've got planned.

umount vg01 lvols
vgchange -a n vg01
vgexport -v -m vg01.mapfile vg01
shutdown
move cables
startup
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x01000

vgimport -v -m vg01.mapfile /dev/vg01 /dev/dsk/c1t8d0...rest of block devices

vgchange -a y /dev/vg01
mount -a

Is this correct?
Vini, Vidi, Vici
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: vgexport, vgimport, remapping instance numbers


Looks good to me except;
1. your mknod command should have 4 zeroes after the 1; 0x010000
2. after you move the scsi cards the /dev/dsk entries may/will change so you will need to identify the new ones before you do the vgimport.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Pete Randall
Outstanding Contributor

Re: vgexport, vgimport, remapping instance numbers

Joe,

You can also use the -s option to eliminate the need to have to list each device on the import:

vgexport -s -v -m vg01.mapfile vg01
vgimport -s -v -m vg01.mapfile /dev/vg01


That should do it.


Pete


Pete
Massimo Bianchi
Honored Contributor

Re: vgexport, vgimport, remapping instance numbers

Hi,
in addition to Stefan's hint: insted of doing a

vgexport -v -m vg01.map vg01

use a

vgexport -s -m vg01.map vg01

This ways the VGID will be recorded in the mapfile, and the search for the disks of the vg will be done automatically by the S.O., and you won't have to mess up with the identification work.


For the import

simply substitute the

vgimport -v -m vg01.map vg01

with

vgimport -v -s -m vg01.map vg01


HTH,
Massimo
Tim D Fulford
Honored Contributor

Re: vgexport, vgimport, remapping instance numbers

9.5/10

The only other thing that may make things easier is to use
vgexport -m -s -p -v vg01
& then blow it away with
vgexport vg01.
On import side
vgimport -m -s -v vg01

The -s option means you do not need to list the disks. I, however, prefer the way you are doing it so that the right alternations of disks can be specified.

The only other thing
1 - minor number 0x010000
2 - belt & braces, vgcfgbackup vg01 at the end(to make sure the VG has its config stored)

Regards

Tim
-
A. Clay Stephenson
Acclaimed Contributor

Re: vgexport, vgimport, remapping instance numbers

Other than the above mentioned 0x010000 minor device number this looks ok. Before doing the initial export, I would do a ls -l /dev/vg01/group and make sure that the original minor device number was also 0x010000. The convention is that vg00 gets 0x000000, vg01 gets 0x010000 ... but the only requirement is that the minor device number be unique on a given system. You need to either do a prior ls -l or make certain that whatever minor device number you choose for the group file is unique (and of course otherwise formatted correctly).
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: vgexport, vgimport, remapping instance numbers

Hi Joe:

In lieu of using the '-s' option to collect your disks by VGID during the 'vgimpoirt', you can 'vgexport' using the '-f outfile' argument. This records the device paths in teh 'outfile'. You can then edit this, if/when you know the new paths, and 'vgimport' with the editted file as '-f infile' of 'vgimport.

The advantage to this method is that you can arrange your primary and alternate links immeditately on import. This negates the need to 'vgreduce'/'vgextend' to swap secondary and primary links to load balance I/O accross disk controllers. Remember that a primary pv_link for LVM is merely the first path to a particular device in 'etc/lvmtab'.

Regards!

...JRF...