Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am relatively new to Ubuntu running or a VirtualBox (on a Mac), and after everything was working more or less fine before I upgraded to Mavericks, now I find a lot of problems with it. Not sure what's going on, but my Ubuntu machine had dynamically allocated space, and I don't recall having any problems expanding the disk. My Virtual Size is 20GB, actual Size is 8GB.

luis@luis-VirtualBox:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001edac

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    17367039     8682496   83  Linux
/dev/sda2        17369086    41940991    12285953    5  Extended
/dev/sda5        17369088    41940991    12285952   82  Linux swap / Solaris

Now, I am trying to install additional software in Ubuntu, and the machine indicates that I am running out of space.

luis@luis-VirtualBox:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       8.1G  7.6G   96M  99% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            5.8G  4.0K  5.8G   1% /dev
tmpfs           1.2G  1.0M  1.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            5.8G  156K  5.8G   1% /run/shm
none            100M   44K  100M   1% /run/user
Desktop         699G  386G  313G  56% /media/sf_Desktop
Documents       699G  386G  313G  56% /media/sf_Documents
Dropbox         699G  386G  313G  56% /media/sf_Dropbox
My_Passport     932G  363G  570G  39% /media/sf_My_Passport
/dev/sr0         62M   62M     0 100% /media/luis/VBOXADDITIONS_4.3.0_89960

Additional information:

luis@luis-VirtualBox:~$ sudo fdisk -l /dev/sda1

Disk /dev/sda1: 8890 MB, 8890875904 bytes
255 heads, 63 sectors/track, 1080 cylinders, total 17364992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda1 doesn't contain a valid partition table

How can I fix this problem? Does anybody know why the machine is not dynamically allocating the space I need, up to 20GB?

Thanks is advance for any help.

share|improve this question
    
Please add to the question the results of running df -h and sudo fdsik -l /dev/sda (or the appropriate disk device) in a terminal. Maybe you formatted the virtual disk only partially. –  Rmano Nov 8 '13 at 15:21
    
Thank you Rmano. I think my problem is expanding Disk /dev/sda1 partition into dev/sda. I can't post pictures, but disk utility indicates that, and I can't run KDE partition, and don't know any utility to manage partitions for virtual disks. –  Luis Miguel Nov 8 '13 at 16:55
    
I never did that but I comment that here because maybe it can help you to find instruction. The problem is that you have a /dev/sda2 partition unused. You should delete that partion, expand the /dev/sda1 to occupy all of your (virtual) disk, and then use resize2fs to do that. There is a nice help here: thewiringcloset.wordpress.com/2013/01/09/… --- I really suggest a backup of the VM without trying anything. –  Rmano Nov 8 '13 at 17:05
    
Notice that you have to stop swapping and remove the 12G swap partition you have on the virtual disk. It's explained in the link above. –  Rmano Nov 8 '13 at 17:14
    
I think you should ask on the virtualbox forums. In my experience, although virtual expanding as you use them disks sound nice, they are often problematic. Perhaps the hard drive on the host is full ? –  bodhi.zazen Nov 8 '13 at 20:16

1 Answer 1

up vote 0 down vote accepted

Your virtual hard disk is partitioned in two. One is the 8 Gb partition where Ubuntu is installed, the other one is a 12 Gb swap partition. You will need to resize them.

The easiest way to do it is to boot the Virtual Machine (not the real one), from an Ubuntu installation iso and run gparted. See this question but apply it to the VM not your physical machine.

Your best option is likely something like 11 Gb Ubuntu and 1 Gb swap.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.