Extending LVM partition on Debian/Virtualbox

5,671

Try

lvextend -l +100%FREE /dev/private2/root

This command should work for you.

Share:
5,671

Related videos on Youtube

EddyR
Author by

EddyR

Updated on September 18, 2022

Comments

  • EddyR
    EddyR over 1 year

    I've just resized the Virtual Space on VirtualBox image 5G to 15G. I then used GParted to resize the physical partition which now looks like this:

    enter image description here

    and using fdisk command:

    Disk /dev/sda: 16.1 GB, 16106127360 bytes
    255 heads, 63 sectors/track, 1958 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0009221c
    
    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          32      248832   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              32        1959    15477761    5  Extended
    /dev/sda5              32         689     5280768   8e  Linux LVM
    

    The problem is I can't find any examples for resizing the LVM partition that look similar to this or on Debian.

    Most examples look something like this but I'm not exactly sure

    pvresize /dev/sda5
    pvscan
    lvextend -L +10G /dev/? /dev/sda5
    resize2fs /dev/?/lv_root
    

    Update

    So I figured out the correct command is:

    lvextend -L +10G /dev/private2/root
    

    Which gives now gives error message:

    Extending logical volume root to 14.78 GiB
    Insufficient free space: 2560 extents needed, but only 0 available