HowToMoveUbuntuInstallation

Introduction

I am going to be using a gParted Live CD for copying over everything with dd. First please determine your source and your target partiton. E.g., your internal hard drive is /dev/hda and the first partition would then be /dev/hda1. Determining source and target should not be too difficult. In the gParted Live CD the partitions are labeled with their names, you can use that to help you too. The source and the target will from now on be referenced as /dev/yoursource and /dev/yourtarget You can download the Live CD at http://gparted.sourceforge.net/

Copying the partiton

  • Boot into the gParted Live CD
  • If your Target partition is smaller than your source partition, resize it to be a bit smaller than your target partition. Resizing takes a while. Just be patient.
  • Open up a terminal by double clicking the terminal icon and type:

dd if=/dev/yoursource of=/dev/yourtarget bs=1k
  • Wait. It takes a long time. Find something useful to do or let it run over night.
  • Reboot. It will take you to your old system. Open up a terminal an type:

sudo mkdir /media/clone
sudo mount /dev/yourtarget /media/clone

This will mount your newly cloned partition at /media/clone

  • Edit your fstab file on the cloned partition:

sudo gedit /media/clone/etc/fstab

Edit the line that says #/dev/yoursource to say #/dev/yourtarget

  • Save the file and close it
  • Edit your grub menu.lst file to boot from your new partition:

sudo gedit /media/clone/boot/grub/menu.lst

Edit it so (hd0,0) or something else points to your target hard drive. If you are not sure how to do that, just insert /dev/yourtarget instead of (hd[somenumber],[somenumber]). I did not try that myself, but it should work fine.

  • Mark your new partition active. Boot to the gParted Live CD, right click your target partition, click "Manage Flags" and check the boot option.
  • Reboot and enjoy your cloned Ubuntu System!

In case it did not work, you can just set your old partition active again with the gParted Live CD. Please note that I do not use GRUB, I use extlinux, so I would be glad if anyone could confirm that this really works with GRUB

HowToMoveUbuntuInstallation (last edited 2008-08-06 17:01:21 by localhost)