2

I'm very new to Virtual Machines and not brilliant with computers as a whole (and this is the first time I've used Linux). I created a VM with too little hard drive space, so managed to do some research and resize the disk. I then used GParted to do it "properly"

The problem is that according to the Ubuntu image I'm using I'm nearly out of memory, which according to System Monitor is 7.2GB.

VirtualBox shows me that I have the virtual space, but not actual space

enter image description here

What do I need to do to use the full virtual space (or should I say convert virtual space to actual space)?

EDIT

This is what I see when I load the VM up

enter image description here

System Monitor

enter image description here

EDIT as per Zina's request in comments

Output of pvdisplay

enter image description here

Output of vgdisplay

enter image description here

Output of lvdisplay

enter image description here

What do I need to do to use the full space?

MyDaftQuestions
  • 1,903
  • 9
  • 37
  • 63
  • Virtual Size is the size you defined for the Hard Disk (~15GB). As you set the disk to be Dynamically allocated, the current size used on your host by your virtual 15GB HD is 7.68GB. The sentence "I'm nearly out of memory, which according to System Monitor is 7.2GB." makes no sense. Could you share a screenshot of your System Monitor where this is visible? The allocated size will grow as you will fill up your VM HD with data. The size will NOT go down if you delete data from the VM HD. I would suggest you read the [VirtualBox Documentation](https://www.virtualbox.org/manual/UserManual.html) – Zina Oct 24 '16 at 21:17
  • @zina I've updated my post – MyDaftQuestions Oct 25 '16 at 06:06
  • As we can see you just extended the virtual size of the disk but you did not resize it in the VM. As the name of the root partition suggests that you did a default install with LVM, you have to extend the LVM from inside the Ubuntu OS. If you get stuck, just edit your post with the output of `pvdisplay`, `vgdisplay` and `lvdisplay` which should show all relevant data about your disk setup. – Zina Oct 25 '16 at 16:21
  • I will perform the updates in 8 hours time, when I'm home – MyDaftQuestions Oct 27 '16 at 09:20
  • @Zina, I updated as requested – MyDaftQuestions Oct 30 '16 at 17:01
  • BTW, I extend LVMs on Virtual Machines the same way I would do on a physical one. Add another disk to the VM, add it to the LVMs and resize. As you can't make a physical 1TB disk to be a 2TB :) you have to add another 1TB. Hope you get my point. – Zina Oct 30 '16 at 17:36
  • " I'm using I'm nearly out of memory, which according to System Monitor is 7.2GB." For what it's worth thats disk / storage, not memory. – Sirex Oct 31 '16 at 23:45

1 Answers1

6

Thanks for adding the lvm information asked for.

You have to do the following (as root or add sudo in front):

lvextend /dev/ubuntu-vg/root -l +100%FREE - this will add all free space from the volume group to the root partition

resize2fs /dev/ubuntu-vg/root - this will resize the filesytem to the extended size

df -h - this will show you the new space layout.

EDIT: here some LVM sources to read for more information:

RedHat - CHAPTER 5. LVM CONFIGURATION EXAMPLES

Ubuntu - Wiki LVM

Zina
  • 2,247
  • 2
  • 14
  • 12