Ubuntu – 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.

Best Answer

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

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
  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.


Related Question