In-place Resize of Wubi virtual disk

This document describes how to resize a Wubi virtual disk. There are two distinct techniques.

The technique described here is a true resize of the virtual disk (root.disk), and must be performed from a live CD. This is very fast and can also make better use of the available space on the host partition, than the alternate method, which duplicates the virtual disk. However the duplication doesn't require a live CD, and also leaves you with a full backup. See here for further details.

CREDIT... Thanks to Trooper_Max for suggesting this

Resize root.disk

1. You have to boot from a live CD/USB. This won't work while running Wubi.

2. Backup the root.disk (not required, but a good idea)

3. Mount the NTFS partition that your root.disk is on (this example assumes it's /dev/sda1 and the mountpoint is /media/win - adjust accordingly in the following instructions):

sudo mkdir -p /media/win
sudo mount /dev/sda1 /media/win

4. Check the size of the root.disk (not required)

du -h --apparent-size /media/win/ubuntu/disks/root.disk

5. Run fsck on the root.disk

fsck -f /media/win/ubuntu/disks/root.disk

6. Resize - specify the desired final size (this example resizes to 10 GB)

resize2fs /media/win/ubuntu/disks/root.disk 10G

7. Reboot back into Wubi Ubuntu

Live Resize

Rather than boot from the livecd, it is possible to extend the disk online with the following commands:

sudo dd if=/dev/zero bs=1MiB of=/host/ubuntu/disks/root.disk conv=notrunc oflag=append count=2048
sudo losetup -c /dev/loop0/
sudo resize2fs /dev/loop0

This will add 2 GiB to the disk. Adjust the count=2048 argument for different sizes.

ResizeWubiDisk (last edited 2014-04-05 19:11:31 by psusi)