I wanted to find out what effect changing the block size (bs=)
option of the dd command would have on partition copy speeds.
I also wanted to confirm that the default block size (if no bs
option was specified) was indeed 512 bytes as someone had said.
1.) I used dd to completely fill up a 75MB partition with data
from a larger partition.
/dev/hda1 = Debian 3.0 root, ext3
/dev/hda3 = an empty, unformatted partition
command used = "dd if=/dev/hda1 of=/dev/hda3"
(Note: the above command stops copying and aborts once it has
used up all the available space on /dev/hda3.)
2.) I then copied this 75MB partition to an identical partition
on an identical drive using various block sizes and timing the
time dd if=/dev/hda3 of=/dev/hdb3 bs=xx
no bs= 78s 144584+0 records
bs=512 78s 144584+0 records
bs=1k 38s 72292+0 records
bs=2k 38s 36146+0 records
bs=4k 38s 18073+0 records
bs=5k 39s 14458+1 records
bs=50k 38s 1445+1 records
bs=500k 39s 144+1 records
bs=512k 39s 144+1 records
bs=1M 39s 72+1 records
bs=5M 39s 14+1 records
bs=10M 39s 7+1 records
1. The default block size if no bs= option is specified is
2. Any block size larger than the default (512 bytes) will
double the copy speed, but using larger block sizes will not
result in proportionately greater speed increases.
3. The output of dd shows the number of blocks (records) copied
plus (+) the number of partial blocks copied. From the above
results I recalled that my hda1 partition was initialized using
a 4k block size (which was the default block size in cfdisk).
4. The dd man page should be updated to include this basic
operational information (conclusions 1 thru 3) so that people
don't have to run their own tests to figure out how to use it.
5. The dd code should *probably* be updated so that 4k is the
default block size rather than 512 bytes (since this seems to
be the default block size on modern hard disks and it results
in doubling of the copy speed.
Eug-LUG mailing list