Score:2

Cloning/Copying partition to existing disk with unallocated space

it flag

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 avatar
jp flag
Related: https://askubuntu.com/a/1422748 useful safety notes especially on "partition to partition cloning"
Score:1
pl flag

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

jayendra.rakesh avatar
it flag
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.
pl flag
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.
jayendra.rakesh avatar
it flag
Okay. I will keep that in mind. Ubuntu is my priority but if Windows misbehaves I am willing to reinstall.
pl flag
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.
Raffa avatar
jp flag
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.
pl flag
Interesting. I've never had to futz with fstab after cloning
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.