1833553 Members
3459 Online
110061 Solutions
New Discussion

Re: LVM Mirroring

 
SOLVED
Go to solution
Ajaysen Reddy
Advisor

LVM Mirroring

I have disks connected from 2 XP 1024 frames attached to the server runnning HPUX 11.0. I am new to HPUX OS. I have several disks on the server. I want to extend my Logical Volume lvol12 to 28GB.
--- Logical volumes ---
LV Name /dev/vgdncptordb/lvol12
VG Name /dev/vgdncptordb
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 21100
Current LE 5275
Allocated PE 10550
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation PVG-strict/distributed
IO Timeout (Seconds) default

--- Physical volumes ---
PV Name /dev/dsk/c71t2d7
PV Name /dev/dsk/c95t2d7 Alternate Link
VG Name /dev/vgdncptordb
PV Status available
Allocatable yes
VGDA 2
Cur LV 3
PE Size (Mbytes) 4
Total PE 1759
Free PE 879
Allocated PE 880
Stale PE 0
IO Timeout (Seconds) default
Autoswitch Off

The other device /dev/rdsk/c83t2d7 has the exact above specs as /dev/rdskc95t2d7.
I would like to specifically extend the logical volume by mirroring between these two devices.
9 REPLIES 9
john D_3
Frequent Advisor

Re: LVM Mirroring

Hi,

You dont have enough space available on this PV.

Free: 879*4 = 3516/1024 = 3.4G

Existing size is almost 21G. You can add max 3.4G in this LV.
Shardha
Valued Contributor

Re: LVM Mirroring

# pvcreate -f /dev/rdsk/cXtYd0
# vgextend /dev/vg06 /dev/dsk/cXtYd0
# vgdisplay â v vg06
# lvextend -L 5120 /dev/vg06/lvol3
#lvdisplay â v /dev/vg03/lvol3

Umount the file system

# extendfs â F vxfs /dev/vg03/lvol3

Mount the file system

procedure to extend file system in cluster is attached herewith.

Shardha

Mutum
Frequent Advisor

Re: LVM Mirroring

pvcreate -f /dev/rdsk/cXtYd0
# vgextend /dev/vg06 /dev/dsk/cXtYd0
# vgdisplay â  v vg06
# lvextend -L 28000 /dev/vg06/lvol2
#lvdisplay â  v /dev/vg03/lvol2

Umount the file system

# extendfs â  F vxfs /dev/vg03/rlvol2

Mount the file system

to mirror the logical volume after you specify/create the new physical dsk, and extend the physical volume group to include the new dsk you just to do the following:

# lvextend -m 1 /dev/gdncptordb/lvol2
BAGI
Bill Hassell
Honored Contributor

Re: LVM Mirroring

Is there a reason you want to mirror XP 1024 LUNs? They should be more than adequately protected in the array. Note that if you want to add very large LUNs to your volume group, you'll need to delete it and rebuild it with a larger physical extent size (16k or 32k would allow for a lot of expansion). The PE size cannot be changed on an existing volume group.


Bill Hassell, sysadmin
MHudec
Frequent Advisor
Solution

Re: LVM Mirroring

@Ajaysen
Mirroring will not give you additional space, you can only gain 879PE*4M (3516M) here, so no extension to 28G, just to 24G with resources available in the volumegroup.
But from output, you already have mirroring there in lvol12.

If you want to extend to 24G (24616M) then first check with:
# lvdisplay -v /dev/vgdncptordb/lvol12
# vgdisplay -v vgdncptordb

And provide us with output (shorten the lvdisplay -v with piping via more, we want to see basic information with some lines of logical extents mapping between original and mirrored pvol).

Is new c83t2d7 already added to volume group vgdncptordb? Does it have alternate path too?

@Shardha and Mutum
Using extendfs is required if OnlineJFS is not present. If you have OnlineJFS you do not need to unmount filesystem and use extendfs. You can simply use fsadm to extend the filesystem online with no downtime.

Also it might be better practice to use -l and not -L in lvextend. -l (small L) requires number of extents, and not number of MB like -L. -L is not that exact as it works with MB rather than extents, and as such, it might be rounded in calculations during lvextend in progress.

@Bill
You might want to mirror XP luns (we are speaking about mirroring on LVM level, not XP very own one) for example when you have two XPs in different datacenters, so one set is on xp in dc1 and another mirrored set is on xp in dc2. So for example when using something high available, you will not loose storage when dc1 is nuked to ruins and when your high available application is switched to dc2.
Ajaysen Reddy
Advisor

Re: LVM Mirroring

Mehmood: Got your point. However I do have a total of 8 disks each containing 871 PEs. What I am trying to get is - What is the syntax to choose the exact disks that I want to use as Primary and Mirror.

Bill: We have 2 XP 1024 in two separate Datacenters/buildings - We are trying to mirror between the XPs. With out a specific device info, HPUX could mirror on the same XP 1024.

Martin: You Hit right on target - Here is teh information:

-All devices are already in the vgdncptordb:
-Below are the physical volumes with Free PV
-There are 70+ physical Volumes in this vg, however in the below 8 PVs, 4 are from XP Frame1 and the other 4 PVs are form XP Frame2.
-Information on fsadm and how I would use it in this situation would be very helpful.

XP Frame1 PVs (with available disk)
-----------------------------------
PV Name /dev/dsk/c74t2d7
PV Name /dev/dsk/c98t2d7 Alternate Link
Free PE 871
PV Name /dev/dsk/c77t2d7
PV Name /dev/dsk/c101t2d7 Alternate Link
Free PE 871
PV Name /dev/dsk/c80t2d7
PV Name /dev/dsk/c104t2d7 Alternate Link
Free PE 871
PV Name /dev/dsk/c71t2d7
PV Name /dev/dsk/c95t2d7 Alternate Link
Free PE 879


XP Frame2 PVs (with available disk)
-----------------------------------
PV Name /dev/dsk/c86t2d7
PV Name /dev/dsk/c110t2d7 Alternate Link
Free PE 879
PV Name /dev/dsk/c89t2d7
PV Name /dev/dsk/c113t2d7 Alternate Link
Free PE 879
PV Name /dev/dsk/c92t2d7
PV Name /dev/dsk/c116t2d7 Alternate Link
Free PE 879
PV Name /dev/dsk/c83t2d7
PV Name /dev/dsk/c107t2d7 Alternate Link
Free PE 879

Thank you all very much for the responses.
MHudec
Frequent Advisor

Re: LVM Mirroring

Well, I don't know much about logical volume structure there on VG (that is why full vgdisplay -v output would be great, you can attach it here as attachment I think), but for lvol12 you already have pvg-strict/distributed allocation policy. Good, if that's still true as I remember that in other thread here on itrc, you seemed to get advice to get rid of pvg-strict/distributed policy.

I am also assuming that your disks listed in both frames are the only disks used for that lvol12. But nevertheless it would be best to think about whole volumegroup organization before doing anything. So take my advices as they are, and think if they are applicable to your environment.

So first I would group XP frame 1 disks to one PVG (named pvgxpframe1 for example) and XP frame 2 disks to another PVG (named pvgxpframe2).

PVG mapping can be done in /etc/lvmvpg file, just add something like:

VG /dev/vgdncptordb
PVG pvgxpframe1
/dev/dsk/c74t2d7
/dev/dsk/c77t2d7
/dev/dsk/c80t2d7
/dev/dsk/c71t2d7
PVG pvgxpframe2
/dev/dsk/c86t2d7
/dev/dsk/c89t2d7
/dev/dsk/c92t2d7
/dev/dsk/c83t2d7

Then you should see those PVGs in vgdisplay -v output. And then you can extend lvol12, still without mirror, by using:

# lvextend -l /dev/vgdncptordb/lvol12 pvgxpframe1

by this we would get that logical volume extended and distributed on xp frame 1 disks. And then we can mirror them by:

# lvextend -m 1 /dev/vgdncptordb/lvol12 pvgxpframe2

by this we would get mirroring to other xp array.

But before anything, it would be best to see those outputs:

# vgdisplay -v vgdncptordb
# lvdisplay -v /dev/vgdncptordb/lvol12

We could get more precise advices by then. And despite the outputs will be large, you are not working with lvols with 64000 extents, so it is not really that much long :).
Ajaysen Reddy
Advisor

Re: LVM Mirroring

Thank you all for your help. This group is wonderful.

Martin: Your information was excellent and helped me create the LVs. Thanks.
;)) Here is what I got for the
vgdisplay -v dncptordbvg
- 6 lines per LV * 13 = 78
- 6 lines per PV * 68 = 408
- 20 lines for PVGs = 20
+ VG info + Blank lines

lvdisplay -v /dev/vgdncptordb/lvol12
- 10 lines for Disk information
- 7000 lines for LE
- Had to CRTL -C out of it ;))

- Around 7500 lines @ 50 per page = 150 pages.

Have a good one...
MHudec
Frequent Advisor

Re: LVM Mirroring

I am glad to hear that. So I suppose you were able to extend the logical volume in size and also to mirror it to other XP. Great. Though I have my doubts about extents distribution on your logical volume, I hope all is fine.

As for fsadm (which I forgot to reply to), it is quite simple. If you have OnlineJFS on the system, just do:

# fsadm -F vxfs -b

where SIZE is for example 10000M (take size of logical volume) and FS is filesystem, like /usr/appl/data.

Good luck, Martin