ddrescue
Currently I would (1) make a bootable linux USB and boot from it, (2) to recognize input (old) and output (new) units, use gparted or sudo fdisk -l
. (3) install gsmartcontrol and make the long analysis of the old hard disk (sudo gsmartcontrol
opens the GUI). (4) Then, install ddrescue
Alternatively, you could use a gparted live USB, which already comes with gsmartcontrol
(GUI) and ddrescue
, (1) run sudo gsmartcontrol
- long analysis of old drive -, and then:
sudo ddrescue -f -n -r0 /dev/[olddrive] /dev/[newdrive] /root/recovery.log
-f, --force overwrite output device or partition
-n, --no-scrape skip the scraping phase (preventing the utility
from spending too much time attempting to recreate heavily
damaged areas of a file)
-r, --retry-passes=<n> exit after <n> retry passes (-1=infinity) [0]
See also: https://datarecovery.com/rd/how-to-clone-hard-disks-with-ddrescue/
When cloning to a smaller drive
(some details correspond to Dual Boot systems, the example uses an HDD as old drive (internal) and SSD as new drive connected by USB in a beginning, and a linux bootable USB as above):
In gparted loaded (bootable USB) shrink the right most partitions, i.e. Linux partitions when Dual Boot (internal old) unit. If you have Windows, it is not recommended to move the C: partition (start) to the left, or if you do, try using a Windows bootable USB to accomplish that, instead of gparted.
Having unallocated space to the right of the old drive, that accounts for the difference of sizes of the old (HDD) vs new drive (SSD), continue with:
Try restarting your PC as usual (just to check), but before: If you use Linux (HDD) or if your system does not start correctly, use boot-repair (same bootable USB), to fix the modified Linux partitions, specially in a Dual Boot in which Windows is to the left, and you moved Linux to the left or shrank it (old drive).
(bootable USB:) Having a working HDD (all OS load correctly), copy contents as explained above with ddrescue, you have probably a HDD inside de PC, and a (smaller) SSD connected by USB.
Check the SSD status (bootable USB):
sudo gdisk -l /dev/[SSD unit]
Now we will repair the Partition Table of the SSD, which is damaged because of the original GPT type of the SSD vs the probable MBR type of the HDD, and the differences in sizes.
Fix problems:
Consult each command in the gdisk manual; e and n are used because of the error message that we saw in the status, initially.
sudo gdisk /dev/[SSD Unit]
x
e
n
w
Replace the old HDD inside the PC with the new SSD, start again from the bootable USB, run boot-repair and follow correctly all instructions.