Moving 11.10 complete system to a new bigger Harddisk [duplicate]

I would like to move my current installation of Ubuntu 11.10 to a bigger harddisk, since the old one is failing.

I would like to avoid solutions like dd block copying (since there would be unused space at the end) with something cleaner, but I'm open to suggestions.

Partitions info:

Size  Used Avail Use% Mounted on Partition type Encrypted
19G  9.9G  7.6G  57% /           ext4
59G   50G  6.2G  90% /home       ext4           Yes

What is the best way to accomplish such a task, preferably with advantages/disadvantages of any given approach.


Solution 1:

Use clonezilla.

It will allow you to clone your current system including the mbr without actually copying unused space that dd does hence doing it faster

Since its reading / writing on a filesystem level you can only use it on a supported filesystem, on the contrary to dd, which works on a device level, allowing the copy of any filesystem.

Clonezilla's front page has a list of the software's limitations:

  • The destination partition must be equal or larger than the source one.
  • Differential/incremental backup is not implemented yet.
  • Online imaging/cloning is not implemented yet. The partition to be imaged or cloned has to be unmounted.
  • Software RAID/fake RAID/firmware RAID is not supported by default. It can be done manually only.
  • Due to the image format limitation, the image cannot be explored or mounted. You can not recovery single file from the image. However, you still have workaround to make it, read this.
  • Recovery Clonezilla live with multiple CDs or DVDs is not implemented yet. Now all the files have to be in one CD or DVD if you choose to create the recovery iso file.

Solution 2:

I'd use Gparted.

  1. start from your Gparted LiveCD or LiveUSB (using Lily)
  2. Plug in both of your HD (old and new one)
  3. select partitions on the old disk and "COPY" it on the new disk
  4. Resize partitions on your new disk according to your willing
  5. Start from Ubuntu liveCD/liveUSB
  6. Use blkid to check the UUID of the partitions on the new disk
  7. Edit your /etc/fstab located on your new disk according to your UUID
  8. Open a terminal (Ctrl + Alt + T) in order to re-install Grub on your new disk.

    fdisk -l
    

    fdisk to Check the name of the Ubuntu partition on your new disk. In my case, it's sda1 so let's continue by mounting this partition :

    mount /dev/sda1 /mnt
    

    Finally, let's re-install Grub in your new disk sda :

    grub-install --boot-directory=/mnt /dev/sda
    
  9. Shut down and re-start from your new disk !

[EDIT] Thanks to tomodachi, I edited my answer to reflect his advices :

  • No need to edit the fstab on the new HD because Gparted is supposed to copy the partition as well as its UUID

  • I added some extra steps to make your new HD bootable.

maybe there are simpler methods ?