How to Clone a Smaller SSD and Resize Partitions for a Larger One?
Asked by
TechWizard47
I'm looking to clone my bootable Ubuntu SSD that's currently smaller into a much larger SSD. I also need to expand a couple of my existing partitions since they're too small. I use KVM for some VMs (Windows and FreeBSD) on this drive. Once the cloning is complete, I plan to use the original SSD as an external backup, so I need to ensure the UUIDs are different. I heard Clonezilla might not support this specific task out of the box, so what tools should I consider? I have a few options in mind: doing a fresh install and copying files manually, cloning while keeping current sizes and resizing only the needed partitions, or cloning with enlarged partitions and then reducing the sizes of the unnecessary ones. What do you all recommend?
Answers
If you boot from the source drive, make sure nothing is mounted as read-write. It's best to boot in maintenance mode or use a live ISO to avoid any issues. Once you've done that, you can use `dd` to clone the contents. Just keep an eye on the UUIDs to avoid duplicates when you're done. GParted is also great for resizing your partitions after cloning.
Reply to this answer
Be cautious! Mixing up drive designations can lead to data loss. If your source SSD is just a bit full, grab a dd dump before proceeding. And once you're done resizing the target, remember to securely erase the original SSD.
Reply to this answer
Iโd go with creating the new partitions manually at the sizes you want and then copy over the individual partition contents. What filesystem are you using? Changing UUIDs is a breeze with ext4 but can be tricky with btrfs.
TechWizard47: I'm using ext4, so that's good to know!
Reply to this answer
Using Clonezilla sounds like a good starting point for cloning your SSD. After that, you can use GParted to manage the partitions and resize them according to your needs. This combo is pretty solid for your use case!
Reply to this answer
Definitely consider using GParted! Just connect both drives, boot from a USB drive with GParted, and you can handle resizing directly. If you're cloning the whole drive, dd or Clonezilla might work well, especially for skipping unallocated space. After cloning, wiping the source drive with something like blkdiscard is a fast option without wearing it down too much.
Reply to this answer
Add your answer
Answers are reviewed before publication.
TechWizard47: Thanks for the detailed steps! I'll make sure to follow your instructions.