Written: 28 Jan. 2018
Last Updated: 28 Jan. 2018
Last Article:
This Article:
I just upgrade my hard drive to an SSD (Solid State Drive). Now my computer runs soooo much faster! It's usable again! No matter what operating system you have, the following instructions will work, since we will simply be using free and open source, and also no-cost, tools to copy your drive data, byte by byte, from one drive to another. In other words, the copy technique doesn't even read files, as it doesn't know what files are, so it doesn't care what file structure or format you have. It just reads bytes. I'm pretty excited that such great free tools exist. No need to buy Acronis, just do this.
How to clone your hard drive:
1. Buy an external hard drive USB enclosure. Ex: Sabrent Ultra Slim USB 3.0 to 2.5-Inch SATA External Aluminum Hard Drive Enclosure [Black] (EC-UK30) ($8.99).
2. Buy a nice new SSD. Ex: Samsung 860 EVO 1TB 2.5 Inch SATA III Internal SSD. Place the 860 EVO into the enclosure and plug it in.
3. Make a bootable USB flash drive containing Linux Ubuntu 16.04, or whatever the latest LTS (Long-Term Support) version is at the time.
4. Turn off your computer and boot onto the Ubuntu 16.04 bootable flash drive, connect to the internet, and install GNU ddrescue using the following commands:
sudo add-apt-repository universe
sudo apt update
sudo apt install gddrescue
5. Open the "gparted" partition editor to look at your original drive and shrink any partitions if necessary. Make note of the drive name of both the old and new drive. Ex: they might be named /dev/sda and /dev/sdb. DON'T MESS THIS UP OR YOU'LL WIPE ALL YOUR DATA IN THE NEXT STEPS.
6. Make the copy using ddrescue from the command line:
WARNING: DON'T GET THIS BACKWARDS OR YOU'LL WIPE ALL YOUR DATA OFF THE ORIGINAL DRIVE!
Format: ddrescue -f -n FROM_DRIVE TO_DRIVE dd_rescue.log
where FROM_DRIVE and TO_DRIVE are the /dev names from above.
Ex: "ddrescue -f -n /dev/sda /dev/sdb dd_rescue.log"
This copies from drive sda to drive sdb while saving a mapfile/logfile in dd_rescue.log in your current directory you are in when running this command.
For details on what the -f and -n mean and how the command works, read the manual here or via the man pages with the `man ddrescue` command.
Next do "ddrescue -d -f -r3 /dev/sda /dev/sdb dd_rescue.log", again, with the proper /dev names from above.
This uses the mapfile/logfile to now make 3 attempts (-r3) to copy any bad sectors that were previously noted as errors---in case any bad sectors exist.
Q: Is setting up over-provisioning really as simple as leaving unpartitioned space on your hard drive?
A: Yes, Wikipedia states this about over-provisioning: "Furthermore, if any SSD is set up with an overall partitioning layout smaller than 100% of the available space, that unpartitioned space will be automatically used by the SSD as over-provisioning as well." Seagate confirms this claim in its very informative article titled "SSD Over-Provisioning And Its Benefits," when it says: "Some SSD manufacturers provide software tools to allow for over-provisioning of drives by the user. Actually, even without special software, any user can set aside a portion of the SSD when first setting it up in the system by creating a partition that does not use the drive’s full capacity. This unclaimed space will automatically be used by the controller as dynamic over-provisioning."
8. DONE! THAT’S IT! The disk is now completely cloned. Take the computer apart and put the new drive in. It will boot right up as if nothing changed!
(Optionally) save the old hard drive in an anti-static bag in a safe place for a month or two to ensure you don't need to recover anything from it in the near future. Once you're sure your new drive is up-and-running without any issues, slap your old hard drive into your USB enclosure you bought above and use it permanently as an external backup drive!
- In this case, I recommend repartitioning it with gparted from your bootable Ubuntu USB flash drive you created above to quickly delete the old hard drive's files and get it ready-to-go.
How long does the cloning take?
For a 750GB drive to a 1TB drive, for example, this whole process takes 5~7 hrs using a USB 2.0 HDD enclosure, or 2~3 hrs using a USB 3.0 HDD enclosure.
References:
- Read these background instructions here: https://wiki.archlinux.org/index.php/disk_cloning#Using_ddrescue
- Note that you can also use dd for copying or for making a drive image to a compressed file, but ddrescue has the benefit of being designed to efficiently copy drive data even if drive errors or bad sectors exist, and while minimizing further data loss or damage to the disk.
- Read the ddrescue manual if you want: https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html
- Great background info. here.
- It has some really good examples under the section titled “9 A small tutorial with examples”
- https://askubuntu.com/a/227788 – has the `sudo add-apt-repository universe` command I used above.
END
Keywords: hard drive copy, copy hdd to ssd, copy hard drive, back up hard drive, clone hard drive, clone ssd, clone hdd, copy ssd, copy hdd, copy partition, make disk backup, free copy hard drive, free cloning, free cloning tools, linux copy hard drive, linux clone hard drive, mac clone hard drive, mac copy hard drive, windows clone hard drive, windows copy hard drive, backup hard drive, back up hard drive, back up hdd, back up ssd, acronis backup software replacement, acronis true image replacement, acronis true image free and open source tools alternatives
Draft Time: [1 hr.]
ddrescue is also available in Macports. The job can be done on a Mac too.
ReplyDeleteThanks, planned to migrate to SSD for a long time ;
ReplyDeleteLove it
ReplyDelete