Cloning hard disk partition to smaller SSD on laptop

85,167

Warning:

This answer is for old filesystems with MBR, and legacy BIOS systems. It will not work for newer systems with UEFI.

Backup! Backup!! Backup!!!

I can't overemphasize the importance of backup. Backup your data. Backup the whole partition. Do it twice.

SSDs are getting cheaper. Buy a bigger SSD, say 120GB. Use the 64GB for an extra backup.

Now let us go step by step and do what you want.

Step 1: Boot from live CD/USB

Use the try Ubuntu without installing option. Plug in the external hard drive. It has to be at least 64GB or bigger.

Step 2: Identify the disks

Open Gparted. I prefer Gparted because it is visual and let me "see" the drives and partitions. Click on the top right drop down and see the list of drives. Go through the list and identify the drives you want to work with, by their size and partition structure. You want to identify the internal hard drive you want to clone from as well as the external hard drive you want to copy to.

enter image description here

Step 3: Shrink

Make sure you have selected the internal disk you want to transfer.

Select the 100GB partition you want to copy.

Drag the right edge of the partition leftward to resize/move it as far as it would go.

If it does not go below 64GB, you will need a bigger SSD. If it goes below 64GB, don't worry, you will be able to expand it later once it is copied into the SSD.

Press the "Apply" button in Gparted and wait.

If all goes well go to the next step. If you get an error, stop!

enter image description here

Step 4: Copy partition

Select the partition you just shrunk and from the menu select copy.

Select the external hard drive and paste the partition there. It is best if the external hard drive does not have any partitions and or data.

You don't have to create a new partition beforehand in the external hard disk to copy the partition. You will need unformatted / unallocated space in the disk

Apply to actually do the work.

enter image description here

If the external hard drive is bigger than 100GB, you can switch steps 3 and 4. That is copy first and shrink later. This will take longer, but has the benefit of keeping your original partition unchanged.

Step 5: Switch HDD with SSD

I hope you know how to do this.

Step 6: Boot live CD/USB again

Plug the external hard drive back once booted. Open Gparted again. Verify the identity of the SSD and the external hard drive in Gparted.

Step 7: Copy from the external hard drive to SSD

Select the partition in the external hard drive and from the menu select copy.

Assuming it is a new SSD, you may need to create the MBR (msdos) in it before you can paste the partition.

enter image description here

Select the SSD and paste the partition there.

enter image description here

Apply to actually do the work. Until you press Apply it will look something like this:

enter image description here

Step 8: Reinstall Grub2

Since part of GRUB resides in the MBR, you have to reinstall GRUB in the SSD before you can boot from it.

  1. While still booted from the Live USB, open a terminal, either by searching for it or pressing Ctrl + Alt + T.

  2. From the terminal, run

    sudo grub-install /dev/sdX
    
  • Note: X is the letter assigned to your new SSD.

See How to reinstall grub by ubuntu 14.04 live CD? for details.

Step 9: Reboot from SSD and enjoy!

If all goes well it should work

Hope this helps

Share:
85,167

Related videos on Youtube

Eric
Author by

Eric

Updated on September 18, 2022

Comments

  • Eric
    Eric over 1 year

    On my linux laptop, I currently have a 250 gb hd that has a 100gb partition but only 50 gb of it is used. I would like to change to upgrade my system to a 64 gb SSD.

    I read about Clonezilla and the dd command but this apparently clones the whole partition. This would not work because the partition is 100 gb and my new SSD is only 64 gb.

    I also read that I could resize the 100 gb partition to a smaller size than the 64 gb SSD but won't that destroy data that is currently on my hd partition? And if I can do this without losing data, how to I then copy it to the new 64 gb SSD? (I start a live CD version of Ubuntu, then dd the old disk to an external usb drive. After that I physically remove the old HD, put in the new SSD and dd the partition back from the USB to the new SSD. If I do that, won't I have to also create a partition to my external usb hd?)

    • negusp
      negusp over 7 years
      What you stated could work. Resizing partitions will generally not result in data loss. What's preventing you from doing a reinstallation (which will invariably clean up space)?
    • Eric
      Eric over 7 years
      @PatrickNegus I just finished installing everything on my system. This would prevent me from going through that whole process again!
    • oldfred
      oldfred over 7 years
      I still find it quicker to do a new install. If you installed lots of applications, you can export that list and use it to reinstall. And if you manually edited lots of settings, just copy all of /home from HDD to SSD. Both list of apps & /home should normally be part of your regular backup anyway.
  • Eric
    Eric over 7 years
    Regarding step 4: Do I have to create a partition on the external USB HD? (I already have data on it, but I would have room to create an appropriately sized partition).
  • user68186
    user68186 over 7 years
    No. You will need unformatted space to paste the partition in the external hard drive.
  • Elliot Labs LLC
    Elliot Labs LLC over 7 years
    I use clonezilla to migrate disks/partitions. And yes, from large to small using the shrink method like the author of this answer suggested. I usually shrink using a live CD before loading up clonezilla
  • Eric
    Eric over 7 years
    @user68186 . I followed your instructions and now I have everything working now, thanks. However, I reinstalled grub and I still have all the old boot options that I had before (other linux OS, Windows 7). More importantly, it seems like I haven't gained performance or speed that I should have gained from an SSD. Is it me or are there some settings that need to be addressed. (The system is a Netbook with an Intel Atom processor with 2 GB of ram). (It seems that the fresh install I had tried earlier was faster)
  • user68186
    user68186 over 7 years
    Great! Please accept the answer as the correct by putting the green check mark next to it. I don't know why you don't see any speed improvement. Please ask a new question.
  • Fabby
    Fabby over 7 years
    Wow! This needs an additional upvote just for the effort! ;-)
  • Luka
    Luka about 6 years
    Wow, this can be done with only gparted :O This is amazing
  • Luka
    Luka about 6 years
    I did. but not useful in my case :/ My source HDD is encrypted with LUKS, so gparted sees all of the disk as used.
  • user68186
    user68186 about 6 years
    @Luka Thanks. I don't know enough about encrypted disks to help you. Sorry.
  • Psychotechnopath
    Psychotechnopath over 4 years
    I tried to follow this guide, but unfortunately I'm running into issues: After resizing my original HDD it will not boot anymore, and also my SSD with the copied version will not boot. I did step 8 according to this guide: howtoubuntu.org/… However, when I try to boot any of the two disks now it does launch GRUB, but when I select UBUNTU (Or any other option for that matter) The booting process gets stuck. Any Ideas on how to proceed from here?
  • Psychotechnopath
    Psychotechnopath over 4 years
    I can still see the partitions in Gparted (The way I created them) When I boot from a USB flash drive and launch Gparted.
  • user68186
    user68186 over 4 years
    @Psychotechnopath Please ask a new question with details of what you did in step 8. Where did you install grub, the old drive or the new drive? Did you follow step 5 and switch HDD with SSD? if both are connected at the same time, there may be a conflict with identical UUID. When you ask a new question, put a link to the question in the comment here, so that I can find it.
  • Psychotechnopath
    Psychotechnopath over 4 years
    @user68186 Ty for the response. Link is here: askubuntu.com/questions/1202961/…
  • João Pimentel Ferreira
    João Pimentel Ferreira almost 4 years
    can you be more precise on how to reinstall grub (step 8)? What exactly should I do?
  • user68186
    user68186 almost 4 years
    @JoãoPimentelFerreira I have added how to reinstall grub in step 8 of the answer. Please note this answer is for old systems with MBR (as opposed to GPT) and Legacy BIOS (as opposed to more modern UEFI) systems.