Thursday, January 19, 2012

lvextend: Not enough free physical extents available.

Today while extending the one of the file system I got below error

# lvextend -L 12288M /dev/vg01/lvol3

lvextend: Not enough free physical extents available.

Logical volume "/dev/vg01/lvol3" could not be extended.


Lets see what is the problem to extend the lv. when I checked the vg details there are lot of free extents available.

# vgdisplay -v /dev/vg01

--- Volume groups ---

VG Name                     /dev/vg01

VG Write Access             read/write

VG Status                   available, exclusive

Max LV                      255

Cur LV                      5

Open LV                     5

Max PV                      255

Cur PV                      2

Act PV                      2

Max PE per PV               1919

VGDA                        4

PE Size (Mbytes)            32

Total PE                    3838

Alloc PE                    1253

Free PE                     2585
Total PVG                   0

Total Spare PVs             0

Total Spare PVs in use      0

VG Version                  1.0

VG Max Size                 15659040m

VG Max Extents              489345

   --- Physical volumes ---

   PV Name                     /dev/disk/disk694

   PV Status                   available

   Total PE                    1919

   Free PE                     666

   Autoswitch                  On

   Proactive Polling           On

   PV Name                     /dev/disk/disk4180

   PV Status                   available

   Total PE                    1919

   Free PE                     1919

   Autoswitch                  On

   Proactive Polling           On

Then what will be the problem. Let's see the lv details

# lvdisplay -v /dev/vg01/lvol1

--- Logical volumes ---

LV Name                     /dev/vg01/lvol1

VG Name                     /dev/vg01

LV Permission               read/write

LV Status                   available/syncd

Mirror copies               0

Consistency Recovery        MWC

Schedule                    parallel

LV Size (Mbytes)            2016

Current LE                  63

Allocated PE                63

Stripes                     0

Stripe Size (Kbytes)        0

Bad block                   NONE

Allocation                  PVG-strict

IO Timeout (Seconds)        default

 Allocation policy is PVG strict and it seems to be the issue. Then I have checked  whether the disks in this particular VG  exists in any of the pvgs defined.




#grep -e disk694 -e disk4180 /etclvmpvg
#

No. it's not there . I have modified the Allocation policy to strict and extended the LV.

Modifying allocation policy.

# lvchange -s y /dev/vg01/lvol3

Logical volume "/dev/vg01/lvol3" has been successfully changed.

Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf


Then extend the LV as usual.

# lvdisplay /dev/vg01/lvol3

--- Logical volumes ---

LV Name                     /dev/vg01/lvol3

VG Name                     /dev/vg01

LV Permission               read/write

LV Status                   available/syncd

Mirror copies               0

Consistency Recovery        MWC

Schedule                    parallel

LV Size (Mbytes)            10016

Current LE                  313

Allocated PE                313


Stripes                     0

Stripe Size (Kbytes)        0

Bad block                   NONE

Allocation                  strict

IO Timeout (Seconds)        default

Note:- If you still want the PVG-Strict  allocation policy , create a temporary PVG in /etc/lvmpvg and modify the allocation policy using "lvchange -s g  /dev/vg01/lvol3" . Then remove temporary PVG.

No comments:

Post a Comment