Virtual Box Virtual Disk not expanding

4

I have an iMac Core i5 host computer, 1TB Hard drive, 8GB Memory.

I have created a Virtual Box VM to run Fedora 14 64bit with a 200 GB Dynamically allocated hard drive. Virtual Box version 4.1.6 r74713

I have tried twice to import a 40+ GB database sql file and I keep running out of hard drive space.

Each time I've tried this my VM's hard drive stops expanding at ~50 GB.

df -h output:

/dev/mapper/VolGroup-lv_root
                       50G   47G   96M 100% /
tmpfs                 981M  260K  981M   1% /dev/shm
/dev/sda1             485M   30M  430M   7% /boot
/dev/mapper/VolGroup-lv_home
                      144G  213M  136G   1% /home
ds                    931G  169G  763G  19% /media/sf_ds
ds                    931G  169G  763G  19% /var/www/site-example.org

I have plenty of space on the host computer (800+ GB)

Virtual Box reports the actual size of the disk is 46.88 GB Virtual Box Storage Info Any ideas on why Virtual Box stops expanding the disk and how to fix it?

Update

I've run GParted on the VM and it says all 200 GB are used even though df -h doesn't report that. GParted screenshot

Patrick

Posted 2012-04-16T13:06:36.780

Reputation: 1 216

Answers

5

You assigned most of the space on your virtual disk to your LVM /dev/mapper/VolGroup-lv_home volume. Now you're trying to import your database into a file that is (most likely) not located in your home directory.

So the space from your root volume is used. That volume is only 50G in size.

You need to resize your LVM volumes.

I would assume that you chose to have your home directories in a separate partition during the installation of Fedora.
Given that you only use 1% of the free space in that partition and given that you're running out of space on your root partition, that choice might not have been optimal.

You're going to want to use lvresize to shrink your home volume and grow your root volume. If you have no experience with that tool, there seem to be plenty of guides online. Like this one: LVM Resizing Guide.

Der Hochstapler

Posted 2012-04-16T13:06:36.780

Reputation: 77 228

thanks for the reference for lvresize. Since 99% of my data is in mysql I just moved the mysql folder into /home and symlinked it rather than deal with resizing the volume – Patrick – 2012-04-16T15:50:25.947

2

Where are you trying to import it? The root file system (/dev/mapper/VolGroup-lv_root) is full. If you need more space on root you need to resize your partitions to move space from /dev/mapper/VolGroup-lv_home

uSlackr

Posted 2012-04-16T13:06:36.780

Reputation: 8 755

@uSlacker the /dev/mapper/VolGroup-lv_root is the root of the virtual disk, that is what is supposed to be dynamically increasing – Patrick – 2012-04-16T13:19:48.510

1No, you assigned 50GB to the root and 150GB to /home. There is no room left on /root unless you have a second VBOX disk you didn't mention. – uSlackr – 2012-04-16T14:08:03.177

2

I believe you may want to check the Hard Drive size allocated inside the Fedora VM. Depending on how fedora was set up, the maximum size partition that Fedora sees could be 50G (which is what it looks like from your df -h output). Even though its dynamic in the eyes of VirtualBox, Fedora is not seeing it as dynamic because the partition during the install was at a fixed value.

I found a similar forum post regarding this at the Virtual Box Forums See here

Quick note after rereading the output. Look at the allocation to your /dev/mapper/VolGroup-lv_home it has 144G allocated to it. So if you transfer it there is should transfer. The above partition issue is still there except if you were transferring it to somewhere other than /dev/mapper/VolGroup-lv_home you would run out of space.

Stamo

Posted 2012-04-16T13:06:36.780

Reputation: 56