2

I have an 240GB SSD which I am upgrading to 1TB SSD. Unfortunately I do not have multiple SSD slots on my laptop but have a 1TB HDD with 440GB of used partition space and 488GB of unallocated space.

HDD partitions

My plan is to use dd to make a copy to HDD and then to new SSD with a live USB drive. I am worried I will lose my existing data on the HDD in executing this plan.

What can be done to ensure that this transition happens without any hiccups and no possible corruption of partitions?

Raffa
  • 32,237
  • 1
    Related: https://askubuntu.com/a/1422748 useful safety notes especially on "partition to partition cloning" – Raffa Apr 22 '23 at 16:44

1 Answers1

1

Personally I would either grow the /dev/sdb1 partition on the 1TB disk into the unallocated space, making lot of room. Alternatively, just create another partition as /dev/sdb2 if you don't want to grow /dev/sdb1.

Then boot Clonezilla on a USB stick, which is exactly the tool for this job, way better and more reliable than using dd.

Use clonezilla to copy your entire 240GB SSD into a bunch of image files in a folder on /dev/sdb1 (or /dev/sdb2 if you chose to create a new partition). Clonezilla will put the files exactly where you tell it, so you can be confident that it won't destroy data on your 1TB disk, if you choose to do a "Disk to Image" type of clone.

Once complete and verified (clonezilla has a built in option for verification), you can swap out the 240GB SSD for the new one. Then boot clonezilla again, and use the "Image to disk" option to splat the backup you made onto the new disk.

You may then need to "grow" the partitions on the new disk, as I don't believe clonezilla does that automatically.

Once you're happy with the clone, you can throw away the image backup on the /dev/sdb2 (or /dev/sdb1) and you're done.

I made a video about clonezilla a few years ago, which may help you understand how it works.

https://www.youtube.com/watch?v=YxWmizuVl-g

popey
  • 23,667
  • Awesome! This sounds like something I can work with. I forgot to mention that my existing SSD has dual boot with Windows. I presume this should not have any additional impact. – jayendra.rakesh Apr 22 '23 at 15:29
  • The 240GB source disk has Ubuntu and Windows? Do you want to move both to the new disk, or only Ubuntu? It should still work either way TBH, but I can't vouch for WIndows nor help fix if Windows freaks out when it's moved. – popey Apr 22 '23 at 15:31
  • 1
    Okay. I will keep that in mind. Ubuntu is my priority but if Windows misbehaves I am willing to reinstall. – jayendra.rakesh Apr 22 '23 at 16:08
  • The good news is you can re-do this multiple times, as you have the original 240GB SSD which you can set aside, once you have taken the full disk image. The "fun" part will be getting it on the 1TB new SSD, and getting the partitions all stretched as you want into that new space. – popey Apr 22 '23 at 16:18
  • One probable "hiccup" is OP might need to change old disk and partition UUIDs after cloning to the new disk if they are used in /etc/fstab/ or systemd mount units .. etc. – Raffa Apr 22 '23 at 16:46
  • Interesting. I've never had to futz with fstab after cloning – popey Apr 22 '23 at 19:05