Operating System - HP-UX
1834480 Members
3467 Online
110067 Solutions
New Discussion

Extending lvol with mirror

 
SOLVED
Go to solution
KapilRaj
Honored Contributor

Extending lvol with mirror

Hi ,

This is a doubt which i have , please help me to sort this out...

I have an HP 9000 / HPUX 10.20

c1t6d0 & c1t5d0 (PVs) make vg01
I have lvol10 in vg01 which is mirrored.

Now i purchased two more same harddisks and installed them at c1t4d0 & c1t3d0

I want to extend lvol10 into these disks
I want to make sure that the extended lvol is also mirrored.

Can any one tell me what exact procedure i should follow ?.

Kaps
Nothing is impossible
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor
Solution

Re: Extending lvol with mirror

Hi:

Do this:

# pvcreate /dev/dsk/c1t4d0
# pvcreate /dev/dsk/c1t3d0

# lvextend -L /dev/vg01/lvol10 /dev/dsk/c1t4d0

# lvextend -m 1 /dev/vg01/lvol10 /dev/dsk/c1t3d0

...JRF...
Thierry Poels_1
Honored Contributor

Re: Extending lvol with mirror

Hi,
first add the disks to your VG00:
vgextend /dev/vg00 /dev/dsk/c1t4d0
vgextend /dev/vg00 /dev/dsk/c1t3d0

then I would use Physical Volume Groups; this allows disks to be grouped in your VG, and gives you the option to mirror a LV to another group of disks
-put the following in /etc/lvmpvg:
VG /dev/vg00
PVG PVG0
/dev/dsk/c1t6d0
/dev/dsk/c1t4d0
PVG PVG1
/dev/dsk/c1t5d0
/dev/dsk/c1t3d0

-then change your LV mirror policy to use the PVG:
lvchange -s g /dev/vg00/lvol10
(same should be applied for all other lvols)

-then extend your lvol10 in the normal way

good luck,
Thierry
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
eran maor
Honored Contributor

Re: Extending lvol with mirror

Hi

first i will do
1. pvcreate to the 2 disk

2. add them to the vg01
vgextend /dev/vg01 /dev/dsk/c1t4d0 /dev/dsk/c1t3d0

3. then do lvextend -m 2 and the logical voulme will extend in mrror .

but if you are plaaning to do it do first a fbackup to be on the safe side
love computers
John Waller
Esteemed Contributor

Re: Extending lvol with mirror

Similar to James but try
pvcreate /dev/rdsk/c1t3d0
pvcraete /dev/rdsk/c1t4d0
vgextend /dev/vg01 /dev/dsk/c1t3d0
vgextend /dev/vg01 /dev/dsk/c1t4d0
lvextend -l < new number of extents> /dev/vg01/lvol10 /dev/dsk/c1t3d0 /dev/dsk/c1t4d0

Since lvol10 is already mirrored you can specify the 2 disks on the one lvextend command. Also don't forget that you will need to unmount the filesystem and use extendfs to increase the filesystem size:
extendfs -F /dev/vg01/rlvol10

Have fun.
James R. Ferguson
Acclaimed Contributor

Re: Extending lvol with mirror

Hi (again):

...can't believe I forgot the 'vgextend'...quess that's what a 3-day holiday will do for you ;-)

....JRF...
Thierry Poels_1
Honored Contributor

Re: Extending lvol with mirror

hmmm, and I seem to be talking about VG00 whilst the question was about VG00 ...
Thierry, after 4-day holiday :)
This is maybe a little reminder not to take anything for granted here ;-)
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Thierry Poels_1
Honored Contributor

Re: Extending lvol with mirror

sjips, VG01! ONE!!!
(how long till the next weekend ??)
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
KapilRaj
Honored Contributor

Re: Extending lvol with mirror

Hi admins,

Thank you so much for the contributions. Hope you will continue helping me . After going through the answers i came to know about lot many things. At the same time some doubts also popped up. I request you to help me . Hope i am not violating any forum laws, if yes please tell me i am new to this.

JRF ,

pvcreate (2 disks ), vgextend (2 disks), lvextend to one disk , then extend it with mirror this is what you told. i would like to know what happens at the third & fourth stage ?.

The mirrored lvol10 had two PEs per LE am i correct ?. At this stage if you extend lvol10 to one disk (as you told) a part of lvol10 has two PEs per LE & another part (which is present in the new disk) have one LE per PE . Correct me ?.

My ultimate aim is that i do not want HPUX to create a mirror copies of lvol in the same disk , in that case if one of my disk goes , i also will have to go out of the office with them. (I will be sacked !!!)

LE1 ........ PE1.........c1t3d0
LE1 ........ PE2.........c1t4d0

The mirroring should be done as shown above....

Thierry,

Can you tell me something about PVG ?. What is it ?. Where should i use it ?. & What is mirroring policy you are talking about ?. Can you give me a little explanation ?.

eran maor,

lvextend -m2 ? is it going to work ?. what happens while doing it. as we already have one mirror copy.

John,

What is the diff. between your answer & eran's except -l -L does it make any diff ? pleas clarify


Kaps
Nothing is impossible
Thierry Poels_1
Honored Contributor

Re: Extending lvol with mirror

Thierry,

Can you tell me something about PVG ?. What is it ?. Where should i use it ?. & What is mirroring policy you are talking about ?. Can you give me a little explanation ?.


Hi,
about Physical Volume Groups:
normally you have a number of disks in a Volume Group. But you can also group disks in Physical Volume Groups within a Volume Group.
Normally if you create a logical volume you use 'lvcreate -s y ...' : mirrors will be placed on a different disk; if you use PVG's you can also use 'lvcreate -s g ...' : in this case the mirror will be on a different PVG within the Volume Group.
This is extremely handy if you are mirroring disks of different sizes: e.g. put two 2GB disk in PVG1 and one 4 in PVG2, and you will be sure that your 2 GB disks will be mirrored to your 4GB disk without always having to specify explicitely the disk devices. Otherwise the 2GB disks might be mirroring mutually, and there would be no place to mirror data on the 4GB disk.
PVG are usefull if you have several disk in a VG, or have disks of different sizes.

look at manpages of lvmpvg, vgcreate, vgextend, lvcreate for more info.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.