"insufficient free space" error when trying to create new logical volume?

7,831

You already had allocated all PE in VG 0 to the logical volume.

Do lvs to find which LV that associated to the VG 0 and find the LV size to compared.

Share:
7,831

Related videos on Youtube

Nate
Author by

Nate

I'm a senior in college, majoring in EE and minoring in CS, with a passion for electronics and programming. I'm an entrepreneur and started a small hobby electronics company called FoxyTronics a few years ago, and am now working on launching a shopping website called PriceWombat.

Updated on September 18, 2022

Comments

  • Nate
    Nate over 1 year

    I have a dedicated server using LVM. I'm following a guide in the Ubuntu docs which says:

    sudo lvcreate -L 10G -n lv_vm_ubuntu /dev/[VGNAME]

    Since my logical volume group name is 0, I tried to create a new logical volume using:

    sudo lvcreate -L 20G -n lv_vm_ubuntu /dev/0
    

    But the following error was output:

    Volume group "0" has insufficient free space (0 extents): 5120 required.
    

    Here's information on my disks:

    sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
    

    Output:

    NAME              FSTYPE              SIZE MOUNTPOINT LABEL
    sda                                 223.6G            
    └─sda1            LVM2_member       223.6G            
      ├─0-swap (dm-0) swap                7.5G [SWAP]     
      └─0-root (dm-1) ext4              216.1G /          
    sdb                                 931.5G            
    └─sdb1            linux_raid_member 931.5G            ubuntu:0
      └─md0           ext4              931.4G /mnt/md0   
    sdc                                 931.5G            
    └─sdc1            linux_raid_member 931.5G            ubuntu:0
      └─md0           ext4              931.4G /mnt/md0   
    

     

    cat /etc/fstab
    

    Output

    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    /dev/mapper/0-root /               ext4    errors=remount-ro 0       1
    # /mnt/md0 was on /dev/md0 during installation
    UUID=bc5a499c-af64-467c-b9af-bc84af26e23c /mnt/md0        ext4    defaults        0       2
    /dev/mapper/0-swap none            swap    sw              0       0
    

     

    vgs
    

    Output:

      VG   #PV #LV #SN Attr   VSize   VFree
      0      1   2   0 wz--n- 223.57g    0 
    

     

    vgdisplay
    

    Output:

      --- Volume group ---
      VG Name               0
      System ID             
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               223.57 GiB
      PE Size               4.00 MiB
      Total PE              57233
      Alloc PE / Size       57233 / 223.57 GiB
      Free  PE / Size       0 / 0   
      VG UUID               RC1AXq-ev6F-ll0T-6COG-9yPU-OaSV-hjeSKB
    

    What am I doing incorrectly?

    UPDATE:

    lvs
    

    Output:

    LV   VG   Attr      LSize   Pool Origin Data%  Move Log Copy%  Convert
    root 0    -wi-ao--- 216.12g                                           
    swap 0    -wi-ao---   7.45g  
    
  • Nate
    Nate over 8 years
    Updated my question with the output of lvs. So are you saying I need to shrink the root logical volume so that I can create the new logical volume under the 0 volume group? Thanks for your help, this is my first time working with LVs.
  • Aizuddin Zali
    Aizuddin Zali over 8 years
    Correct but shrinking rootfs is not something direct. Guide are massively avail from the net. Or if you have free partition or hdd, you can add into the VG for space extension. If this is satisfied, appreciate if you could mark this answered.
  • Nate
    Nate over 8 years
    Hmm.. So it looks like the partition can't be resized while the volume is mounted, so is it even possible to resize it since it's on a server I don't have physical access to? Thanks again.
  • Aizuddin Zali
    Aizuddin Zali over 8 years
    Yes, if you have remote console. Other than that sorry.