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 wubi-move-2.2.sh /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 wubi-move-2.2.sh --help

How to download

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

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

5 comments:

  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 wubi-move-2.2.sh /dev/sda7 /dev/sda6
    wubi-move-2.2.sh: Validating migration source...
    wubi-move-2.2.sh: Source for migration validated successfully:
    wubi-move-2.2.sh: Wubi host partition: /dev/sda5
    wubi-move-2.2.sh: Size of install: 3857912 K
    wubi-move-2.2.sh: Size of /boot: 46004 K
    wubi-move-2.2.sh: Size of /usr: 2173372 K
    wubi-move-2.2.sh: Size of /home: 179092 K
    wubi-move-2.2.sh: Validating migration target(s)...
    wubi-move-2.2.sh: partition /dev/sda6 must be type 82 - Linux swap.
    wubi-move-2.2.sh: Validation of target(s) failed

    wubi-move-2.2.sh: Migration did not complete successfully.
    I can't understand this error.

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

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

      Delete
  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 wubi-move-2.3.sh /dev/sda5 /dev/sda6
    bash: /home/andrew/home/andrew/downloads/wubi-move-2.3: No such file or directory
    andrew@ubuntu:~$

    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?

    andy

    ReplyDelete
    Replies
    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 wubi-move.sh /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 wubi-move-2.3.sh (which seemed pointless).

      Delete