[ale] mint 13 vm running out of storage space

Phil Turmel philip at turmel.org
Sun Oct 13 21:47:21 EDT 2013


Hi Ron, Mike,

I make heavy use of VirtualBox and have some techniques that solve these
kinds of problems...

On 10/13/2013 07:25 PM, Ron Frazier (ALE) wrote:
> Hi Mike T,
> 
> Thanks for the tips and info.  It seems there is a never ending chain
> of things to learn about hdd's and storage.  I haven't had a chance
> to play with LVM's.  It's one of many things on my ttd list.  I might
> be able to use the procedure you mentioned in the future.

I use LVM for my virtual machines, but the biggest bang for the buck
comes from the *host* LVM.  Specifically, I create logical volumes on my
host, one per virtual disk.  The "VBoxManage" tool can create a mapping
in a tiny .vmdk file that provides 1:1 sector mapping for that virtual
hard drive into the logical volume.  This make a certain tasks absurdly
easy:

1) Resizing.  Disconnect the mapping from its VM, delete it, extend the
LV with your preferred LVM tool, recreate and reconnect the mapping.
Presto!  VM now sees larger drive just as if you had performed a
disk-to-larger-disk copy.

2) Host access.  The "kpartx" tool can see the embedded partition table
and set up device mappings to its partitions *from the host*.  (With the
VM shut down, of course.)  This makes it possible to scan my untrusted
VM disks for viruses (w/ clamav) *without running the VM*.  Or do
anything else I need with those files.

> In case I end up resizing the existing file system, can you or
> someone remind me of which file to edit to control how the file
> systems get initialized and mounted during boot.  I'll probably need
> to deactivate the swap and possibly change the device id if I create
> another virtual drive.  I cannot remember the name for that, but it's
> the long string of digits that identify a partition.

Procedure (1) above does need tweeking inside the VM to use the new
space, as you will if you do the copy you are considering.  Last time I
did this, I ran gparted inside the VM to expand the last partition into
the new space.  gparted automatically ran resize2fs for me.  I could
just as easily run gparted in the *host* before running the VM to
achieve the same results.

> "Michael B. Trausch" <mbt at naunetcorp.com> wrote:

>> Because this is a virtual *HDD* and *HDD*s cannot be resized,
>> well, that's a reasonable limitation.

Except that you can, if you are using a suitable *host*.

>> What it boils down to is that you add disk space to a VM the same
>> way you do to a real host:  Add a second drive and append it to
>> your setup (if you're using LVM), or create a second drive and move
>> the data over to it (hopefully putting LVM on that so that you have
>> the ability to grow later).

I love LVM, but I don't use it much *in* my VMs.

<flamebait>
For *desktop* duty on a linux host, I find VBox superior to all other
virtualization tools.  :-)
</flamebait>

Phil


More information about the Ale mailing list