I'm cloning a 1TB drive to another 1TB drive using the dd command on Ubuntu using a live USB. I've been monitoring progress by running in another terminal:

sudo kill -USR1 $(pgrep ^dd)   

At first everything was going well and I expected the copying would be done in little over a day. I've come back two days later and see that the rate has slowed to almost a halt.

1055628+0 records in
1055628+0 records out
69181636608 bytes (69 GB, 64 GiB) copied, 160488 s, 431 kB/s
1055629+0 records in
1055629+0 records out
69181702144 bytes (69 GB, 64 GiB) copied, 160491 s, 431 kB/s

Is there anything I can do?

edit: The exact command I used was:

sudo dd if=/dev/sdb of=/dev/sdd bs=64K conv=notrunc,noerror

There have been no errors or warnings. I was not expecting errors and so didn't use any other command to check the disk in advance, although in retrospect that would have been the wise thing to do. Given this, what would now be the best course of action?

edit2: I ran dmesg and now I'm seeing that it ran into a few I/O errors and is likely the culprit.

I will cancel dd and install and use ddrescue. Thanks for the help!

  • Assuming the slowdown is not because of I/O errors (see dmesg or syslog), try dropping caches with echo 3 > /proc/sys/vm/drop_caches. My system sometimes has similar I/O bottlenecks, and that helps. I couldn't identify the reason yet; possible a concurrency pagetable bug, possibly a "can't allocate huge pages" issue. – dirkt Oct 11 at 8:57

Consider using ddrescue instead. If the drive has a bad (unreadable) area or two, ddrescue will skip the slow parts at first (ensuring that you'll get most of the disk cloned quickly enough), and will return to 'scraping' the skipped areas at a later stage. However, if the drive has many bad sectors, the scraping will still take long (possibly days), no matter what you do.

ddrescue /dev/sdb /dev/sdd /tmp/sdb-sdd.log

(The log file can be watched using ddrescueview.)

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.