Operating System - HP-UX
1762495 Members
3380 Online
108907 Solutions
New Discussion юеВ

Could not import a foreign disk which is part of a mirrored disk

 
SOLVED
Go to solution
Lai Siew Yuen
Frequent Advisor

Could not import a foreign disk which is part of a mirrored disk

I had 2 local mirrored root disks initially and have just broke the mirror in a clean way. LVDISPLAY & LVLNBOOT now shows that there is no mirror disk configured in the system. However when I plan to mount a foreign disk (in the secondary slot that used to be my mirrored root disk) so that I can read its data, I have problem in activating the new VG. I have followed the following steps to mount the foreign disk but problem starts to surface at step 3:
1) mkdir /dev/vg01/

2) mknod /dev/vg01/group c 0x040000

3) vgimport /dev/vg01 /dev/dsk/c2t1d0
vgimport: Warning: Volume Group contains "2" PVs, "1" specified. Continuing.
vgimport: Quorum not present, or some physical volume(s) are missing.
Warning: A backup of this volume group may not exist on this machine.
Please remember to take a backup using the vgcfgbackup command after activating the volume group.

4) vgchange -a y -q n vg01
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c2t1d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c2t1d0":
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 "vg01":
Quorum not present, or some physical volume(s) are missing.

Could anyone enlighten me on why I fail to activate the new VG? Or an alternative way to mount the foreign disk?

PS: Both ioscan & diskinfo shows the foreign disk is claimed and ok.

Thanks for your advice in advance...
13 REPLIES 13
SANTOSH S. MHASKAR
Trusted Contributor
Solution

Re: Could not import a foreign disk which is part of a mirrored disk

Hi,

It seems that the disk u r importing to vg01 is a part of VG having 2 disks. U have to import
with both disks present in system.


-Santosh
Ninad_1
Honored Contributor

Re: Could not import a foreign disk which is part of a mirrored disk

Few things you can check -
1. Is there any other vg having the same minor number for group file?
2. Can you do a vgchgid on the disk before importing it (Only if you are not going to use the disk again on any other server - while importing using a map file having VGID)

Regards,
Ninad
Lai Siew Yuen
Frequent Advisor

Re: Could not import a foreign disk which is part of a mirrored disk

Hi Santosh,
Thank you for your reply. Does that mean there's no way to import it with a single disk? I've managed to import another disk (taken from a disk enclosure, which are also mirrored).

Hi Ninad,
Thanks for your reply.
1) There's no VG having the same minor number. Pls review the o/p below:
ll /dev/vg*/group
crw-r----- 1 root sys 64 0x000000 Feb 1 02:11 /dev/vg00/group
crw-r--r-- 1 root sys 64 0x040000 Jul 9 15:36 /dev/vg01/group
crw-r--r-- 1 root sys 64 0x010000 Nov 30 2006 /dev/vgfix1/group
crw-r--r-- 1 root sys 64 0x020000 Nov 30 2006 /dev/vgfix2/group
crw-r--r-- 1 root sys 64 0x030000 Nov 30 2006 /dev/vgfix3/group

2) Don't really understand how to do that.. Do I really have to go through that? I've done a few rounds of importing a foreign disk before but never have to do that. Can you advice the steps in detail?

Thanks : )
Ninad_1
Honored Contributor

Re: Could not import a foreign disk which is part of a mirrored disk

You need to do a vgchgid generally when you do a mirroring/BC etc and then you want to import the disk/VG on the same server (and since you had done mirroring/BC - now multiple disks/VGs have the same VGID in the descriptor area of the disk) To enable importing in such a situation you need to do a vgchgid on the disk you are importing later on the same host as another VG.

In your situation, you will require this only if the VGID on disk /dev/dsk/c2t1d0 is same as that on some other disk in already imported VGs.

The syntax is
vgchgid /dev/rdsk/c2t1d0

Before this you can check if at all there is any VGID same on any other disks as this one.

strings /etc/lvmtab | grep 'dsk' | while read DISK
do
echo "0d8208?UU" | /usr/bin/adb ${DISK} > /tmp/disks.vgid
done

Then do
echo "0d8208?UU" | /usr/bin/adb /dev/dsk/c2t1d0

The last figure is the VGID, suppose this is 1183329175 for our example, then now do a
grep 1183329175 /tmp/disks.vgid

and you should see if there is any other disk with same VGID.

Please let us know the results.

Regards,
Ninad

Lai Siew Yuen
Frequent Advisor

Re: Could not import a foreign disk which is part of a mirrored disk

Hi Ninad,
Thank you for your prompt response.
I've tried the command and here is what I get:

> echo "0d8208?UU" |adb /dev/dsk/c2t1d0
2010: 0 0

> more /tmp/disks.vgid
2010: 3338167631 1170265737

Pls do let me know what's the VGID and advice what should I change next.

Thanks : )
Ninad_1
Honored Contributor

Re: Could not import a foreign disk which is part of a mirrored disk

In my earlier script, it seems I have missed out >>. Pls use >> instead of > for /tmp/disks.vgid

Anyway, apart from that it seems that there is no VG information on your disk c2t1d0.
See the line you have shown in your output, it shows the VGID in the last field.
It seems to me that this disk is not part of any VG yet.
Are you sure this disk is part of any previously configured VG or are you trying to create a new VG?

Regards,
Ninad
Lai Siew Yuen
Frequent Advisor

Re: Could not import a foreign disk which is part of a mirrored disk

Hi Ninad,
Yes, this disk is part of a previously mirrored root disk. I'm trying to import it as a foreign disk and see if I can read its content.

Thanks... : )
Ninad_1
Honored Contributor

Re: Could not import a foreign disk which is part of a mirrored disk

Hi,

If you are sure it still has a valid VG information, then follow the below steps (Which I had used sometime back, when I freshly installed OS on one of the disks, while still keeping the original mirror disk intact, just incase I needed it)

mkdir /dev/vg01
mknod ....
vgchgid /dev/rdsk/c2t1d0
vgimport -m [mapfile if you have one] /dev/vg01 /dev/dsk/c2t1d0
vgchange -a y -q n /dev/vg01

Then mount the lvols on some temporary mount points.

Hope this helps. Revert back if you face any problem in any of the steps.
But also note inital warning I had mentioned - if you want this disk as part of any mirror later after this activity is completed, then theres a problem if you have used vgchgid.

Please let know if you have still any queries.

Ninad
Lai Siew Yuen
Frequent Advisor

Re: Could not import a foreign disk which is part of a mirrored disk

Hi Ninad,
Thank you for your reply.
Here is the o/p that I have:

> vgchgid /dev/rdsk/c2t1d0
vgchgid: Invalid LVMREC on Physical Volume /dev/rdsk/c2t1d0

> vgchange -a y -q n /dev/vg01
Result to the same error that I had.

Thanks. : )