I am trying to clone a 500 GB SSD to a 1TB SSD. For some reason, it keeps failing when the data being copied reaches 8GB. This is the third 1TB SSD I've tried this on and they all get stuck at the same place. I've ran the following command:
dd if=/dev/sda of=/dev/sdb bs=1024k status=progress
I've also tried to clone the drive using Clonezilla which fails at the same spot. I used GParted to reformat the drive and set it to a EXT4 file system but it still gets stuck at the same spot. Sda is internal and sdb is plugged in externally.
The error I'm getting says:
7977443328 bytes (8.0 GB, 7.4 GB) copied, 208s, 38.4 MB/s
dd: error reading '/dev/sda': Input/output error
7607+1 records in
7607+1 records out
Thanks to @roaima for the answer below. I was able to run ddrescue
and it copied most of the data over. I took the internal SSD out and connected both the new and old SSDs to a CentOS box via USB3. I ran the following:
ddrescue -v /dev/sdb /dev/sdc tmp --force
It ran for over 15 hours. It stopped overnight. But the good thing is it picked back up where it left off when I ran the command again.
I used screen
so that I wouldn't be locked into a single session the second time around :) . I used Ctrl+c
to exit the ddrescue command after 99.99% of the data was rescued since it was hanging there for hours. I was able to boot from the new drive and it booted right up. Here is the state where I exited the ddrescue:
Initial status (read from mapfile)
rescued: 243778 MB, tried: 147456 B, bad-sector: 0 B, bad areas: 0
Current status
ipos: 474344 MB, non-trimmed: 1363 kB, current rate: 0 B/s
ipos: 474341 MB, non-trimmed: 0 B, current rate: 0 B/s
opos: 474341 MB, non-scraped: 522752 B, average rate: 8871 kB/s
non-tried: 0 B, bad-sector: 143360 B, error rate: 0 B/s
rescued: 500107 MB, bad areas: 123, run time: 8h 1m 31s
pct rescued: 99.99%, read errors: 354, remaining time: 14h 31m
time since last successful read: 6m 7s
Scraping failed blocks... (forwards)^C
Interrupted by user
Hopefully this helps others. I think my old drive was starting to fail. Hopefully no data was lost. Now on to resizing the LUKS partition :)
dd
. I know every tutorial says to use it, but it's pointless at best, counterproductive at worst. Usecat
orpv
, or more dedicated tools likeddrescue
. – marcelm Dec 03 '21 at 09:26