14

I have just successfully increased my disk size having had help with this question. My set up is Ubuntu Server running in VirtualBox as a web development server. I now have this space:

enter image description here

As you can see /dev/mapper/ubuntu--vg-root is full but I have a a lot more space. How do I go about using the new space to stop disk full errors? I am not even sure where to start looking so any help is great.

3

1 Answer 1

10

/dev/mapper indicates that you're using LVM; so resizing the physical volume is not enough to resize the logical volume contained within, let alone the filesystem.

To increase the filesystem size, I followed these instructions from ServerFault with success:

  1. First, I increased the physical partition using gparted. This was straightforward, and I assume you've already done that. If you don't have access to a LiveCD, you can increase the size of the physical disk while online, via pvresize, as shown in the linked instructions.

  2. Then I used lvresize to grow the logical volume to fill the physical volume. I used pvdisplay to verify the size of the physical volume, and tried using that size.

     sudo lvresize -L 28.82G /dev/ubuntu-tt-vg/root
    

However, it was too large, so I started with 27G, and kept resizing my partition bigger until I hit the max.

  1. Then, I used resize2fs to grow the filesystem inside the logical volume.

     sudo resize2fs /dev/ubuntu-tt-vg/root 7290881
    

Finding the max here was much easier. If you try a number bigger than the max, it will tell you exactly what the max is.

  1. At this point, df -h should show that your filesystem has grown to the new size.
1
  • 3
    Nice tip with 'If you try a number bigger than the max, it will tell you exactly what the max is.', I just went sudo resize2fs /dev/mapper/kubuntu--vg-root 999999999999 as a result.
    – compuphys
    May 6, 2020 at 21:19

You must log in to answer this question.

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