Is it possible to extend the disk space available to a wubi install? [duplicate]

Solution 1:

From the WubiGuide:

How do I resize the virtual disks?

You can use LVPM, at http://lubi.sourceforge.net/lvpm.html

As an alternative, you can use the following script to move /home to a dedicated virtual disk.

Download wubi-add-virtual-disk, open a terminal and run:

sudo sh wubi-add-virtual-disk /home 15000

Where the first argument is the directory to move to a new dedicated disk, and the second argument is the size in MB.

You should now reboot. If you are happy with the result, you can now remove /home.backup. To undo the changes remove /home, copy rename /home.backup to /home and remove the /home line in /etc/fstab.

Note that contrary to previous information, this script is not suitable for moving /usr - experienced users may be able to do this manually, at own risk, following a process similar to that outlined in the file. (Do not rename /usr until the very last moment, as rsync is installed there.)

Solution 2:

There are a few options to resize. Source the Wubi Guide.

You can resize by making a duplicate, larger root.disk. The downside is that it doesn't help if you're short on space and it takes a little longer. On the plus side, you have a backup to make sure everything worked and you run it right from the Wubi install.

The other method is to dynamically resize the root.disk in place. The downside is you have to do it from a Live CD/USB, you don't automatically get a backup, and there's no helper script. The plus side is it's blazingly fast and you can increase by a couple of GB rather than find space to duplicate++.

Both methods are documented in the Ubuntu community Wiki.

It's also possible to create a separate virtual disk for your /home directory. This is not discussed here, but can be found in the Wubi Guide.

Resize and Duplicate the root.disk

First download the script wubi-resize-1.6.tar.gz from https://help.ubuntu.com/community/ResizeandDuplicateWubiDisk to your Downloads directory, right-click and choose "Extract here". The rest of the resize is run from the Terminal.

For usage instructions:

cd ~/Downloads/wubi-resize-1.6
bash wubi-resize.sh --help

To create a new 10GB virtual disk:

sudo bash wubi-resize.sh 10

enter image description here

See the Wiki documentation for more information, including how to verify the integrity of the script. Also, note that there's a built-in maximum for the new disk (32GB), but this can be overridden with the --override-max option. (I don't recommend making the root.disk too large because many Wubi installs suffer from corruption and sometimes the data is not recoverable`. It's better in this case to use shared data partitions or to migrate to a normal dual boot.

In-place resize of the root.disk

If you don't have enough space to do a full duplicate, you can do an in-place resize instead. For this you have to boot from a live CD/USB as it won't work while running Wubi. Although not required, it's a good idea to backup the root.disk or the data on it. (This is a good idea for any Wubi install as it's not as reliable as a normal install).

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

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

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

Run fsck on the root.disk:

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

Resize - specify the desired final size (this example resizes to 10 GiB):

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

Reboot back into Wubi Ubuntu. See https://help.ubuntu.com/community/ResizeWubiDisk for more information.