Virtualbox: is my partition dynamic or not?

6

I'm using Virtualbox on a macosx host and unfortunately my hosted system, a linux mint installation, has run out of space. I thought it was dynamic but evidently it is not. It is a vdi filesystem.

In any case, how can i unerstand if a vobx vdi partition is dynamic or not? I searched out on the internet, mostrly on vbox website, but could not find any valuable information.

Also, in case it is not dynamic, is there a way to turn a fixed partition into a dynamic allocated one? (also some non-orthodox system as copying content of the partition is fine to me)

Daniele B

Posted 2013-06-05T13:52:05.507

Reputation: 187

1So with the "Dynamic" or thin provisioning, the guest sees the full space you allocated when you created it, but it only consumes the space on the host when you actually put data there.

With "Fixed" or thick provisioning, the guest consumes the full amount immediately even if it hasn't written any data.

Either way, it sounds like you didn't allocate enough maximum space (thin or thick). The good news is that it's not hard to expand a disk using virtualbox, though you will have to go to the command line. – MattPark – 2013-06-05T14:11:22.147

wow, great! Can you provide information about how to reallocate space in the answer? Thanks. – Daniele B – 2013-06-05T14:26:51.887

I did a little search and I found out that what you say can be done via VBoxManage modifyhd IMAGENAME.vdi --resize SIZE but wher I run it on my box it looks like the resize option does not exist... I'm working on a macosx with version 3.2.14 – Daniele B – 2013-06-05T14:48:47.180

Version 3.2.x is pretty old. You should probably upgrade first before messing with any of this. – MattPark – 2013-06-05T15:05:58.923

great, I updated my vbox and it partially worked: the max size is now 20 GB but it does not grow... any hint about how to make it grow dynamically? – Daniele B – 2013-06-05T15:56:22.683

yup -- grab gparted on mint, and expand your / partition. Then you are done. Gparted is gui based and pretty straightforward. – MattPark – 2013-06-05T18:16:47.880

Answers

7

How to check to see if virtual hard drive is "dynamic(thin)" or "fixed(thick)":

  • File --> Virtual Media Manager
  • Select the Hard Drive in question
  • Check storage details in info panel

How to convert clone a fixed virtual hard drive to dynamic:

  • You can't convert the image currently, but you can clone a new one then remove the old.
  • VBoxManage clonehd [old.VDI] [new.VDI] --variant Standard
  • You will have to detatch the old and attach the new in your VM properties.

How to expand a dynamic hard drive max size if it is full:

  • VBoxManage modifyhd IMAGENAME.vdi --resize SIZE Size is an integer in MB

How to expand hard drive partition within Linux OS after expanding .vdi:

  • apt-get update && apt-get install gparted
  • unmount the affected partition umount [mountpoint]
  • open gparted, select the partition in question and choose resize/move and expand it to the end of the unallocated space.
  • NOTE: you may have to boot your vm into a GParted live cd to make the change if you are expanding a partition that you can't unmount first such as /, you can get one here: http://gparted.sourceforge.net/livecd.php

MattPark

Posted 2013-06-05T13:52:05.507

Reputation: 1 061