Operating System - HP-UX
1753408 Members
7176 Online
108793 Solutions
New Discussion юеВ

Re: How do I add another mirrored pair of PV's to an exisitng LV

 
SOLVED
Go to solution
Tony Williams
Regular Advisor

How do I add another mirrored pair of PV's to an exisitng LV

I have a logiial volume in vg00 lvol3 which is the root partition it is now 97% full. We have a L-Class server in which vg00 is setup on two 18.2GB disks. There are two more internal 18.2Gb disks unused. I know how to add an additional disk to the volume group and extend lvol3 to it. How do I mirror the 4th disk that volume? The current configuration is:

lvol3 Mirror
c1t2d0 c2t2d0

The new configuration would be:

lvol3 Mirror
c1t2d0 c2t2d0
c1t0d0 c2t0d0
9 REPLIES 9
Rajeev Tyagi
Valued Contributor
Solution

Re: How do I add another mirrored pair of PV's to an exisitng LV

Tony,

You can create mirror with following command

lvextend -m 2 /dev/vg00/lvol3 /dev/dsk/c2t0d0
lvextend -m 3 /dev/vg00/lvol3 /dev/dsk/c2t0d0


Tony Williams
Regular Advisor

Re: How do I add another mirrored pair of PV's to an exisitng LV

Thanks I thought that was it but it's always nice to have some confirmation. I'll give it a try during our off hours.
Patrick Wallek
Honored Contributor

Re: How do I add another mirrored pair of PV's to an exisitng LV

You will NOT be able to extend your / (lvol3) partition to the other 2 disks. That just ain't going to happen as / absolutely MUST be contiguous, which means that ALL extents must be sequential on the disk. Actually, lvols1 2 and 3 (/stand, Pri. Swap, and /) must all be that way.

Here is something you could try, though I'd have a good Ignite backup before I start.

Do a pvdisplay on the original disks and determine what LV follows lvol3. It should be lvol4, but it never hurts to check.

Now, have a look at the pvmove command and try moving /dev/vg00/lvol4 to the other disks . You will have to do this twice since you must do lvol4 from each original PV separately. When that is done you can then try to extend your / LV.

Here are the steps you can try:

# pvmove /dev/vg00/lvol4 /dev/dsk/c1t2d0 /dev/dsk/c1t0d0
pvmove /dev/vg00/lvol4 /dev/dsk/c2t2d0 /dev/dsk/c2t0d0
# lvextend -L new_size_in_MB /dev/vg00/lvol3
# fsadm -b new_sizem /
(for example 'fsadm -b 128m /')

Note that this is just and idea. I HAVE NEVER tried this. Do some research on the commands (ie. read the man pages) before you execute them to make sure I got the syntax correct.
Patrick Wallek
Honored Contributor

Re: How do I add another mirrored pair of PV's to an exisitng LV

In looking at Rajeevs response, that will just create a 3rd and 4th mirror copy of whatever LV you put in the lvextend command. I don't think that's what you want.

What you should do first is use vgextend to add the disks to the VG.

# vgextend vg00 /dev/dsk/c1t0d0 /dev/dsk/c2t0d0

Then you can try what I suggested in my reply above if you really want to.

The only real supported way to extend /, /stand and pri. swap is to use Ignite/UX.
Tony Williams
Regular Advisor

Re: How do I add another mirrored pair of PV's to an exisitng LV

Thanks Patrick, you are correct. The lvextend failed because of the strict and contiguous policy on lvol3. We don't have another lvol following lvol3. When we install our systems we remove lvols 4 thru 7 we follow the concept of large filesystems. Our data filesystems are 12TB soon to be 32TB. I knew abouth the contiguous policy but I assumed (wrongly) that becuase lvol3 was had the last physical extents that it would allow me to do it. I mean Ignite does the same thing when it extends lvols across multiple disks.

At any rate I would still like to know the procedure for mirroring a 4th disk against a 3rd disk in a lvol.
Patrick Wallek
Honored Contributor

Re: How do I add another mirrored pair of PV's to an exisitng LV

My personal feeling is that having a large / partition is a really bad idea. But that's just me.

I'm not sure I quite understand what you mean by "mirroring a 4th disk against a 3rd disk in a lvol".

You must remember that physical volumes ARE NOT mirrored. Logical Volumes ARE mirrored.

If you want another mirror copy of a logical volume, you just do an 'lvextend -m 2 /dev/vg??/lvol?? /dev/dsk/c?t?d?'. That will give you 3 copies of the LVOL (the orig. plus 2 mirrors). If you want 4 copies (orig plus 3 mirrors) then you just change the 2 to a 3 in the command above.

The PV must be part of the VG before you do that.

If you want something different, you are going to have to explain a bit more clearly what you want.
Tony Williams
Regular Advisor

Re: How do I add another mirrored pair of PV's to an exisitng LV

We have a large number of Oracle and SAP applications and befor we went to large filesystems all of the administrators spent a third of their time administering filesystems becuase the apps grow very quickly. The applications still grow quickly but since we have gone to large filesystems we never administer filesystems. Large filesystems are also a great aid in consolidating servers. We have an Itanium Superdome with 70 applications as opposed to 70 servers with one application. The performance advantages of large filesystems on large disk arrays are really hard to beat.

I think my question was answered but I just wanted to be sure. If you have a lvol that is full and laready mirrored and you add another disk to the volume group:

Befor
lvol3 ===> Mirror
c1t2d0===> c2t2d0

After
lvol3 ===> Mirror
c1t2d0===> c2t2d0
c1t0d0===> c2t0d0

you would:
1. pvcreate your disk
2. vgextend the disk into the volume group
3. lvextend the logical volume
4. lvextend -m 2 /dev/vgxx/lvolx /newdisk

The 4the step is where I was getting confused. I didn't know exactly how to mirror the extended logical volume to a 2nd mirrored disk.


Patrick Wallek
Honored Contributor

Re: How do I add another mirrored pair of PV's to an exisitng LV

Ahh...I see where you are getting confused.

You generally don't need to worry about the mirroring when extending a logical volume. This is especially true if you have PV-Strict mirroring turned on, which is the default.

When you extend a mirrored LV, LVM will automatically look for the appropriate amount of space so that everything will be extended, the orig and the mirror.

There is nothing else you need to do other than 'lvextend -L New_Size_in_MB /dev/vg??/lvol??'

After that do an 'lvdisplay -v /dev/vg??/lvol??' to see the new layout.


If the admins were spending that much time administering filesystems, then something is wrong with the way the filesystems were originally constructed. One of the problems with a large / volume is just what you are seeing now. You are somewhat limited in how you can grow this LV. Another problem I can see is that if you ever fill this up, accidentally or otherwise, then you are in trouble!
Rajeev Tyagi
Valued Contributor

Re: How do I add another mirrored pair of PV's to an exisitng LV

Tony,

For Logical volume spanning on multiple disks you can do this by PVG strict mirroring and then extend logical volume. Please look at this thread

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=466827