Operating System - HP-UX
1753768 Members
5669 Online
108799 Solutions
New Discussion юеВ

Re: Adding disks to a mirrored VG03

 
SOLVED
Go to solution
Bruce Troutman
Advisor

Adding disks to a mirrored VG03

VG03 currently has 2 4GB disks, A primary is mirrored to the other disk. I want to add two more disks to VG03 so that there will be 2 primary disks and two mirrored. vg03 only has one logical volume "lvol1"

Here is what I am planning on doing:
#vgextend /dev/vg03/ /dev/dsk/c0t4d0 /dev/dsk/c1t4d0
#lvextend -L 8000 /dev/vg03/lvol1 /dev/dsk/c0t4d0

My question is, will lvm know to mirror to disk c1t4d0 or am I missing a step?

Thanks!
9 REPLIES 9
Thayanidhi
Honored Contributor
Solution

Re: Adding disks to a mirrored VG03

My suggestions

add new disks to the system

pvcreate repeat for second disk
vgextend /dev/vg03
repeat for second disk

lvextend -L 8000 /dev/vg03/lvol1 /dev/dsk/ /dev/dsk/

extendfs



Attitude (not aptitude) determines altitude.
Jeff Schussele
Honored Contributor

Re: Adding disks to a mirrored VG03

Hi Bruce,

Yes I believe so, but you should, I think, denote both new devices on the lvextend command line.
To be sure just run a lvdisplay following your lvextend & check the output.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Andreas Voss
Honored Contributor

Re: Adding disks to a mirrored VG03

Hi,

i'd recommend to use:

lvextend -L 8000 /dev/vg03/lvol1 /dev/dsk/c0t4d0 /dev/dsk/c1t4d0

So both disks are known for extending the lvol and mirror will be done though the new disks.

Regards

Thayanidhi
Honored Contributor

Re: Adding disks to a mirrored VG03

I have a better idea now.

Take backup (for safety)

Reduce the mirror
lvreduce -m 0 /dev/vg03/lvol1 /dev/dsk/

vgreduce /dev/vg03 /dev/dsk/

Add the new disks to the system and pvcreate them.

Now add all disks one by one to the vg and create the PVGs.

vgextend -g PVG1 /dev/vg03 /dev/dsk/

vgextend -g PVG2 /dev/vg03 /dev/dsk/

vgextend -g PVG2 /dev/vg03 /dev/dsk/

If needed edit /etc/lvmpvg and make sure the current disks are in PVG1 and new disks are in PVG2.

make the lvol1 as PVG strict

lvchange -s g /dev/vg03/lvol1

now lvextend as you like.

lvextend -L 8000 /dev/vg03/lvol1 PVG1

lvextend -m 1 /dev/vg03/lvol1 PVG2

Hope it helps you!

You can also design in such way that PVG1 and PVG2 in diffrent controller for redundancy.




Attitude (not aptitude) determines altitude.
Martin Johnson
Honored Contributor

Re: Adding disks to a mirrored VG03

I always break the mirror before extending a logical volume, just to be safe. In the past I have had problems with extending mirrored logical volume with SAM.

Fortunately, you can use pvmove to fix things if the extend end up on the wrong volume.


Marty
S.K. Chan
Honored Contributor

Re: Adding disks to a mirrored VG03

Setting up PVG is the way to go "clean mirroring". That way you can always be sure you mirror copies sits on the one set of disks.
Lets say this is what you got ..
vg03 (only lvol1)
c0t5d0
c1t5d0 = mirror copy sits here
Now you want to add c0t4d0 and c1t4d0. The idea here is to create 2 PVGs. First lets extend vg03 ..
# vgextend /dev/vg03 /dev/dsk/c0t4d0 /dev/dsk/c1t4d0
# vgdisplay -v vg03
==> check it
# cd /etc
# vi lvmpvg
VG /dev/vg03
PVG PVG0
/dev/dsk/c0t5d0
/dev/dsk/c1t4d0
PVG PVG1
/dev/dsk/c1t5d0
/dev/dsk/c1t4d0

By creating "lvmpvg" file like above will group the 2 sets of disks in a separate PVG.

# vgdisplay -v vg03
==> check it
# lvchange -s g /dev/vg03/lvol1
==> on your existing lvol1 change it's mirroring policy to PVG-strict
# lvextend -L 8000 /dev/vg03/lvol1
==> Now you extend it, that will make sure your mirror copy always reside in PVG1

Going forward if you want to create a new LV, the syntax would be .. (eg: 400MB lvol2)
# lvcreate -L 400 -m 1 -s g -n lvol2 /dev/vg03
==> since you tell it to use PVG-strict mirroring ("-s g"), it'll create the mirror copy on in PVG1
Extending it in the future would just be the plain lvextend command since we have already define this LV to use PVG-strict mirroring when it was created.

S.K. Chan
Honored Contributor

Re: Adding disks to a mirrored VG03

sorry ... typo .. lvmpvg should look like this..

VG /dev/vg03
PVG PVG0
/dev/dsk/c0t5d0
/dev/dsk/c0t4d0
PVG PVG1
/dev/dsk/c1t5d0
/dev/dsk/c1t4d0






Mariusz Grabowski_2
Frequent Advisor

Re: Adding disks to a mirrored VG03

Hi Bruce,

well, I think your plan is fine.
assuming, that the lvol you have is created on 1 disk & mirrored to the second one, while extending your vg by 2 disks, one should be used as primary & the second as mirror.

so, your plan to extend your lvol to only one of disks you've added should effect in:
extending the lvol to the disk you've added in 'lvextend command'
and the mirror should be extended on the second disk.

you can try it by extending your existing lvol by 1 PE, and see the output of 'vgdisplay -v vg03' command.

good luck :)

cheers,
Mariusz
Bruce Troutman
Advisor

Re: Adding disks to a mirrored VG03

Thanks for all of the ideas, everything went fine this weekend.

The only hitch was the VG had a strict allocation policy which was easily corrected.

#vgchange -s n /dev/vg03