Resizing then cloning hdd

I wanted to clone my yunohost SATA drive to a smaller SSD drive. It’s a new installation without any data.

Are gparted to shrink the drive then clonezilla the way to go?

Appreciate any help,

U

I remember having used gparted to copy paste the whole disk. But there was a trick I forgot

Hi @uncertain

I’ve never used clonezilla, it can perhaps perform all operations in one go, but I’m not sure.
For this kind of operations I use a boot key (like SystemRescue), change the keyboard layout, launch the graphical environment (both commands are printed when booted) and then use GParted as mentioned by @jarod5001.

Here’s a step-by-step procedure:

  1. Boot on the USB key, change your keyboard layout if required
  2. Copy the the first sectors that could have grub data:
    # dd if=/dev/sda of=/dev/sdb bs=1M count=10
    Please be sure to check the disk names before!
  3. Launch the GUI and GParted, select the new disk (on the top right corner)
  4. Resize the partitions to fit the disk size (layout of the source disk has been copied with step 2)
  5. Apply the changes (green check)
  6. Select to source disk
  7. Resize the partitions so that they will fit the destination and apply
  8. Copy each partition from source to destination disk, apply
  9. Resize the partitions on the source disk back and apply
  10. Exit GParted and boot disk.

I prefer SystemRescue over distribution rescue disk because it has every tools I can think of to tinker with systems: restore grub, work with cryptsetup, clone/resize partitions…

When cloning disk/partition always check source and destination twice before committing changes!

thanks for the reply @jarod5001 and @kumqualy ,

I’ve tried gparted but the install has allocated the whole 2tb disk, even though there is almost nothing on it. Thanks for putting me onto systemrescue. Ill give that a try.

Best regards,

U

1 Like

I have plugged the drives using USB external cable on my Linux laptop. I copy pasted the partitions from source to destination then resized it (or resize then copy paste, I don’t remember, it was 2 years ago)