Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] slow dd? only 10.8 MB/s, I hoped for more
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Fri Feb 25, 2011 6:39 am    Post subject: [SOLVED] slow dd? only 10.8 MB/s, I hoped for more Reply with quote

I used dd to copy disk partition contents, and this is the result:

Code:

# dd if=/dev/hda1 of=/dev/sda1                                                                                                           
390715857+0 records in                                                                                                           
390715857+0 records out                                                                                                           
200046518784 bytes (200 GB) copied, 18449.1 s, 10.8 MB/s


I was thinking the speed should be more like 50 MB/s, did I do something wrong?
_________________
http://phajdan-jr.blogspot.com/


Last edited by phajdan.jr on Fri Feb 25, 2011 12:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1152
Location: /dev/koelsch

PostPosted: Fri Feb 25, 2011 8:11 am    Post subject: Re: slow dd? only 10.8 MB/s, I hoped for more Reply with quote

Hi phajdan.jr.

No you did nothing wrong, dd is not the fastest under the sun :wink:

Eventually you can improve it a little using a bigger block-size parameter like this way:

Code:
# dd if=/dev/hda1 of=/dev/sda1 bs=4MB


Then compare its speed, does it help?
The block doesn't influence your result if the source sectors are i.o. (well readable), so there's no need to be angry to fiddle araound with some different values like bs=1MB

Much success,

Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Fri Feb 25, 2011 11:44 am    Post subject: Reply with quote

Default dd blocksize is just way too small (read 512 bytes, write 512 bytes, read ...), it has so much overhead that it doesn't use the full speed of the disk.

dd utilizes the full disk speed starting with a 100kb blocksize (run your own benchmarks though)

I use bs=1M because that way, the dd progress output (x records out etc.) is easiest to understand, as the number == the megabytes copied, no need to do any math to figure out how far along it is :) you can make it print the current progress with kill -SIGUSR1 `pidof dd`

Note that larger blocksize also has disadvantages, for example if the medium is defective you want a smaller blocksize (actual blocksize of your disk, so that's 512 bytes or with newer HDDs 4k), so it really only leaves out the defective blocks, and not a whopping 4MB (if you used 4MB blocksize). Note that for defective media you'll also need conv=noerror,sync to make it skip the defective blocks and zero their counterparts in the copy.
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Fri Feb 25, 2011 12:17 pm    Post subject: Reply with quote

Thank you, using bs=4M worked great, and the resulting speed was about 50 MB/s.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum