vgimport help?

 
SOLVED
Go to solution
Coolmar
Esteemed Contributor

vgimport help?

Hi,

I have a server with a LUN attached. I need a copy of the data on that LUN on another system. So I extended vg02 with another LUN and lvextend -m 1 with all the logical volumes. I then lvreduced to break the mirrors and exported the new lUN from vg02. I now want to vgimport the new LUN onto the new server and it isn't working. Here is what I am getting:

# vgscan -p -v
vgscan: Couldn't access the list of physical volumes for volume group "/dev/vg02".
vgscan: The physical volume "/dev/dsk/c1t2d0" is already recorded in the "/etc/lvmtab" file.
vgscan: The physical volume "/dev/dsk/c2t2d0" is already recorded in the "/etc/lvmtab" file.
Couldn't stat physical volume "/dev/dsk/c3t2d0":
Invalid argument
Physical Volume "/dev/dsk/c4t0d3" contains no LVM information
Physical Volume "/dev/dsk/c5t0d3" contains no LVM information


/dev/vg00
/dev/dsk/c1t2d0
/dev/dsk/c2t2d0


vgscan: has no correspoding valid raw device file under /dev/rdsk.
Verification of unique LVM disk id on each disk in the volume group
/dev/vg02 failed.



# vgimport -v -s -m /tmp/vg0216.map /dev/vg02
Beginning the import process on Volume Group "/dev/vg02".
Couldn't access the list of physical volumes for volume group "/dev/vg02".
18 REPLIES 18
Coolmar
Esteemed Contributor

Re: vgimport help?

FYI - also should have included an ioscan:

Class I H/W Path Driver S/W State H/W Type Description
==========================================================================
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE HP 36.4GATLAS10K3_36_SCA
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE FUJITSU MAJ3364MC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 2 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
disk 3 255/0/2.0.0.3 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c4t0d3 /dev/rdsk/c4t0d3
disk 4 255/0/3.0.0.3 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c5t0d3 /dev/rdsk/c5t0d3
disk 5 255/0/4.0.0.3 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c6t0d3 /dev/rdsk/c6t0d3
disk 6 255/0/5.0.0.3 sdisk CLAIMED DEVICE NETAPP LUN
/dev/dsk/c7t0d3 /dev/rdsk/c7t0d3


It is disk 4.0.0.3 (c6t0d3) that I want imported into vg02. It is the disk with the LVM info on it.
Sandman!
Honored Contributor
Solution

Re: vgimport help?

Instead of doing lvreduce(1M) you should have done lvsplit(1M) to break the mirror copy. The steps are given below...alternatively you can look at the lvsplit(1M) man page which has all the info.

- lvsplit mirror
- create new VG
- add split lvol to new VG
- fsck split lvol
- mount lvol for verification
- vgexport new VG
- copy mapfile onto new server
- vgimport new VG into new server

Note that the split off lvol name would end in "b" for ex. /dev/vgold/lvol1b if you stick to the defaults.
DCE
Honored Contributor

Re: vgimport help?



Coolmar

When you do a lvreduce, you are actually removing the lv from from disk. It can be retrieved, but a vgimport will not work (to my knowledge)

You could try lvsplit, and then vgreduce, but even that may not work because (according to the man page) vgreduce removes the LVM info

You could remove the LUN from system A with the mirror active and add it to system B then do a vgimport - that probably will work - however the VG on system A will require maintenance because of the forced removal.

You probably are better off adding the disk to system B, creating the mount pounts, NFS mounting to system A, and copying the data over that way
Geoff Wild
Honored Contributor

Re: vgimport help?

Because you lvreduced/vgreduced - it removed the lvol info.

Try lvsplit instead and create a new vg

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Coolmar
Esteemed Contributor

Re: vgimport help?

Hi Geoff....so I lvsplit and create a new vg on the new server? So I can just lvsplit the mirror and then vgimport it on the new server into vg02?
Coolmar
Esteemed Contributor

Re: vgimport help?

Also, after I am able (I hope) to mount the logical volume on the new server then can I do an lvreduce and vgreduce to get that disk off the original server without it screwing up the new one?
Sandman!
Honored Contributor

Re: vgimport help?

>So I can just lvsplit the mirror and then vgimport it on the new server into vg02?

Yes that would be the way to go.

>Also, after I am able (I hope) to mount the logical volume on the new server >then can I do an lvreduce and vgreduce to get that disk off the original server >without it screwing up the new one?

No need to lvreduce since the lvsplit makes the primary or original logical vol un-mirrored. All that needs to be done at the end of the export/import process is a vgreduce which will remove the bitmap for the sync operation in case the lvols are lvmerge'd back in. man lvsplit(1M) for details.
Coolmar
Esteemed Contributor

Re: vgimport help?

Ok...almost there I think. I am on the other server and was able to vgimport but when I try and activate the vg "vgchange -a y vg02" I get the following:

vgchange: Couldn't activate volume group "/dev/vg02":
Quorum not present, or some physical volume(s) are missing
Geoff Wild
Honored Contributor

Re: vgimport help?

Yes - just follow Sandman's steps.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.