Operating System - HP-UX
1754284 Members
2771 Online
108813 Solutions
New Discussion юеВ

I still don't get it (moving drives)

 
SOLVED
Go to solution
Marty Metras
Super Advisor

I still don't get it (moving drives)

I am trying to move mirrored drives around so they are on different controllers.
I understand the hardware part and which slots the drive belong so the mirrored drives will be using different controllers. I can always backup up the system and do this the hard way. I am looking for another way.

Here is what I still am stuck on.
Each pair of drives are one VG, one LV, and one mount point.
How do break the mirror and/or remove the drive from the VG.
I think I should break the mirror and remove one drive from the system with our losing data or downing the system.
I am looking at "When Good Drives go bad." I stll don't get it.
Marty
The only thing that always remain the same are the changes.
6 REPLIES 6
Arunkumar.B
Trusted Contributor

Re: I still don't get it (moving drives)

Hi,

lvreduce -m 0 /dev/vgxx/lvol$ /dev/dsk/cxtydz

#Vgreduce /dev/vgxx /dev/dsk/cxtydz

Remove the drive if its hotspare & connect it to other controller

#insf -H
#pvcreate /dev/rdsk/cxtydz
#vgextend /dev/vgxx /dev/dsk/cxtydz
#lvextend -m 1 /dev/vgxx /dev/dsk/cxtydz
Necessity breaks iron
Steven E. Protter
Exalted Contributor

Re: I still don't get it (moving drives)

Shalom Marty,

Two ways I know to break softwar mirrors.

lvextend -m 0

lvsplit

There are probably others.

I recommend splitting all the mirrors and removing the second copy with lvremove.

Then recreate the mirrors specifying which disk the mirror is going to.

Example the lvol name ls /vg01/lvol1

lvextend -m 1 /vg01/lvol1 /dev/dsk/c1t1d0

Never extend a mirror onto the same controller.

c1 should be extended to c0 or c2 etc.

The nice thing about mirror/ux is you can do this all on the fly.

Letting sam decide where to make the mirror is the normal cause of mirror copies landing on the same disk or controller.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steve Lewis
Honored Contributor
Solution

Re: I still don't get it (moving drives)

If you have a spare disk you could create a 3-way mirror by adding the new disk (that is on the other controller) to your volume group, mirroring all the logical volumes onto it with lvextend -m 2 ... for each logical volume, then
lvreduce -m 1 /dev/vgxx/lvyy /dev/dsk/[one of the disks on the old controller]

That will mean that you never go without a mirrored pair.

Marty Metras
Super Advisor

Re: I still don't get it (moving drives)

If I am understand this correctly I could do this something like this with out moving any moving the drives. Just wait for the mirrod to resync. And use the right hardware addresses.

Break the mirror:
lvreduce -m 0 /dev/vg12/lvol12 /dev/dsk/c10t13d0
Drive is available?

Add another Mirror to vg11 (from above)
lvextend -m 2 /dev/vg11 /dev/dsk/c10t13d0
Now vg11 has a 3 drive mirror?

Remove the unwanter drive from mirror
lvreduce -m 1 /dev/vg11 /dev/dsk/c10t11d0
now vg11 has a 2 drive mirror again?

Marty
The only thing that always remain the same are the changes.
Andrey Tumanov
Frequent Advisor

Re: I still don't get it (moving drives)

If you want to have mirrors accross different controllers you might use PVG-strict allocation policy.

First, you have to create /etc/lvmpvg file that should look like this:

VG /dev/vg01
PVG controller0
/dev/dsk/c0t1d0
/dev/dsk/c0t2d0
PVG controller1
/dev/dsk/c1t1d0
/dev/dsk/c1t2d0

at this point you might want to run vgdisplay -v on your volume group to verify that you PVG are correctly displayed.
then, reduce a mirror with

lvreduce -m 0 /dev/vgXX/lvolXX

change the lvol allocation policy to PVG-strict with

lvchange -s g /dev/vgXX/lvolXX

and add a mirror with

lvextend -m 1 /dev/vgXX/lvolXX

that's all, now you have your lvol mirrored accross different controllers.
Steve Lewis
Honored Contributor

Re: I still don't get it (moving drives)

Yes you should mirror across controllers - that normally means a different c number cXtYdZ , so don't put more than one disk on c10. I thought that was why you wanted to move a disk elsewhere.

When you have dropped whichever mirror disk you want to remove from the volume group, you can add it to another volume group instead, where it may be used as a mirror for a disk elsewhere.

For example, suppose you have 8 disks on c10 and 10 disks on c11, you should include some disks from both controllers in each volume group. Just make sure that the disks are the same size, or else things would get more complicated, but not impossible. Something like this:
c10t0d0, c11t0d0, c10t1d0, c11t1d0 in vg01
c10t2d0, c11t2d0, c10t3d0, c11t3d0 in vg02