Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 5111  / 2 Years ago, sun, june 19, 2022, 12:09:25

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.


More From » 11.10

 Answers
6

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


[#42779] Monday, June 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
throecember

Total Points: 274
Total Questions: 118
Total Answers: 132

Location: India
Member since Thu, Jun 11, 2020
4 Years ago
;