How can I clone a hard disk to a smaller SSD?

11,575

Solution 1

Don't bother to partition SSD disk.

I would suggest to shrink the partitions on the old disk first to fit the size of the SSD, then dd old disk to new one

But make a backup first.

Solution 2

You can definitely use dd, as long as the data on the larger drive is notably smaller than the SSD and that no data exists in the area that is beyond the SSD's storage limits.

Just do a straight up dd sector by sector from the source drive to the SSD until the SSD is "full" and then use parted to fix up the incorrect partition table that says the SSD has larger geometry than it really does by "deleting" and "recreating" the truncated partition with the correct geometry (this doesn't delete data in that partition, it simply changes the start and end of that partition).

Alternatively, as already mentioned, use a tool like GParted to shrink down the partition to less than the size of the SSD, clone it over using either dd (it will have correct geometry and no risk of data loss this time) or Clonezilla (faster than dd because it only clones the occupied areas of the drive rather than everything - you still need to resize the partition down beforehand), and then resize the partition on the SSD up again afterwards to fill any empty space below the total capacity.

Share:
11,575

Related videos on Youtube

Dan
Author by

Dan

IT jack of all trades. I specialize in python, C++, matlab, and various scientific computation and linuxy things.

Updated on September 18, 2022

Comments

  • Dan
    Dan over 1 year

    I have a hard drive in my laptop with a windows and an ubuntu partition. I got an SSD to replace my hard drive, but it has a slightly lower capacity. I've already partitioned the SSD to the sizes I want, and each partition on the new disk is larger than the amount of used space on my old hard drive.

    I was going to use dd, but it appears that it requires partitions to be the same size.

    How can I copy my old partitions onto my new ssd? I'm copying my boot partition too, so how can I make sure the new disk is bootable, and the new partitions are exactly the same as the old ones (but with less free space)?

  • gmatht
    gmatht over 7 years
    BTW, I take it WereSync isn't so suitable for cloning a laptop that only has Windows on it (even from a linux Live USB)?
  • DonyorM
    DonyorM over 7 years
    @gmatht well it's certainly not supported. It should copy all the files properly, but the boot probably won't work. If you have a recovery disk you might be able to get it to work.
  • insaner
    insaner about 5 years
    @DonyorM Very neat piece of software. I did run into several issues though. What's the best way to communicate those to you?
  • DonyorM
    DonyorM about 5 years
    @insaner the best place would be the issues page on Github: github.com/DonyorM/weresync