Discussion of this wiki can be found here

This document describes how to migrate a Wubi install to partition. The partition(s) must be created already - for more information see here.

The examples shown below assume the target partition is /dev/sda5 and the swap partition (if required) is /dev/sda6.

Automatic migration

The migration supports Wubi installs from 8.04 to 13.10, with Grub2 or grub-legacy. First download the attached file wubi-move-2.5.tar.gz to your Downloads directory, right-click and choose "Extract here". The rest of the migration is run from the terminal.


To migrate to /dev/sda5 with swap on /dev/sda6:

sudo bash wubi-move.sh /dev/sda5 /dev/sda6


To migrate to /dev/sda5 without swap:

sudo bash wubi-move.sh /dev/sda5


If you don't want to install the grub bootloader, use the --no-bootloader option. You can boot from the Wubi install's grub menu temporarily and manually install the grub bootloader later:

sudo bash wubi-move.sh --no-bootloader /dev/sda5 /dev/sda6


To migrate from the root.disk when running from a live CD/USB:

sudo bash wubi-move.sh --root-disk=/media/win/ubuntu/disks/root.disk /dev/sda5 /dev/sda6


The path to the root.disk is case-sensitive and if it contains spaces they must be escaped e.g.

sudo bash wubi-move.sh --root-disk=/media/New\ Volume/ubuntu/disks/root.disk /dev/sda5 /dev/sda6


You can migrate to separate partitions for /boot, /usr and /home:

sudo bash wubi-move.sh /dev/sda5 /dev/sda6 --boot=/dev/sda1 --usr=/dev/sda7 --home=/dev/sda8


For full usage instructions and notes:

bash wubi-move.sh --help
bash wubi-move.sh --notes


Example

The following screenshots (from release 2.3) show a Wubi migration to /dev/sda6 with the swap partition on /dev/sda7. migratewubi1.png migratewubi2.png

Notes

The script code is hosted on: https://github.com/bcbc/Wubi-move. You can find the full history and previous releases (tagged). You can also open an Issue if you would like to suggest an improvement or file a bug.

Known issues with script

  1. Running "update-grub" in the chroot doesn't pick up other linux installations on the same drive. In rare cases it fails to pick up Windows installs. I recommend running sudo update-grub after booting the new install for the first time.

  2. End of life releases that have grub-legacy must be upgraded to a supported release before migrating.

  3. Only the current kernel's initrd.img is updated on the migrated install; if you require others you can update them with:
    sudo update-initramfs -u -k <kernel version> 

  4. When you run the migration on a 12.04 install, the target partition(s) will be popped up and displayed in the file browser e.g. Nautilus, when the script mounts them. To avoid this you can use the --hide-partitions option, however there have been cases of graphics freezes with this due to a suspected issue with udevadm and graphics drivers. If you have a closed source graphics card it is not recommended to use this option.

Other known issues:

  1. Many older BIOSes cannot address more than 137GB from the start of the disk. If you try migrating to a partition that falls outside of this, then Grub2 will fail to load it's boot files. Even if only a part of the partition falls outside this range there is a possibility of grub failure in the future. Therefore, either confirm your BIOS is unaffected prior to partitioning, or ensure your target partition falls within this limit, or migrate to a separate boot partition within this limit.
  2. The process that Wubi uses to boot (wubildr.mbr) cannot read ext3/4 partitions prior to release 11.10. It reads partitions in BIOS order looking for the wubildr file, so if finds an ext3/4 partiton before it finds the wubildr file - it will hang up. So, make sure you install the grub2 bootloader if you migrate to a partition lower than the one containing wubildr i.e. if Windows is on /dev/sda2 and you migrate to /dev/sda1

A note on hibernation:

  • The migration script will enable hibernation automatically, provided you migrate with a swap partition and the swap partition is large enough (must be > the size of your RAM). With release 12.04 the Hibernate option is also hidden from the system menu by default - to enable it see here


Verifying the script

The archive file contains signed sha256 and md5 checksums of the 3 scripts used for the migration (wubi-move.sh, check-source.sh, and check-target.sh). You can manually verify these as described here...

Download my GnuPG public key, with the same keyid as on my launchpad page:

gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x3310A652

Verify the checksum files are signed by me:

gpg --verify SHA256SUMS.gpg SHA256SUMS
gpg --verify MD5SUMS.gpg MD5SUMS

Verify the script files:

sha256sum --check SHA256SUMS
md5sum --check MD5SUMS

If any of the above fail, do not use the script. Note that it's normal for my key to appear untrusted, as long as the keyid is correct and the checksum file signatures are valid. I've also included a script verify.sh that will perform the above steps.

What's new in version 2.5

Version 2.5 removes the default udev rules that stopped Nautilus popping up a file browser with the target partition while the script was running. The udev rules are now available as an option --hide-partitions. If you are running Ubuntu 12.04 and find that Nautilus is interfering with the script, you can either run it from a virtual console (Ctrl+Alt+F1) or use the new option to suppress them.

What's new in version 2.4

Version 2.4 supports the access control list on /media/<username> mount points, and has two bug fixes: remove swap UUID check for the --resume and --synch options; correct regexp for removing .disk lines from /etc/fstab). See https://github.com/bcbc/Wubi-move for more information.

What's new in version 2.3

Version 2.3 contains a bug fix for non-English language users and a fix for grub-legacy installs (original install on 9.04 or earlier).

Manual migration

For those interested, I've included the steps required to manually migrate here: https://help.ubuntu.com/community/MigrateWubiManually.

MigrateWubi (last edited 2013-10-18 23:36:34 by bcbc)