Operating System - HP-UX
1752815 Members
6171 Online
108789 Solutions
New Discussion юеВ

Changing array slot of disk in a mirror set?

 
SOLVED
Go to solution
mvpel
Trusted Contributor

Changing array slot of disk in a mirror set?

Hi everyone,

I've got a system which has a set of volumes mirrored across two external disk arrays, and I want to change it so that all the disks are in a single array, so that I can use the second array for another system. I have enough empty slots in the first array to accommodate all the disks.

I assume that it's not quite as simple as just unplugging a PV in the mirror from the second array and moving it to a free slot in the first array - or is it?

Are there any manual steps (import? rescan?) needed to get the LVM to recognize the new device path to the existing physical volume, or is it smart enough to recognize the PV label on the disk at its new /dev/dsk path and bring it back into the mirror without any drama?

I'd prefer to do it without rebooting, needless to say.

Thanks for any insights you can offer!
15 REPLIES 15
likid0
Honored Contributor
Solution

Re: Changing array slot of disk in a mirror set?

If i understood correctly you have a set of lvols mirrored using mirrordisk/ux with one pv on one array and another pv in the other array ??

if this is the case you just have to remove the mirror and vgreduce the disks from the array you want to leave empty:

remove the mirror from all the lvols that have disks beloging to the old array
lvreduce -m 0 /dev/vglol/lvol /dev/dsk/diskoldarray
once no lvol is using the disk reduce the vg:
vgreduce /dev/vglol /dev/dsk/diskoldarray


And if you wan't to redo your mirror with a disk in the new array then, present the new lun,ioscan, insf ..
vgextend /dev/vglol /dev/dsk/newdiskarray
lvextend -m 1 /dev/vglol/lvol /dev/dsk/newdiskarray

no need to stop.

Windows?, no thanks
TTr
Honored Contributor

Re: Changing array slot of disk in a mirror set?

> ...mirrored across two external disk arrays,

It looks like you are using LVM mirroring with external disk enclosures (not arrays).
You need to provide more details.
If they are mirrored using LVM , then the relocation of the disks needs to be handled within LVM. The vgexport/vgimport is one method to use. If you have spare disks, vgextend/pvmove/vgreduce is also an option.
Pete Randall
Outstanding Contributor

Re: Changing array slot of disk in a mirror set?

How about pvmove?

"move allocated physical extents from one LVM physical volume to other physical volumes"

You would need to set up the new logical volumes (in the same VG, of course), but then you should be able to pvmove the second array's LVs to the new LVs. Then you do what you like with the old LVs.



Pete

Pete
mvpel
Trusted Contributor

Re: Changing array slot of disk in a mirror set?

Yes, the volumes are mirrored with MirrorDisk/UX.

My hope is that I'd be able to simply unplug the mirror disk from one array, plug it into the other array, perform the appropriate incantation, and it would recognize and resync the existing mirror onto the relocated volume - without having to break the mirror, move the disks, and then recreate it.

Hope that's a bit more clear.
mvpel
Trusted Contributor

Re: Changing array slot of disk in a mirror set?

I also considered the pvmove option with new disks, but that's suboptimal because it would involve additional paperwork in changing the serial numbers recorded in the hardware baseline for the system, but it's certainly a possibility.
Pete Randall
Outstanding Contributor

Re: Changing array slot of disk in a mirror set?

> My hope is that I'd be able to simply unplug the mirror disk from one array, plug it into the other array, perform the appropriate incantation, and it would recognize and resync the existing mirror onto the relocated volume

Sorry to disappoint but that's not going to happen.


Pete

Pete
mvpel
Trusted Contributor

Re: Changing array slot of disk in a mirror set?

Thanks very much for the info!
Pete Randall
Outstanding Contributor

Re: Changing array slot of disk in a mirror set?

The more I think about it, the more I have to wonder if a vgexport/vgimport might not be able to find the switched disks:

vgexport -s -m /tmp/vgNN/map
If necessary, recreate /dev/vgNN:
mkdir /dev/vgNN
mknod /dev/vgXX/group c 64 0xNN0000
Then reimport the VG:
vgimport -s -m /tmp/vgNN/map /dev/vgNN

The -s option should go out and look at all the disks LVM headers and "discover" the newly switched disks.

Possibly worth a try but I would want to have a good backup - which you ought to have in any case!


Pete

Pete
mvpel
Trusted Contributor

Re: Changing array slot of disk in a mirror set?

Hm, interesting possibility...

As luck would have it I now have another system that's installed but not yet on the network that I can use to see what happens when a PV changes hardware paths. I'll try it out and post the results.