User Tools

Site Tools


Table of Contents

dd

name:
dd
layers:
POSIX
features:
data, lowlevel
parallel:
sequential
type:
synthetic
license:
GPLv3+
webpage:
http://www.gnu.org/software/coreutils/dd

dd is a lowlevel tool mainly used for copying and converting files, but you can also use it to benchmark your io-speed.

Usage

To use dd as a benchmark tool, write from /dev/zero (if=/dev/zero) to a testfile or partion (of=path_to_file). Note that the file ore partion should not have any important data, because it would be overwritten in the process. To ensure that dd ends, when the writing process is over, specify oflag=dsync. Otherwise the data could be just written to cache.

Here are a few important comandline options:

  • bs=BYTES number of bytes to be written in one block
  • count=COUNT number of blocks to be written
  • if=FILE inputfile
  • of=FILE outputfile
  • oflag=FLAGS specifying output behaviour

Example Output

Running dd if=/dev/zero of=test bs=1G count=1 oflag=dsync will give you an rough idea about the throughput and result in a output like this:

1+0 records in                                                              
1+0 records out                                          
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 9.50512 s, 113 MB/s

Running dd if=/dev/zero of=test bs=512 count=2048 oflag=dsync will give you an rough idea about the latency and result in a output like this:

2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.759418 s, 1.4 MB/s