Operating System - HP-UX
1752800 Members
5410 Online
108789 Solutions
New Discussion юеВ

lvextend mirror different extents to different physical disks

 
SOLVED
Go to solution
Cory Gaetz(1)
Advisor

lvextend mirror different extents to different physical disks

Hi Folks,

First thanks for any help. I have a situation where I have to create an identical server to an existing server, right down to the mirroring and how the lvols are setup. Here is an example.

/dev/vg01/lvol1
295 /dev/dsk/c0t0d0 /dev/dsk/c0t2d0
245 /dev/dsk/c0t0d0 /dev/dsk/c0t3d0
910 /dev/dsk/c0t1d0 /dev/dsk/c0t3d0

Can I simply use the following commands:

lvextend -l 295 /dev/vg01/lvol1 /dev/dsk/c0t0d0
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c0t2d0
lvextend -l 245 /dev/vg01/lvol1 /dev/dsk/c0t0d0
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c0t3d0
lvextend -l 910 /dev/vg01/lvol1 /dev/dsk/c0t1d0
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c0t3d0

This looks wrong to me, but I can't figure out how the old sysadmins got the lvols into this shape to start with. Any help is greatly appreciated and rewarded (via points of course)
5 REPLIES 5
Bill Costigan
Honored Contributor

Re: lvextend mirror different extents to different physical disks

You right, that will not work. Once you set the mirror it's set.

I think you'll need to play with PVGs. Try creating a PVG with the first set of disks. then create the lvol with a mirror and -l 295 in that PVG. Modify the PVG to contain the next pair of PVs and extend the lvol another 245 extents using that PVG. etc.

Mridul Shrivastava
Honored Contributor

Re: lvextend mirror different extents to different physical disks

Once we mirror the LVOL we just specify the extents by which we want to extend rest is taken care by LVM.
The setup you have on old server might be because of the fact that there were not enough space available to extend/ mirror the LV hence the only option is to add the new disk.
If you want to confirm this fact you can check the PE to LE mapping for this LV and the picture will be clear.
Time has a wonderful way of weeding out the trivial
psreedhar
Frequent Advisor
Solution

Re: lvextend mirror different extents to different physical disks

Hi,
you have a way to do it :)

Create a LV with zero size and one mirror.
lvcreate -m 1 /dev/vg01
Next extend the LV to 295 extents.
You can't extend a LV which has a mirror using one PV. You need to provide two PVs.
lvextend -l 295 /dev/vg01/lvol1 /dev/dsk/c0t0d0 /dev/dsk/c0t2d0
Next extend LV by 245 extents.
So the final size has to be 295 + 245 = 540
lvextend -l 540 /dev/vg01/lvol1 /dev/dsk/c0t0d0 /dev/dsk/c0t3d0

Finally extend in with next 910 extents.
So the final size is 910 + 540 = 1460
lvextend -l 1460 /dev/vg01/lvol1 /dev/dsk/c0t1d0 /dev/dsk/c0t3d0

I hope this will solve your problem :)
Siju Vadakkan
Trusted Contributor

Re: lvextend mirror different extents to different physical disks

Provide the following out put:
1. strings /etc/lvmtab
2. more /etc/lvmpvg
3. vgdisplay -v vg01
4. lvdisplay -v /dev/vg01/lvol1 (for all LV's in the VG)
Cory Gaetz(1)
Advisor

Re: lvextend mirror different extents to different physical disks

Thanks for all the answers folks. My PM has decided it doesn't need to be identical so I'm going to create the lvols in a much more appropriate manner on the new box.