I'm fairly new to ubuntu server and I want to extend my partition.

I ran sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL and got the following result:

NAME                      FSTYPE       SIZE MOUNTPOINT        LABEL
loop0                     squashfs    69.8M /snap/lxd/19032   
loop1                     squashfs    69.9M /snap/lxd/19188   
loop2                     squashfs    32.3M /snap/snapd/11107 
loop3                     squashfs    55.5M /snap/core18/1988 
loop4                     squashfs    31.1M /snap/snapd/11036 
loop6                     squashfs    55.4M /snap/core18/1944 
loop7                     squashfs    31.1M                   
sda                                    2.7T                   
├─sda1                    vfat         512M /boot/efi         
├─sda2                    ext4           1G /boot             
└─sda3                    LVM2_member  2.7T                   
  └─ubuntu--vg-ubuntu--lv ext4         200G /                 
sr0                                   1024M    

As you can see sda3 has 2.7T of storage and ubuntu--vg-ubuntu--lvonly uses 200G.
Is there an easy way to give ubuntu--vg-ubuntu--lv more storage?
I've read about gparted but this looks quite sus to me.

  • 1
    Why do you think gparted isn't trustworthy? – TheWanderer Mar 7 at 22:36
  • Their website looks like it's created 400 b.c. I know there are a lot of good tools that have a website like that but I just not like to trust them. – Erich Vogel Mar 20 at 15:38
  • almost every website for these open source and widely trusted tools look like that. It's when a site is super fancy with bad grammar that you should be cautious. – TheWanderer Mar 20 at 20:48

If the volume group is already defined as being 2.7TB in size, you can extend the logical volume and allocate everything with just four commands. Here’s how:

  1. Open Terminal, if it’s not already open
  2. Extend) the logical volume by telling the LVM that the physical partition size has changed:
    sudo pvresize /dev/sda3
  3. Find the actual path of the LVM logical volume:
    sudo lvdisplay 
  4. Instruct the LVM to extend the logical volume to use all of the new partition size:
    sudo lvextend -l +100%FREE /dev/ubuntu--vg/ubuntu--lv
    Note: Be sure to change the path to match the proper one from point 2.
  5. Resize the file system to use all of that new space:
    sudo resize2fs /dev/ubuntu--vg/ubuntu--lv

This should give you a 2.7TB ext4-formatted partition 👍🏻

  • Works very well. Thank you very much for the explanation – Erich Vogel Mar 7 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.