Operating System - HP-UX
1834163 Members
2468 Online
110064 Solutions
New Discussion

Re: Extending logical volume with new LUN's

 
SOLVED
Go to solution
Brendan Newport
Frequent Advisor

Extending logical volume with new LUN's

I thought I knew LVM...ho hum!

I have a twin-node ServiceGuard cluster with two FC30 arrays seperated over a kilometre. Data on the primary (active) node's array is mirrored onto the other (redundant) nodes array.

I recently defined a new LUN on each array, and added the LUN's to a volume group (don't worry about the vg exporting and importing stuff, which has been done.)

I'd like to extend a few LV's in the same volume group, using the space from the new LUN, and ensure that new space is mirrored to the LUN in the redundant nodes array.

But I can't work out the syntax for the commands necessary.

Physical volume groups are established;

--- Physical volume groups ---
PVG Name nike_kl
PV Name /dev/dsk/c0t3d1
PV Name /dev/dsk/c0t3d3
PV Name /dev/dsk/c1t3d0
PV Name /dev/dsk/c1t3d2

PVG Name nike_ro
PV Name /dev/dsk/c1t4d1
PV Name /dev/dsk/c1t4d3
PV Name /dev/dsk/c0t4d0
PV Name /dev/dsk/c0t4d2

The logical volumes at present have just one LUN in use, i.e.;

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t3d0 11268 11268
/dev/dsk/c0t4d0 11268 11268 (this is the LUN on the array attached to the redundant node.)

The new LUN I want to use is defined as;

/dev/dsk/c1t3d2
/dev/dsk/c0t4d2 (the LUN on the array attached to the redundant node)

So the question is;

how do I extend a logical volume with the new LUN, and ensure that the new LUN is mirrored to the identical LUN on the redundant node's mirror, in other words, use /dev/dsk/c1t3d2, and ensure its extents are mirrored at /dev/dsk/c0t4d2, whilst retaining the current LUN already in use and its mirror?

In essence, I want to extend /dev/vgxx/lvolxx using /dev/dsk/c1t3d2 and ensuring extents on that LUN are mirrored to /dev/dsk/c0t4d2.

Thanks in anticipation,


Brendan


"It doesn't have to be like this. All we need to do is make sure we keep talking"(Dave Gilmour)
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Extending logical volume with new LUN's

Hi Brendan:

Try:

# lvextend -L /dev/vgxx/lvolxx /dev/dsk/c1t3d2

# lvexend -m 1 /dev/vgxx/lvolxx /dev/dsk/c0t4d2

...JRF...

Laurent Paumier
Trusted Contributor
Solution

Re: Extending logical volume with new LUN's

If the lvol is already mirrored, you should be able to do it with :

lvextend -l /dev/vgxx/lvolxx /dev/dsk/c1t3d2 /dev/dsk/c0t4d2
Carsten Krege
Honored Contributor

Re: Extending logical volume with new LUN's

You already setup physical volume groups. That is good, but you need to make sure that the logical volume uses the allocation policy pvg-strict (lvchange -s g /dev/vgXX/lvolY).

If you did this LVM will make sure that the master copy and the mirror copy are always located in different PVGs. Therefore it is enough to simply do the following:

# lvcreate /dev/vgXX
# lvchange -s g /dev/vgXX/lvolY
# lvextend -m 1 /dev/vgXX/lvolY
# lvextend -l /dev/vgXX/lvolY

If you want to be very sure that the extents are only allocated from the disks /dev/dsk/c1t3d2 and /dev/dsk/c0t4d2 you can specify them in the lvextend command:

# lvcreate /dev/vgXX
# lvchange -s g /dev/vgXX/lvolY
# lvextend -m 1 /dev/vgXX/lvolY
# lvextend -l /dev/vgXX/lvolY /dev/dsk/c1t3d2 /dev/dsk/c0t4d2

This will allocate the extents from these two disks only. You don't even need to set the PVG-strict allocation policy for this (strict(=default) is sufficient).

Carsten

-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Brendan Newport
Frequent Advisor

Re: Extending logical volume with new LUN's

Ah,
now all I needed was confirmation that my first thought was good. Laurent got there first, and lo, I have two logical volumes extended and allocation mirrored correctly.

Now of course, having done that, the DBA asks for a new logical volume to be created...

ho hum.

Thanks to all who contributed.
"It doesn't have to be like this. All we need to do is make sure we keep talking"(Dave Gilmour)