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.

0

3 Answers 3

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

4
  • Because I admit I am a newbi a gui solution is the best but what about the grub from the MBR?
    – Florin
    Oct 19, 2011 at 15:30
  • Oops, sorry, forgot about that. But you can do that after the cloning while still running the live CD. Will edit my answer.
    – htorque
    Oct 19, 2011 at 15:35
  • Did it. Worked like a charm. And a lot faster than I imagined.
    – Florin
    Oct 22, 2011 at 13:37
  • Done, and checked. Still works like a charm for 14.04
    – Rmano
    Nov 4, 2015 at 11:55
0

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

0

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

Not the answer you're looking for? Browse other questions tagged .