Operating System - HP-UX
1832462 Members
3146 Online
110043 Solutions
New Discussion

Mirror disk and then vgimport only one

 
SOLVED
Go to solution
Fernando Boza
Regular Advisor

Mirror disk and then vgimport only one

I have two servers and one storage. Server1 has LUNs with DataBase.
I need copy and present those LUNs to server2.
My plan was:
- Mirror Database LUNs to another LUNs (secondary LUNs)
- Export VGs
- Break mirror
- Present the secondary LUNs to Server2
- Create directories of VGs
- Make mknod
- Import LUNs on Server2

But I get the following error:
#vgimport -v -s -m /tmp/vg/vg11.mapfile /dev/vg11
Beginning the imprt process on Volume Group "/dev/vg11".
Could't access the list of physical volumes for volume group "/dev/vg11"


Any idea?
10 REPLIES 10
TTr
Honored Contributor
Solution

Re: Mirror disk and then vgimport only one

> Mirror Database LUNs to another LUNs (secondary LUNs)
I am guessing you used LVM to mirror the LUNs. If so then you should be using the first form of the vgimport command of the man pages not the second one (sharable). You leave out the -s option and specify the disk device file to the command. The mapfile contains a list of the logical volumes only there is no physical disk information in it. (When you exported the VGs you should not use the -s option either)
Fernando Boza
Regular Advisor

Re: Mirror disk and then vgimport only one

you are right, the correct commadn is:
#vgimport -v -m /tmp/vg/vg11.mapfile /dev/vg11 /dev/dsk/c8t0d0

I get import... but now I get the following error at vgchange:

# vgchange -a y vg11
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c8t0d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c8t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query all of the physical volumes.
vgchange: Couldn't activate volume group "vg11":
Quorum not present, or some physical volume(s) are missing.


Andres_13
Respected Contributor

Re: Mirror disk and then vgimport only one

Could you provide ioscan -fnC disk pls?

You can try:

# vgsync vg11
# vgchange -a y vg11
# vgdisplay -v vg11

It should works.

Regards!
chinadns
Advisor

Re: Mirror disk and then vgimport only one

hi,
what's kind of storage do you have ?
EVA or MSA? if EVA ,you can copy the data in storage level.

And i am confused with these two steps
- Export VGs
- Break mirror

when you export vg,how do you break mirror?
shine the sky
Aneesh Mohan
Honored Contributor

Re: Mirror disk and then vgimport only one

Hi ,

> Quorum not present, or some physical volume(s) are missing.

Import the volume group without quroum checking.

#vgimport -v -q n -m /tmp/vg/vg11.mapfile /dev/vg11 /dev/dsk/c8t0d0

Aneesh
Ganesan R
Honored Contributor

Re: Mirror disk and then vgimport only one

Hi,

You could not activate the VG Since the LVM info on the new LUNS contains the no of PV's is double and 50% of LUN's are not available when you activate the VG on new server.

Try the below steps.

Active the VG with quorum overide.

#vgchange -q n -a y vg11

Then use vgreduce -f command to remove the missing pv's

Force reduction of missing PVs from volume group: vg11

# vgreduce -f /dev/vg11

The following messages will appear after missing PVs has been removed successfully:

PV with key 0 successfully deleted from vg /dev/vg11

Repair done, please do the following steps.....:

1. Save /etc/lvmtab to another file.

2. Remove /etc/lvmtab.

3. Use vgscan -v to recreate /etc/lvmtab.

4. NOW use vgcfgbackup to save the LVM setup.
Best wishes,

Ganesh.
Fernando Boza
Regular Advisor

Re: Mirror disk and then vgimport only one

thanks to all comments... but I have the same problem:

# ioscan -fnC disk
Class I H/W Path Driver S/W State H/W Type Description
===========================================================================
disk 0 0/0/0/3/0.5.0 sdisk CLAIMED DEVICE HP 73.4GST373405LC
/dev/dsk/c0t5d0 /dev/rdsk/c0t5d0
disk 1 0/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 73.4GST373405LC
/dev/dsk/c0t6d0 /dev/rdsk/c0t6d0
disk 5 0/0/10/0/0.8.0.255.0.0.0 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d0 /dev/rdsk/c8t0d0
disk 6 0/0/10/0/0.8.0.255.0.0.1 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d1 /dev/rdsk/c8t0d1
disk 7 0/0/10/0/0.8.0.255.0.0.2 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d2 /dev/rdsk/c8t0d2
disk 8 0/0/10/0/0.8.0.255.0.0.3 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d3 /dev/rdsk/c8t0d3
disk 9 0/0/10/0/0.8.0.255.0.0.4 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d4 /dev/rdsk/c8t0d4
disk 10 0/0/10/0/0.8.0.255.0.0.5 sdisk CLAIMED DEVICE HITACHI DF600F
/dev/dsk/c8t0d5 /dev/rdsk/c8t0d5
disk 2 1/0/0/3/0.6.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c4t6d0 /dev/rdsk/c4t6d0
disk 3 1/0/0/3/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 305
/dev/dsk/c5t2d0 /dev/rdsk/c5t2d0
disk 4 1/0/1/0/0/1/1.6.0 sdisk CLAIMED DEVICE HP 73.4GST373307LC
/dev/dsk/c7t6d0 /dev/rdsk/c7t6d0
#


# vgsync vg11
vgsync: Couldn't query logical volume "/dev/vg11/BK_Migracion_01":
Volume group not activated.

vgsync: Couldn't query the list of logical volumes.
vgsync: Couldn't access the list of logical volumes for volume group "vg11".
vgsync: Couldn't resynchronize volume group "vg11".
#



# vgimport -v -q n -m /tmp/maint/vg/vg11.mapfile /dev/vg11 /dev/dsk/c8t0d0
Usage: vgimport
[-p]
[-v]
[-s]
[-m MapFile]
VolumeGroupName PhysicalVolumePath...
or: vgimport [-p] [-v] [-m MapFile] -f InFile VolumeGroupName
"q": Illegal option.

# vgchange -q n -a y vg11
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c8t0d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c8t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query all of the physical volumes.
vgchange: Couldn't activate volume group "vg11":
Quorum not present, or some physical volume(s) are missing.





Ganesan R
Honored Contributor

Re: Mirror disk and then vgimport only one

Hi,

vgchange command fails because you have not imported the VG yet. I will start from the beginning assuming that /etc/lvmtab does not contain the vg11 informations(confirm once)

1.First step is create the VG directory.

#mkdir /dev/vg11

2. create the group file

#mknod /dev/vg11/group c 64 0x0n0000

3.Now import the VG by specifing all of its PV's in the command line. Note you need to specify all the disks which is presented to the new server.

#vgimport -v -m /dev/vg11 ....

4.Now we need to activate the VG with quorum overide option since we have only 50% disks available.

#vgchange -a y -q n /dev/vg11

5.At this stage all the logical volume will show one mirror copy. but we have only one set of disks available.So we need to reduce the the mirror copy from missed physical volume.
Use lvdisplay command to find the pvkey corresponding to the missed pv.

#lvdisplay -k
Note down the pvkey where pv name column shows ???. Then use lvreduce command to reduce the mirror
#lvreduce -m 0 -k
Ex:lvreduce -m 0 -k /dev/vg11/lvol1 0
Use above step for all the lv's

Now use vgreduce -f command to forcefully remove the missed pv's

#vgreduce -f /dev/vg11

#mv /etc/lvmtab /etc/lvmtab.old

#vgscan -v

#vgchange -a n /dev/vg11
#vgchange -a y /dev/vg11

Try the above steps and let us know the result.

Best wishes,

Ganesh.
Aneesh Mohan
Honored Contributor

Re: Mirror disk and then vgimport only one

Hi,

Try this,

1. vgimport -v -m /tmp/vg/vg11.mapfile /dev/vg11 /dev/dsk/c8t0d0

2. vgchange -a y -q n /dev/vg11


Aneesh
sreekanthtm
Trusted Contributor

Re: Mirror disk and then vgimport only one

Hi,

How many disks are there in the original vg (/dev/vg11) ??
How did you create the map file? Used -s option or not?
At what stage u export the VG? Before OR after break the VG??
Where you are trying to import the VG?? Server 1 OR server 2?? If its on server 2, did you confirm the device file using the LUN ID??

And one more thought...... Why do you want make the task this much complicate????
Avoid mirroring and create a fresh vg
1. Present LUNs from XP to server 1
2. Create VG, LV, File system.
3. Copy data from Source to destination.
4. Export using -s option (# vgexport -p -v -s -m /tmp/vg11.map /dev/vg11).
5. Create VG in server 2.
6. mknod
7. Copy the map file from server1 to server2.
8. import VG (vgimport -v -s -m /tmp/vg11.map /dev/vg11

OR...... you can copy entire data using rcp, scp, nfs.....

Rgds
Sreekanth