Linux and Unix Disk I/O Performance Test with DD

This article describes how to test your system's datastores (Disks) for performance using the DD tool. The commands can be easily copied.

Quite often you ask yourself how fast are my hard disks or NVMe in my system. Quickly one goes on the Internet to search for suitable software. However, every Linux or Unix already has the right solution. DD is the right choice here among others.

What is DD Command?

DD is a command-line Tool for Unix and Unix-like systems where the primary purpose is to copy a file and converting the format of the data during the process.

A few NVMe tests as a template

A quick and easy test, writing 1 gigabyte directly to disk.

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

The next test writes not only one big block to the hard disk but many small blocks.

dd if=/dev/zero of=/tmp/test1.img bs=64 count=1000000 oflag=dsync

These tests can also be performed without cache with the flag "oflag=direct"

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=direct
dd if=/dev/zero of=/tmp/test1.img bs=64 count=1000000 oflag=direct