0

Hi ServerFault Community.

To this volume group:

  --- Volume group ---
  VG Name               virtual-machines
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  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               117,18 GiB
  PE Size               4,00 MiB
  Total PE              29999
  Alloc PE / Size       25600 / 100,00 GiB
  Free  PE / Size       4399 / 17,18 GiB
  VG UUID               iXdHIW-f7eR-aAb2-DHxR-ybAv-dQCy-oBA1Um

containing this logical volume

  --- Logical volume ---
  LV Name                /dev/virtual-machines/win7x64
  VG Name                virtual-machines
  LV UUID                2CXriq-v3M2-dVkG-j8JI-dGUD-yyph-r9waRs
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                100,00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

I'd like to add another logical volume via

lvcreate -L 100G -n win7x64-gaming virtual-machines

but it says

Insufficient free extents (4399) in volume group virtual-machines: 25600 required

So i thought of resizing the vg but I did not find anything like vgresize. How could I manage to add this new lv?

EDIT: I took an empty HDD and just called lvcreate so I assume the following is interesting for you.

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               virtual-machines
  PV Size               117,19 GiB / not usable 4,00 MiB
  Allocatable           yes 
  PE Size               4,00 MiB
  Total PE              29999
  Free PE               4399
  Allocated PE          25600
  PV UUID               iXZ9sf-UMnI-azYF-2h0v-dCt3-44GB-NwT7v9

1 Answer 1

2

"but I did not find anything like vgresize" -> It does exists and it's named vgextend

Edit : If I guess correctly, You already have one disk /dev/sdb1, one vg called virtual-machines and one LV win7x64. Now you want to create another 100G LV but there is not enouch space, so you want to add another disk.

  • Step 1 : Identify the new disk. You can for example try dmesg.
  • Step 2 : Create a PV on the new disk (or on a partition of the new disk). Use pvcreate for this.

  • Step 3 : Add new PV to existing VG using vgextend

  • Step 4 : Create the new LV with your command above.
11
  • Doesn't this only work for physical volumes?
    – lug
    Aug 18, 2012 at 13:10
  • What is your question? Vgextend lets you add physical volumes in existing vg.
    – user130370
    Aug 18, 2012 at 13:28
  • added information to my question, maybe useful?!
    – lug
    Aug 18, 2012 at 13:41
  • NO :( : "I took an empty HDD" -> what's its name? /dev/sdb1? Doesn't seem as it's not empty. I'll update the answer with what I guess.
    – user130370
    Aug 18, 2012 at 13:47
  • 1
    Yes. Best is to use entire disk at the beginning. pvresize qnd fdisk can be used as a workaround afterward (as always, make sure you have backups before).
    – user130370
    Aug 18, 2012 at 16:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .