3

Possible Duplicate:
How to replace my disk without having to rebuild my Ubuntu install?

What is the best way to upgrade my 200 gb HDD to a new one of 500 gb but - and this is the tricky part - keep my ubuntu instalation. I curently have 2 partitions hda1 with the ubuntu 11.10 instalation and another partition hda5 with the home folder. On the new HDD I want to keep the same format 1 partition with ubuntu and another with the home folder.

Florin
  • 696

3 Answers3

5

Boot a live CD with both HDDs attached, start the Partition Editor (gparted), copy and paste the partitions from one drive to the other:

  1. In the top right corner select your old hard disk.
  2. Select a partition you want to copy (right-click → "Copy"):

  3. In the top right corner select your new hard disk.

  4. Paste the copied partition into unallocated space (right-click → "Paste"):

  5. Resize if you want (right-click on the partition → "Resize/Move")

This will keep the unique identifiers of the partitions, so you shouldn't need to adjust anything after cloning the drive.

The final part is to re-install GRUB:

  1. Note the root partition name of your new HDD (for example /dev/sdb1).
  2. Open a gnome-terminal and run (sorry, I don't know a GUI way to do it, but it's just a couple of commands):

    1. sudo mount /dev/sdb1 /mnt
    2. sudo grub-install --root-directory=/mnt /dev/sdb
    3. sudo umount /mnt

    Make sure you use the disk name at the end of point 2!

That's it, reboot with only your new HDD and you should be fine.


Some advise: Do backups first! Only run one operation at a time and not all at once (so: copy → (resize) → copy → ...).

htorque
  • 64,798
0

You can use a Live CD and DD one drive to the next then resize the partitions using gparted.

squareborg
  • 10,517
0

You could use a disk imaging and cloning software such as Clonezilla.

Dimitrov
  • 293