Increase size of root partition after installing Ubuntu in Windows

Every time update manager prompts an update I get a message saying that there is not enough space available, however the partition with Ubuntu installed has over 10 GB of free space available.

I'm lost as to what needs to be done.

df -h returns:

Filesystem            Size  Used Avail Use%   Mounted on
/dev/loop0            5.6G  5.1G  237M  96% /
udev                  2.0G  4.0K  2.0G   1% /dev
tmpfs                 786M  792K  786M   1% /run
none                  5.0M     0  5.0M   0% /run/lock
none                  2.0G  332K  2.0G   1% /run/shm
/dev/sda6              20G  6.7G   13G  34% /host
/dev/sda5             175G  120G   56G  69% /media/DATA

It would be great if someone could help me out on how to solve this problem. I'm a newbie to Ubuntu.


Solution 1:

Your / partition is full, 96% used, 237Mb free space. That is where your packages will be downloaded and installed.

From what I see this is a Wubi install. You can resize your Wubi partition using the method described on this post

  • How to increase the partition size of Ubuntu installed under Windows?

Basically you need to follow these to the letter:

  1. Get root privileges

    sudo -i

  2. Check how much space you have in your Windows disk

    df -h /host

  3. Create a new virtual disk bigger than the one you have at the moment, lets say 10GB

    (change the count= parameter as appropriate)

    cd /host/ubuntu/disks
    dd if=/dev/zero of=new.disk bs=1MB count=10000
    
  4. Format the new disk

    mkfs.ext4 -F new.disk

  5. Mount and copy files to new virtual disk

    mkdir -p /media/newdisk
    mount -o loop new.disk /media/newdisk
    rsync -av --exclude '/sys/*' --exclude '/proc/*' --exclude '/host/*' --exclude '/mnt/*' --exclude '/media/*/*' --exclude '/tmp/*' --exclude '/home/*/.gvfs' --exclude '/root/.gvfs' --exclude '/var/lib/lightdm/.gvfs' / /media/newdisk
    umount /media/newdisk
    exit
    
  6. Reboot into Windows and rename the file \ubuntu\disks\root.disk to \ubuntu\disks\old_root.disk.

  7. Rename the file \ubuntu\disks\new.disk to \ubuntu\disks\root.disk.

  8. Reboot back into Ubuntu and check if everything is working. When you are 100% sure that everything is on the right places you can login to Windows and delete the file old_root.disk to get those 5Gb back.

(Source)

Solution 2:

Since you are using Wubi (Ubuntu installed under Windows), the normal resize methods (Gparted, etc.) won't work.

  • Please follow the steps in the "Automated resize" section of the official Wubi guide here to easily increase the size of your partition.
  • Your Windows partition (Drive C) will need at least as much space as the combined size of your current Wubi partition and the new increased size.
    • For example, if your current partition is 5GB and you want to increase it to 10GB, you must have at least 15GB free on Drive C.

Note: That page also contains manual instructions/commands, but it is recommended you try the automated method first.