Operating System - HP-UX
1753797 Members
8148 Online
108805 Solutions
New Discussion юеВ

extend lv gives failure cause by strict allocation policy. ?

 
SOLVED
Go to solution
Sammy_2
Super Advisor

extend lv gives failure cause by strict allocation policy. ?

I am trying to lvextend a lv which has lots of free extents in (vgprod2) vg ? I get message in the subject. How can i get around it.?
Don't see any /etc/lvmpvg file




#ll /etc/lvmpvg
/etc/lvmpvg not found



Here is all the info. I could muster.
# lvextend -L 10000 /dev/vgprod2/lvol8
lvextend: Not enough free physical extents available.
Logical volume "/dev/vgprod2/lvol8" could not be extended.
Failure possibly caused by strict allocation policy

# lvdisplay /dev/vgprod2/lvol8
--- Logical volumes ---
LV Name /dev/vgprod2/lvol8
VG Name /dev/vgprod2
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 6500
Current LE 1625
Allocated PE 3250
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default



# vgdisplay -v vgprod2|more
--- Volume groups ---
VG Name /dev/vgprod2
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 9
Open LV 9
Max PV 16
Cur PV 6
Act PV 6
Max PE per PV 4341
VGDA 12
PE Size (Mbytes) 4
Total PE 26040
Alloc PE 23288
Free PE 2752
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c2t11d0 1625 1625
/dev/dsk/c6t11d0 1625 1625


# pvdisplay /dev/dsk/c2t11d0|more
--- Physical volumes ---
PV Name /dev/dsk/c2t11d0
VG Name /dev/vgprod2
PV Status available
Allocatable yes
VGDA 2
Cur LV 2
PE Size (Mbytes) 4
Total PE 4340
Free PE 0
Allocated PE 4340
Stale PE 0
IO Timeout default
Autoswitch On



# pvdisplay /dev/dsk/c6t11d0|more
--- Physical volumes ---
PV Name /dev/dsk/c6t11d0
VG Name /dev/vgprod2
PV Status available
Allocatable yes
VGDA 2
Cur LV 3
PE Size (Mbytes) 4
Total PE 4340
Free PE 216
Allocated PE 4124
Stale PE 0
IO Timeout default
Autoswitch On


good judgement comes from experience and experience comes from bad judgement.
9 REPLIES 9
Pete Randall
Outstanding Contributor
Solution

Re: extend lv gives failure cause by strict allocation policy. ?

The logical volume is mirrored, meaning it has to find free space on both physical volumes, and /dev/dsk/c2t11d0 shows Free PE 0. That is why you're failing. If you don't need this mirror, you can get rid of it and then extend the lvol, otherwise you're going to have to add some disk space.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: extend lv gives failure cause by strict allocation policy. ?

This means that while you may have enough free extents available in the VG to extend the LVOL, there are not enough FREE PE's on separate PV's to allow the LVOL to expand so that the mirrors will be on separate disks.
If it ain't broke, I can fix that.
Sammy_2
Super Advisor

Re: extend lv gives failure cause by strict allocation policy. ?

I have additional disks. What is the command to add 2 additional disks to this LV so I can add disk space and get mirroring done too ?
Is this because of strict policy that I can't extend even though I have space on VG. ?
Thanks
good judgement comes from experience and experience comes from bad judgement.
A. Clay Stephenson
Acclaimed Contributor

Re: extend lv gives failure cause by strict allocation policy. ?

You first issue a pvcreate for both of these new disks. You then issue a vgextend to extend the VG. You should then be able to issue an lvextend. The lvextend command allows you to specify the disks on which you wish to extend but if you add the disks, I doubt that you will need to. Man pvcreate, vgextend, and lvextend for details. NOTE: If these new disks are larger than your largest existing disk currently in the VG then unless you intentionally created this VG with additional MAX PE's then you are only going to be able to use as much of each additional disk as your largest existing PV.
If it ain't broke, I can fix that.
Matthew_50
Valued Contributor

Re: extend lv gives failure cause by strict allocation policy. ?

from the information which you give us, some of logical volum have mirror copy, but some didn't, if your data considerate is important, strongly recommand that check all your logical volume.
Nguyen Anh Tien
Honored Contributor

Re: extend lv gives failure cause by strict allocation policy. ?

hmm.
You both pv are not same size
let see:
# pvdisplay /dev/dsk/c2t11d0|more
Total PE 4340
Free PE 0

# pvdisplay /dev/dsk/c6t11d0|more
Total PE 4340
Free PE 216

and dev/vgprod2/lvol8 are mirrored 1 copy
# lvdisplay /dev/vgprod2/lvol8
--- Logical volumes ---
LV Name /dev/vgprod2/lvol8
VG Name /dev/vgprod2
LV Permission read/write
LV Status available/syncd
Mirror copies 1

YOUR CURRENT CASE IS THAT ONE PV IS ENOUGHT SPACE TO EXTEND AND ONOTHER DOESNT.
SO IF YOU WANT TO EXTEND ONE MORE PV MUST BE ADD TO VG (dev/vgprod2)
HTH
TIENNA
HP is simple
Devender Khatana
Honored Contributor

Re: extend lv gives failure cause by strict allocation policy. ?

Hi,

Strict allocation policy is causing this. It means that it will not allow to have two copies of same LE on same disk. One copy will be on one disk & other copy on second disk. The second disk here do not have free space & that is the error indicating too. For adding new disks to VG.

#pvcreate /dev/cxtydz (Repeat for all disk you wish to add)
#vgextend /dev/vgxx /dev/cxtydz /dev/cx1ty1dz1 .. (Mention all disks you wish to add to VG)

But from the above outputs your current VG will access only 17364 MB space on any new disks. So if you wish to add 36/72GB space you will be using only 17 GB of that in current VG & rest will be waste. So if new disk size is higher go for creating a new Vg rather then extending this & then move LV's having backup.

HTH,
Devender
Impossible itself mentions "I m possible"
Babu A
Frequent Advisor

Re: extend lv gives failure cause by strict allocation policy. ?

Hi Sammy,

As /dev/vgprod2/lvol8 is mirrored, you need to have free space on both the disks (equal in size for extending, for
example, if you need to extend the LV by 10GB, then you need to have 10GB free space in both /dev/dsk/c2t11d0 & /dev/dsk/c6t11d0) to extend the LV lvol8 or you need look for the other PVs in the VG.

But in your case the c2t11d0 has no free PEs, whereas the disk c6t11d0 has 864MB. Also you have only 11GB free space in
the vgprod2. You can not extend lovl8 by 10GB, which is mirrored.

Even if you disable the strict allocation, it is not possible to extend the LV by 10GB with the current free space in
vgprod2.

You need to add two more PVs to vgprod2 to extend the lvol8.

So, you need to add two more PVs in the same VG, and extend the LV.

Do pvcreate and extend the VG to the new_disk1 & new_disk2

# vgextend /dev/vgprod2 /dev/dsk/new_disk1 /dev/dsk/new_disk2

# lvextend -L 10000 /dev/vgprod2/lvol8 /dev/dsk/new_disk1 /dev/dsk/new_disk2

regards,

Babu
Sammy_2
Super Advisor

Re: extend lv gives failure cause by strict allocation policy. ?

Devender-Thanks for strict all. policy clarification and big disk wastage.
babu- I broke the mirror and lvextend the LV size and fs.
Nguyen and Pete and same good suggestion but Pete was the first one to respond with correct answer and thus get full points.
clay- I got your point and decided to take easy route of break mirror, and extend. I will
do what you mentioned of adding disk soon. good tip.
"

Thanks to all
good judgement comes from experience and experience comes from bad judgement.