Operating System - HP-UX
1834450 Members
2219 Online
110067 Solutions
New Discussion

Re: Extending & mirroring existing lvol to new disks

 
SOLVED
Go to solution
Timo J
Frequent Advisor

Extending & mirroring existing lvol to new disks


- vg00 is two-disk mirrored configuration (disk1 lvols mirrored to disk2)

Now I'm adding two disks (disk3 & disk4) to that vg00 and trying to extend few lvols to new disks.

So I'd like to have mirrored pairs like:
disk1 -> disk2
disk3 -> disk4

When extending existing lvol so that it starts to allocate extents from disk3, how to be sure that those extents are mirrored to disk4? (Or is this done automatically?)

I used default setting for allocation policy when those lvols were created so those mirrors of a logical extent cannot share the same physical volume. Does that mean that lvextend just starts to mirror those extents to next disk on same vg (disk4 in this case)?
N/A
11 REPLIES 11
F Verschuren
Esteemed Contributor

Re: Extending & mirroring existing lvol to new disks

whit mirroring alway give up the disk like:
lvextend -m 1 /dev/vg00/lvol?? /dev/dsk/c?t?d?
it than wil mirror on the please you like it it mirror.
extentions have to be done the same:
lvextend -l 1023 /dev/vg00/lvol?? /dev/dsk/c?t?d?

greetings, Freek
Steven E. Protter
Exalted Contributor
Solution

Re: Extending & mirroring existing lvol to new disks

Shalom,

Easiest (not safest) thing to do is to break all mirrors and rebuild them manually.

You would need to plan this out a bit to make sure no two mirrors end up on the same disk.

Doing lvextend without specifiying the disk will let LVM decide and its not always making the best decisoins.

Using sam or being non-specfic could lead to trouble.

You need to answer your question by specifying what disk the original logical volume is on and which disk the mirror is going to be on.

Lets say I have filesystem /opt which was too small and I need to extend it. It was mirrored.

It was on disk1 mirrored to disk2.

Procedure:
1) lvsplit or lvextend -m 0
2) remove or lvremove the now stale mirror copy.
3) lvextend lvol_opt disk3
4) lvextend -m 1 lvol_opt disk2 disk4

This does not precisely control the outcome.

Post mirror you need to check lvdisplay -v lvol_opt

Assume nothing lvm does is automatic or comes out in a fashion that makes sense. Take control.

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
skt_skt
Honored Contributor

Re: Extending & mirroring existing lvol to new disks


for example if you want to move lvolx from vg00 which is currently with disk1 and disk2

lvreduce lvolx with disk1(now only disk2)
lvextend lvolx with disk3(now disk2 and disk3)
lvreduce lvolx with disk2(now only disk3)
lvextend lvolx with disk4(now disk3 and disk)

But make sure that the disk combination comes from different controller.
Victor BERRIDGE
Honored Contributor

Re: Extending & mirroring existing lvol to new disks

Greetings,

I will start by asking you what size disks are you using in vg00 (to be willing to extend that much there is need of extra disks...)
My concern is more like "In case of crash or in need of recovery from an ignite image, how long will it take, especially when using DAT "
Are you sure you could not move some non system lvols out of vg00 to a new group and mirror that group with your 2 new disks?
Many of us tend to keep vg00 at a strict minimum - system that is...

All the best
Victor
Torsten.
Acclaimed Contributor

Re: Extending & mirroring existing lvol to new disks

1) do you really need the disks in vg00 or is it better to create a vg01?

2) while mirroring, you specify the disk (see above), but how about creating the lvol? where is it created?

- create an empty lvol
- extend it to a specific disk
- mirror it to another disk

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Timo J
Frequent Advisor

Re: Extending & mirroring existing lvol to new disks


Judging from your answers, easiest way is to create new vg and add those two new disks to it. Because the file system that needs to be extended is /opt, I could create /opt2 or similar to new vg and so on.
N/A
Torsten.
Acclaimed Contributor

Re: Extending & mirroring existing lvol to new disks

/opt should be in vg00 for several reasons.

If you have other non standard directories on the first disks, you should consider to move them to the new vg and extend /opt on the boot disks.
Otherwise it could be better to include the new disks into vg00.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
F Verschuren
Esteemed Contributor

Re: Extending & mirroring existing lvol to new disks

if you do a du -ks /opt |sort -n
than you see the largest product, normaly I tahn create a new lvol:
/opt/aplication

ps if you create a new vg do not forget to alsow put it in the ignite backup els you do not have a goot bootble backup of the os...
Victor BERRIDGE
Honored Contributor

Re: Extending & mirroring existing lvol to new disks

What I do is create an filesystem for each (big) soft:
ant:/opt $ bdf|grep opt
/dev/vg00/lvol6 3481600 2599755 827935 76% /opt
/dev/esvg01/lvol5 819200 430368 364543 54% /opt/patrol
/dev/vg00/lvol12 900000 681962 204718 77% /opt/java
/dev/esvg03/lvol10 3080192 2256585 772159 75% /opt/sas/9.1.3
ran:/tmp2/tsmcli-5.2.2 $ bdf |grep opt
/dev/esvg01/lvol7 266240 40045 212060 16% /var/opt/tipix/tipprd
/dev/esvg02/lvol7 1048576 144101 847996 15% /var/opt/pvcs
/dev/esvg02/lvol3 901120 18975 827604 2% /var/opt/app/frec
/dev/esvg01/lvol5 884736 226757 617036 27% /var/opt/app/fprd
/dev/vg00/lvol9 2527232 1782444 698278 72% /opt
/dev/esvg02/lvol5 163840 118366 42643 74% /opt/tipix/tiprec
/dev/esvg01/lvol8 172032 88267 80761 52% /opt/tipix/tipprd
/dev/esvg02/lvol6 98304 19087 74311 20% /opt/recxcmon
/dev/esvg01/lvol9 98304 19152 74248 21% /opt/prodxcmon
/dev/vg00/lvol12 307200 247244 56306 81% /opt/patrol
/dev/esvg01/lvol10 540672 75532 437684 15% /opt/ctm
/dev/esvg02/lvol4 966656 771482 183034 81% /opt/app/frec
/dev/esvg01/lvol6 770048 680769 89279 88% /opt/app/fprd

On an old system...
aco $ bdf|grep opt
/dev/r5vg02/lvol4 512000 250086 247139 50% /var/opt/oracle
/dev/r5vg02/lvol5 512000 206060 286824 42% /var/opt/app/budget
/dev/vg00/lvol6 819200 516985 283346 65% /opt
/dev/r5vg02/lvol1 307200 121834 173833 41% /opt/tux64
/dev/r5vg01/lvol12 2048000 253300 1690675 13% /opt/patrol
/dev/r5vg01/lvol1 258048 75983 171369 31% /opt/oracle
/dev/r5vg01/lvol13 3072000 1907054 1092161 64% /opt/oracle/product/8.1.7
/dev/r5vg02/lvol8 3072000 1456082 1514979 49% /opt/oracle/product/8.1.6
/dev/r5vg01/lvol8 819200 734189 79762 90% /opt/oracle/product/8.0.4
/dev/r5vg01/lvol6 307200 164500 133787 55% /opt/natstar
/dev/r5vg01/lvol5 307200 179019 120204 60% /opt/app/budget
/dev/r5vg01/lvol7 770048 44091 680697 6% /opt/ctm/ctmagent
...
And like when the soft is not used anymore I recycle the space...

All the best
Victor
Sandman!
Honored Contributor

Re: Extending & mirroring existing lvol to new disks

To mirror such that all extents of lvol1 are mirrored to lvol2 and all extents of lvol3 are mirrored to lvol4 you would need to break the mirrors and start all over again. Create PVGs in the /etc/lvmpvg file keeping disk1 and disk3 in one PVG and disk2 and disk4 in the other PVG. For example:

# cat /etc/lvmpvg
VG /dev/vg00
PVG PVG0
/dev/dsk/disk1
/dev/dsk/disk3
PVG PVG1
/dev/dsk/disk2
/dev/dsk/disk4

Now create all the lvols as:

# lvcreate -D y -s g -m 1 /dev/vg??

This creates extent-based mirrored stripes which is documented in the lvcreate(1M) manpage. Look under the "-D distributed" option.
Timo J
Frequent Advisor

Re: Extending & mirroring existing lvol to new disks


Thanks for all
N/A