1833783 Members
2234 Online
110063 Solutions
New Discussion

Re: 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.
Patrick Wallek
Honored Contributor

Re: vgimport help?

vgchange -a y -q n vg02

will activate the VG without the quorum requirement.
Sandman!
Honored Contributor

Re: vgimport help?

Are you trying to import this lvol into an existing VG or did you create a new VG on the new system?
Coolmar
Esteemed Contributor

Re: vgimport help?

I created a new VG02 on the new system. Only VG00 existed on teh new system. I got rid of the quorum error, had something to do with the dual paths. Now when I fsck the lvol that I split and brought over I get the following:

# fsck /dev/vg02/lvol10
fsck: /etc/default/fs is used for determining the file system type
vxfs fsck: read of super-block on /dev/vg02/lvol10 failed: I/O error
file system check failure, aborting ...
Coolmar
Esteemed Contributor

Re: vgimport help?

It is all working like a charm! Thanks so much fellows, I really appreciate the help. Just one more thing now...on the new server all the lvols are named lvol1bkp lvol2bkp etc. Not a big deal, but is there a way to change the logical volume name?
Sandman!
Honored Contributor

Re: vgimport help?

You need to fsck the split off lvol on the source (NOT destination) system.
Geoff Wild
Honored Contributor

Re: vgimport help?

Yes - vgchange -a n the vg

then cd /dev/vgXX

mv lvol1b lvol1

etc...

update fstab file - and you are good to go.

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 again guys...I can't seem to reduce /dev/vg02 from the original server as sandman said I could do in an above post. There are still extents being used. How can I find out where they are being used as none of the lvs that I mirrored are still mirrored.

Thanks

# vgreduce /dev/vg02 /dev/dsk/c8t0d3 /dev/dsk/c6t0d3
vgreduce: Physical volume "/dev/dsk/c8t0d3" could not be removed since some of its
physical extents are still in use.
vgreduce: Physical volume "/dev/dsk/c6t0d3" could not be removed since some of its
physical extents are still in use.

#vgdisplay (end)
--- Physical volumes ---
PV Name /dev/dsk/c6t0d0
PV Name /dev/dsk/c7t0d0 Alternate Link
PV Status available
Total PE 44479
Free PE 0
Autoswitch On

PV Name /dev/dsk/c6t0d1
PV Name /dev/dsk/c7t0d1 Alternate Link
PV Status available
Total PE 9598
Free PE 6823
Autoswitch On

PV Name /dev/dsk/c8t0d3
PV Status available
Total PE 9598
Free PE 9285
Autoswitch On

PV Name /dev/dsk/c6t0d3
PV Status available
Total PE 33596
Free PE 33471
Autoswitch On
Sandman!
Honored Contributor

Re: vgimport help?

Do those PVs show up under that VG in the /etclvmtab file. You might need to recreate it. Save the current lvmtab file and run "vgscan -v" on the source system.
Nguyen Anh Tien
Honored Contributor

Re: vgimport help?

As vgdisplay result:
==========================
PV Name /dev/dsk/c6t0d3
PV Status available
Total PE 33596
Free PE 33471
Autoswitch On
================
33596-33471=125PE is in used now.
You should use:
#lvdisplay -v /dev/vg02/lvname (some last lv on vg02)
to determine which lv consumes PE
HTH
HP is simple