9

user@user-laptop:~$ sudo dd if=sd_backup of=/dev/sdd bs=4M conv=noerror,sync

205520896 bytes (206 MB) copied, 28.564 s, 7.2 MB/s
247463936 bytes (247 MB) copied, 57.1285 s, 4.3 MB/s
260046848 bytes (260 MB) copied, 73.2388 s, 3.6 MB/s
289406976 bytes (289 MB) copied, 104.121 s, 2.8 MB/s
301989888 bytes (302 MB) copied, 119.627 s, 2.5 MB/s
318767104 bytes (319 MB) copied, 134.332 s, 2.4 MB/s
331350016 bytes (331 MB) copied, 149.977 s, 2.2 MB/s
343932928 bytes (344 MB) copied, 164.332 s, 2.1 MB/s
360710144 bytes (361 MB) copied, 180.361 s, 2.0 MB/s
432013312 bytes (432 MB) copied, 258.438 s, 1.7 MB/s
444596224 bytes (445 MB) copied, 273.024 s, 1.6 MB/s
616562688 bytes (617 MB) copied, 452.296 s, 1.4 MB/s
641728512 bytes (642 MB) copied, 482.516 s, 1.3 MB/s

How come dd gets slower after copying this 8GB file? What can I do about it?

1
  • What about try removing 'bs=4M'. I find dd is faster on our servers without using it. Not sure it works for everyone.
    – ericzma
    Jan 26, 2011 at 4:58

2 Answers 2

9

At first, it's showing wrong numbers, because Linux caches your writes. Also disk caches may speed up reading.

After a while caches are consumed (both read and write) and speed drops. dd calculates overall speed, so then it looks like speed is dropping constantly, while in fact it was very fast in the beginning and then slower after that, but average drops slowly.

If you wait a while after finishing previous dd (or another disk intensive operation), caches will be written out and it should be fast again (in the beginning).

2

I found that bypassing the cache speeds dd up considerably. eg:

sudo dd if=/dev/sdxx of=whatever.img bs=32K iflag=direct oflag=direct 

transfers at over 50 MBps for the entire transfer on my system, not using the direct flags slows dd down alot after a few GB.

I hope this helps someone looking for this.

1
  • Can't explain why, but this cut my transfer speed by ~32.4% and rapidly dropping. I had the process running for roughly half an hour without the flags and was getting ~14.2MBps. When I restarted the process with the flags, about 5 minutes in, I am getting ~9.6MBps) This is between two USB 3.0 connected external drives, one a 7200RPM HDD and the other an SSD (Don't know the speed, but it is USB 3.1, so I would assume it should be notable)
    – trex005
    Mar 21, 2022 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .