1836598 Members
1845 Online
110102 Solutions
New Discussion

lvextend with strict

 
SOLVED
Go to solution
Scott Van Kalken
Esteemed Contributor

lvextend with strict

hey all....

below is some output from a machine today:

--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4342
VGDA 4
PE Size (Mbytes) 4
Total PE 8680
Alloc PE 8418
Free PE 262
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0


--- Logical volumes ---
LV Name /dev/vg01/lvol7
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 400
Current LE 100
Allocated PE 200
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

[root@] /-> lvextend -L 450 /dev/vg01/lvol7
Warning: rounding up logical volume size to extent boundary at size "452" MB.
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg01/lvol7" could not be extended.
Failure possibly caused by strict allocation policy


Ok,

I know what it all means. What I need some advice on is how to get the extra stuff from those disks configured into a logical volume.

I know I can turn off strict policy, but I'm not sure I want to do that because that menas if we have a disk failure (mirrored sets only) we could lose data.

Apart from destroying all of vg01 and recreating, then restoring from a nice backup tape.... any ideas?

thanks in advance

Scott.
7 REPLIES 7
Steven Sim Kok Leong
Honored Contributor
Solution

Re: lvextend with strict

Hi,

After you turn off strict policy using lvchange, you can lvextend to a specific PV. You will need to document the mapping of LVs on each disk and plan ahead so that if the primary copy of a mirror fails, the mirror copy can take over without risk of any data loss.

In my environment, I don't use the strict policy. However, I make sure that the LV is created or extended on the PV I want it to be by specifying the PV I want the LV to be extended to eg.

lvextend -L 450 /dev/vg01/lvol7 /dev/dsk/c1t5d0

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: lvextend with strict

Hi,

To add on, you should be able to split the mirrors via lvsplit and extend the primary copy and the mirror copy separately to different PVs you want them to reside (without conflicts) eg.

# lvsplit /dev/vg00/lvol15
# lvextend -L 500 /dev/vg00/lvol15 /dev/dsk/c2t5d0 500 /dev/vg00/lvol15b /dev/dsk/c3t5d0
# lvmerge /dev/vg00/lvol15b /dev/vg00/lvol15
# lvsync /dev/vg00/lvol15

Subsequently lvmerge and lvsync the copies.

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: lvextend with strict

Hi,

Some of my typing was truncated. It should be:

# lvsplit /dev/vg00/lvol15
# lvextend -L 500 /dev/vg00/lvol15 /dev/dsk/c2t5d0
# lvextend -L 500 /dev/vg00/lvol15b /dev/dsk/c3t5d0
# lvmerge /dev/vg00/lvol15b /dev/vg00/lvol15
# lvsync /dev/vg00/lvol15
Steven Sim Kok Leong
Honored Contributor

Re: lvextend with strict

Hi,

Some of my typing was truncated. It should be:

# lvsplit /dev/vg00/lvol15
# lvextend -L 500 /dev/vg00/lvol15 /dev/dsk/c2t5d0
# lvextend -L 500 /dev/vg00/lvol15b /dev/dsk/c3t5d0
# lvmerge /dev/vg00/lvol15b /dev/vg00/lvol15
# lvsync /dev/vg00/lvol15

Hope this helps. Regards.

Steven Sim Kok Leong
Ravi_8
Honored Contributor

Re: lvextend with strict

Hi, Scott

Turninf off the strict allocation policy wouldn't affect the data. Since you have the mirroring the disk space usage will be more as the data will be copied twice.
In my case i never set strict allocation policy and since it is vg01 increasing the space never be a problem(umount and lvextend will do the job)

never give up
Trond Haugen
Honored Contributor

Re: lvextend with strict

The output of your commands arn't cocnlusive. What I mean is:
1. Are the two disks the same size?
2. Are all the volumes on vg01 mirrored?

As you have free space I suspect a volume hasn't been mirrored (that should?). Or have someone "borrowed" space for a non-mirrored volume?

With only two disks and strict policy you will always have the mirror on another disk. As you mentioned having the mirror on the same disk is of little use. With more than two disks I would do like Steven and decide myselves which disk the mirror goes on (strict or not).

Regards,
Tron
Regards,
Trond Haugen
LinkedIn
Steven Sim Kok Leong
Honored Contributor

Re: lvextend with strict

Hi,

I forgot to mention also that you can make use of pvmove to move your LVs from PV to PV with the same VG eg.

# pvmove /dev/vg00/lvol15 /dev/dsk/c4t5d0 /dev/dsk/c5t5d0

If your LVs are scattered around multiple PVs and you want to consolidate them so that the mirror copy can have more PVs to reside on, you can use pvmove. pvmove does not need un-mounting of the filesystem.

Since you can specify the PVs to use using lvextend and move LV to different PVs using pvmove, you can make sure that the mirrory copy works when the primary copy's PV is corrupted because you are making sure that both the primary and the mirror copies use separate PVs from each other. In that sense, manually "stricting" the LVs.

Hope this helps. Regards.

Steven Sim Kok Leong