Disk Enclosures
1748151 Members
3334 Online
108758 Solutions
New Discussion юеВ

Re: How to add disk to group in a mirror lv

 
GerGon
Regular Advisor

How to add disk to group in a mirror lv

Hi all,

I have 2 disk with 36Gb each one, with 10 lv's.
One of these lv called lvdata is 20Gb (mirrored in the other disk), I don't have more space, b/c I need to add a pair of new disks in same vg00 and extend the lvdata.

ie actual:
VG00 has:
- disk1 with mirror disk3 (booteable)
- gv00 with 10 lv's with no room

server internal...: disk 1 (source) and disk 2 unused
External surestore: disk 3 (mirror) and disk 4 unused

I'm confusing, I don't know, how do I to tell to lvm that extend lvdata using disk2, what happend while extending, lvextent at same time try to expand the disk 3 for more room, I need that lvextend take disk4 for mirror while..
It's hard to me explain clearly to you..

It is posible after do that, create a new lv that only use disk2 and mirrored with disk4?

I read some threads and docs but I'm not clear.

How I do that, wich are the steps?

Thanks for your time..
8 REPLIES 8
Caesar_3
Esteemed Contributor

Re: How to add disk to group in a mirror lv

Hello!

Split the mirror and then extend the LV that
will take the space from disk 2 when you complit then add the 2 new disks to VG and
made mirror of the new LV that you made to
the disks.

Caesar
Michael Steele_2
Honored Contributor

Re: How to add disk to group in a mirror lv

Map out your disks using 'pvdisplay'.

If they are grossly out of proportion then consider moving the lvols. To do this just create a temp lvol of the same size in another vg, mount and copy the data over, then lvremove the vg00/lvol and remake it using the procedure below.

If you have vg00 with 2 36gb disks then you're largest lvol can be approx. 71gb, minus the bootlif, VGRD, and BDRA. This single lvol extends across 2 disks. And a 40 gb lvol would still stretch across 2 disks. This is the power of LVM. It orderly sequences from extent 0000 across one disk and onto the 2nd in the vg.

Use pvdisplay to observe this:

# pvdisplay -v /dev/dsk/cXtYdZ

Specify the disk when extending :

lvextend -L 400 /dev/vg06/lvol3 /dev/dsk/cXtYdZ

-or-

# lvcreate -n lv_name /dev/vg_name
# lvextend -L size_MB /dev/vg_name/lv_name /dev/dsk/first_pv
# lvextend -m 1 /dev/vg_name/lv_name /dev/dsk/second_pv

Here's a good link:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc778402f24d5d61190050090279cd0f9,00.html
Support Fatherhood - Stop Family Law
twang
Honored Contributor

Re: How to add disk to group in a mirror lv

The step to extend add one disk to vg00 and mirror:
/dev/dsk/c2t2d0 will be the disk we want to
add for the existing root disk(/dev/dsk/c1t2d0) inside the same vg, vg00
1) pvcreate -B /dev/rdsk/c2t2d0
2) mkboot -l /dev/rdsk/c2t2d0
3) mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c2t2d0
4) vgextend /dev/vg00 /dev/dsk/c2t2d0
5) lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0
6) pls check for if:
lvol1 on /stand (this is boot lv)
lvol3 on / (this is root lv)
lvol2 is swap lv

7) lvlnboot -r /dev/vg00/lvol3 (root on /)
8) lvlnboot -s /dev/vg00/lvol2 (swap)
lvlnboot -d /dev/vg00/lvol2 (dump) (optional)
9) lvlnboot -R /dev/vg00
10) lvlnboot -v (to confirm all correct)
11) vgcfgbackup /dev/vg00

Note: before doing anything to vg00, take a ignite backup first!!!
GerGon
Regular Advisor

Re: How to add disk to group in a mirror lv

Maybe there are something dangling.

My doubt is, actually I have gv00 with two disk, one is source and the other one is mirror. All lv's are mirrored, but one called lvdata must be increase take other new disk and need add one disk more to mirror.

- pvcreate /dev/dsk/c2t2d0
- vgextend vg00 /dev/dsk/c2t2d0
- vgextend vg00 /dev/dsk/c4t4d0

Get I time to do follow without get errors:
1. lvextend -L 20000 /dev/vg00/lvdata /dev/dsk/c2t2d0
2. lvextend -m /dev/vg00/lvdata /dev/dsk/c4t4d0

My big doubt is, in line "1" while the lvextend doing the extends that get the new disk, the lvm at same time trying to extend on mirror disk too, and obviously, the /c4t4d0 no yet mirrored???? Is it normal, Can I do lvextend first and then lvextend to mirror on 2nd new disk /dev/dsk/c4t4d0????

Caesar_3
Esteemed Contributor

Re: How to add disk to group in a mirror lv

Hello!

If you gonna extend the LVs you not need to
save the mirrors so split and create in the
end new one mirrors.

Caesar
Caesar_3
Esteemed Contributor

Re: How to add disk to group in a mirror lv

Hello!

You may have a little problem in increase the
LV if it will need space from two disks
so you will be need to enable this option
for the disk/VG

Caesar
GerGon
Regular Advisor

Re: How to add disk to group in a mirror lv

Thank you Caesar for you time.

Excuse me, I don't undertand.
I don't have enough space on lvdata on vg00 mirrored yet. I need to increase lvdata adding one new disk, but this lvdata will need have another disk to continue mirror.
Can I make lvextend on new disk and then make the mirror copy on other 2nd disk.

vg00 (has 10 lv's)
lv1 lv2 lv3...lv9 lvdata
disk1 x x x ... x x (source)
disk2 => new disk to add x (source)
disk3 x x x ... x x (mirror from disk 1)
disk4 => new disk to add like x (will mirror from disk 2)

CAN DO I THE FOLLOW:
1. pvcreate disk2
2. pvcreate disk4
3. vgextend disk2 disk4
4. lvextend -L 20000 /dev/vg00/lvdata /dev/dsk/c2t2d0
5. lvextend -m1 /dev/vg00/lvdata /dev/dsk/c4t4d0

All above works fine..?
Caesar_3
Esteemed Contributor

Re: How to add disk to group in a mirror lv

Hi Gerardo,

Probably you didn't understand what i mean,
for now you don't have any LV that is on two
PV but as i understand you will increase one
of your LV that's why you add new disks
to the VG and then when you will increase
the LV will on two PV so for this action
you have to enable this option.

Once i also made this procedure and didn't understand why i cann't increase the LV
till i change the option.

Good luck!

Caesar