Score:1

Proper way to expand storage on Ubuntu running on VirtualBox with Dynamically Allocated storage? Docker keeps running out of space

ve flag

I used the VirtualBox Media Manager to resize the disk from 10gb to 50gb.

I then used GParted Live to expand the partition to 50gb.

When I boot into Ubuntu and run df -h it shows that ‘/dev/mapper/vg_cloud-Log…’ which is mounted on ‘/‘ is at 100% usage.

What do I need to do to get Ubuntu to see all the disk space?

Ps: I’m running Ubuntu without a GUI.

David avatar
cn flag
What version of Ubuntu?
Score:0
ve flag

I was able to fix it using the LVM tools by:

Displaying the logical volume information

sudo lvdisplay

Extending my ubuntu-lv logical volume (yours may be named differently)

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Resizing the file system

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
Score:0
ro flag

For those interested I have expanded on this fix in great detail in this video of my enlarging an Ubuntu Server on virtual box.

I find it helpful to have a virtual machine running ubuntu desktop with all the utilities needed, simply attached your servers virtual hard drive to thi smachine so it can be worked on.

https://youtu.be/Ow5Y4iqe7MQ

IMPORTNAT: This instruction will consume all free space on your VLM!

The following is a summary of what's shown in the video above:

You need Ubuntu Desktop running the following utilities:

apt-get install lvm2

apt-get install gparted

Or a GPARTED LIVE disk with LVM support.

Shut all Vboxes down. Expand virtual disk and attached it to ubuntu desktop virtual machine.

Boot into Ubuntu Desktop with Gparted installed.

Open GPARTED and click FIX on the error that comes up.

Deactivate LVM partition.

Modify partition to max size, there should be 1MB unallocated at the end after doing this. Apply.

Activate the partition again and check for errors.

Open terminal and run super user

sudo -i

Verify that there is free space ready for allocation now:

vgdisplay

Get the path:

lvdisplay

My path is /dev/ubuntu-vg/ubuntu-lv

Fill the unallocated part of the newly expanded partition with LVM

lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

Verify the unallocated space has been consumed:

vgdisplay

MOUNT THE DRIVE UNDER DISKS NOW

Resize EXT4 filesystem that lives in the LVM to actually get the space:

resize2fs /dev/ubuntu-vg/ubuntu-lv

Verify EXT4 file system is now filling the VLM

df -hT
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.