-   Linux - Newbie (
-   -   LVM - Extending logical volume - Insufficient free space (

deim 04-07-2007 09:47 PM

LVM - Extending logical volume - Insufficient free space
Hi guys,

I want to merge 2 disks into one logical volume.

Created group with one disk (280GB), and to experiment - created logical volume 250GB:

fileserver:/home # pvdisplay
  --- Physical volume ---
  PV Name              /dev/hdh
  VG Name              archive
  PV Size              279.46 GB / not usable 24.15 MB
  Allocatable          yes
  PE Size (KByte)      32768
  Total PE              8942
  Free PE              942
  Allocated PE          8000
  PV UUID              u8b2Nn-sZxV-Msuh-xHuA-I7bF-TF68-kVAJ7v

  --- NEW Physical volume ---
  PV Name              /dev/hdg
  VG Name
  PV Size              149.05 GB
  Allocatable          NO
  PE Size (KByte)      0
  Total PE              0
  Free PE              0
  Allocated PE          0
  PV UUID              RL6frm-Aaa9-HNpm-wIkO-loAT-ua8Q-mlnvtX


fileserver:/home # vgdisplay
  --- Volume group ---
  VG Name              archive
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  7
  VG Access            read/write
  VG Status            resizable
  MAX LV                0
  Cur LV                1
  Open LV              0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size              279.44 GB
  PE Size              32.00 MB
  Total PE              8942
  Alloc PE / Size      8000 / 250.00 GB
  Free  PE / Size      942 / 29.44 GB
  VG UUID              EXL7F1-ZLGr-WU79-Tc1a-TZin-zHsX-ieduFe


fileserver:/home # lvdisplay
  --- Logical volume ---
  LV Name                /dev/archive/fullarch
  VG Name                archive
  LV UUID                3XfcsV-cI5r-ztEN-v605-AViv-gKkk-qWPt0Z
  LV Write Access        read/write
  LV Status              available
  # open                0
  LV Size                250.00 GB
  Current LE            8000
  Segments              1
  Allocation            inherit
  Read ahead sectors    0
  Block device          253:0

Now, umount it (already done):

# umount /dev/archive/fullarch
umount: /dev/archive/fullarch: not mounted

Now, trying to extend lv to +5GB:


# lvextend -L+5g /dev/archive/fullarch
  Extending logical volume fullarch to 255.00 GB
  Insufficient free space: 8160 extents needed, but only 942 available

...and I'm stuck right here. As far as I understand, LE is equal to PE. And I have total PE - 8942, and of them - free PE 942. So, I'm using only 8000 LE/PE. By extending to +5GB, I want to extend it from 8000 to 8192, and 750 PE/LE will still be free.
I don't get it - why it complains that it needs 8160 and only 942 available, while actually it needs only 160 ADDITIONAL extents?!

I think I'm missing something terribly.

Now, not only I can't resize lv to the second drive, but I can't even resize lv to the full size of first drive.

Oh, forgot to mention - the only thing I've changed from default values when was creating VG - I've changed size of extents from 4MB to 32MB to make it possible to have ~1TB volume.

All times are GMT -5. The time now is 06:53 AM.