I am creating a copy of a hard drive that has lost data on it so I can attempt to recover data from a copy of the disk and keep the original safe. I am using dd on a Mac and it worked for other drives and storage media very well to create exact duplicates of entire drives.
I had dd running for 45 hours and it copied only 410GB in that time. I noticed the disk indicator led stopped flashing for 5 seconds periodically and in activity monitor it showed only 360GB was written, but 410GB was read. I was using pv to view the pipe so I could know how much it progressed and that also reported 410GB so I think activity monitor is just innacurate with measuring the amount of written data. Also in activity monitor in the graph showing the read and write operations, it only showed changes in the read operations but the write graph was just flat and not showing anything happening. I thought the second dd process that's responsible for writing to the output file had maybe locked up.
The first attempt that took so long was only writing for a couple seconds and then immediately pausing for a much longer period, and it kept getting worse the more it got towards the end of the operation. When the computer rebooted I found the output file and it was actually 410GB just like the read operations in activity monitor suggested, so the write operations were estimated pretty incorrectly. I noticed activity monitor always gives an incorrect amount of written bytes so I no longer trust what activity monitor says, why is it so inconsistent?
I don't want to wear down the old hard drive from which data needs to be recovered. It can break at any moment especially if I keep having to run it for days on end doing lots and lots of read operations.
Why is dd constantly pausing and why does it get progressively worse over time? It starts off very fast but with large amounts of data it just starts getting slower and slower and just spends more time doing seemingly nothing or waiting for something. What is it doing? Is there a better way to copy a disk to a file and have it be an exact copy of every single byte on the drive?
Here are some images of the IO activity graphs:
Right after starting:
After 4 hours:
After 11 hours:
After 26 hours:
I ran some tests copying an old usb stick using the different methods I was given. All files had identical checksums, all these methods ran on a single thread. The results are not what I expected:
- dd: 42:07
- ddrescue: 47:22
- cat: 42:36
- pv: 42:38