Wednesday, April 4, 2012

How to migrate - updated for release 12.04 Precise Pangolin

A new version of the Wubi migration script will be released for Ubuntu 12.04 Precise Pangolin. There have been some minor changes that are required for release 12.04, and a few features added.

The simple migration hasn't changed

It's still straightforward to do a migration, for example if the target partition is /dev/sda5 and the swap partition is /dev/sda6, you can migrate as follows:
sudo bash /dev/sda5 /dev/sda6

New features

These are some of the changes with version 2.2 of the script:
  • Simplified interaction
  • Improved validation and diagnostics
  • Migrate to separate target partitions e.g. for / (root), /boot, /usr, and /home
  • Run migration validation pre-check without making any changes
  • Resume a migration that failed due to e.g. a corrupt file, without having to recopy everything
  • Synchronize a migrated install (e.g. to keep a fully bootable backup)

More information

For full instructions run:
bash --help

How to download

As usual, you can download the script from the HOWTO: migrate wubi install to partition thread on Select the file wubi-move-2.2.tar.gz, download, then right-click, and Expand. This will create a new directory with 3 scripts:, and

How to migrate in pictures

How to migrate from a root.disk

In the following example, the partition containing the root.disk is labeled 'wubi install' so the mountpoint is: /media/wubi install (including the space). This needs to be 'escaped' with '\' when specifying the location as shown in the screenshots below. Note also that this example uses a swap partition that is already used by another install (so option --shared-swap is specified to prevent running mkswap):

How to migrate to separate partitions

In the following example, there is a separate partition for /boot and /home in addition to the standard target (/) and swap partition. In addition, this example uses the  --shared-swap and --no-bootloader option:

Some notes on --resume and --synch

The new options --resume and --synch are designed to save time, either when the migration terminates due to rsync copy errors, or a refreshed migration is desired. Normally the script will only proceed on an empty partition (to prevent loss of data), so these options are the only way to bypass this - and they make use of rsync's sychronization ability to only copy files that are missing/changed.

Since this does introduce a little risk, these options rely on a control file created the first time the migration is started. This ensures that the target partitions are the same as on the prior run. In other words, resubmit the migration command in the exact same way, but append --resume on the end.

The idea behind the --synch option is to keep a bootable backup e.g. on an external drive. This can be quickly syncronized prior to performing major updates (like an release upgrade). 
Warning - synchronization will remove anything added to the migrated install that's not on the source install (in other words, don't use this option if you are actively using the migrated install).
This option is probably more useful for non-Wubi installs, so use it after you've migrated from Wubi (the script works on normal installs too).


  1. /dev/sda1 * 2048 65001471 32499712 7 HPFS/NTFS/exFAT
    /dev/sda2 65001472 312578047 123788288 f W95 Ext'd (LBA)
    /dev/sda5 65003520 272257023 103626752 7 HPFS/NTFS/exFAT
    /dev/sda6 272259072 276826111 2283520 82 Trao đổi Linux / Solaris
    /dev/sda7 276828160 312578047 17874944 83 Linux
    quan@ubuntu:~/wubi-move-2.2$ sudo bash /dev/sda7 /dev/sda6 Validating migration source... Source for migration validated successfully: Wubi host partition: /dev/sda5 Size of install: 3857912 K Size of /boot: 46004 K Size of /usr: 2173372 K Size of /home: 179092 K Validating migration target(s)... partition /dev/sda6 must be type 82 - Linux swap. Validation of target(s) failed Migration did not complete successfully.
    I can't understand this error.

    1. Use the latest version (2.3) of the script. It contains a bug fix for non-English language users. Get it here.

    2. I think /dev/sda6 should be formatted to linux -swap file system using gparted

  2. andrew@ubuntu:~$ /home/andrew/downloads/wubi-move-2.3
    bash: /home/andrew/downloads/wubi-move-2.3: No such file or directory
    andrew@ubuntu:~$ ~/home/andrew/downloads/wubi-move-2.3 sudo bash /dev/sda5 /dev/sda6
    bash: /home/andrew/home/andrew/downloads/wubi-move-2.3: No such file or directory

    I must be doing something wrong but at the moment I have yet to arrive at the solution. I downloaded the wubi-move-2.3. and extracted it 'here' in the downloads folder. It seems to have trouble finding the file even when I place the file on the desktop. Am I just inputing the directory wrong?


    1. Directories are case sensitive on Linux, so it's:
      andrew@ubuntu:~$ cd /home/andrew/Downloads/wubi-move-2.3
      andrew@ubuntu:~/Downloads/wubi-move-2.3$ sudo bash /dev/sda5 /dev/sda6

      Note that I've dropped the version suffix on the script for release 2.3 so you don't have to type (which seemed pointless).