Operating System - HP-UX
1833325 Members
3128 Online
110051 Solutions
New Discussion

exporting and importing volume groups

 
dasn
Advisor

exporting and importing volume groups

Hi Mates,
I have a simple problem with exporting and importing volume groups uning HP lvm. Basically i am not quite familiar with the concept. My situation is, i have a LUN in Hitachi array where i have created a volume group /dev/vg02. Now using some data migration tool i copied the whole LUN into a HP-MSA array. Where, the copy was done at block level and all data using filesystem properties are copied. Once data migration is completed i want my HP-UX host to point to the newly migrated LUN in HP-MSA array and start using it. So how can i do this operation without having to create the physical volume again ? Thanks for the reply.
- NKD
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor

Re: exporting and importing volume groups

It's actually fairly simple.

1) Identify the disk device associated with the copied LUN. If you have not done so already (and I assume that the host can access this new LUN at this point), issue an "ioscan -fn" followed by "insf". This will create the device nodes. I will pretend that the new LUN is /dev/dsk/c1t5d1.

2) If this new LUN and the original LUN are available to the same host then you should change the volume group ID of the copied LUN.
vgchgid /dev/rdsk/c1t5d1

3) Now you need to create a new directory and a group file. I'll pretend the new VG is /dev/vg05.

mkdir /dev/vg05
chmod 750 /dev/vg05
Now you need to find a unique value for the minor device number. Do an "ls -l /dev/vg*/group" and note the minor device numbers. By convention, vg05 should use 0x050000 where the 1st 2 hex digits correspond to the VG number but that is convention. An unused value so long as the first two hex digits are less than the kernel tunable maxvgs will work.

For our example,
mknod /dev/vg05/group c 64 0x050000
chmod 644 /dev/vg05/group

4) We are now ready to do the vgimport:
vgimport /dev/vg05 /dev/dsk/c1t5d1

5) Now we can activate the VG and backup the VG configuration.
vgchange -a y /dev/vg05
vgcfgbackup /dev/vg05

6) At this point, you have default lvol names, /dev/vg05/lvol1, lvol2, ...

7) vgdisplay -v /dev/vg05 to confirm that all is well.

8) You can now create mountpoints for the LVOL's, make /etc/fstab entries, and mount the filesystems.
If it ain't broke, I can fix that.