How To Test Disk I/O Performance With dd Command

by admin on August 11, 2015

How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?

dd command

dd is a command-line utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy files.

In this tutorial I will show you how to use the dd command to test disk I/O performance.

Open a shell prompt or login to a remote server via ssh and type the following command

# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync

Sample outputs

16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 5.00633 s, 214 MB/s

Test on device

ATA device, with non-removable media
	Model Number:       SAMSUNG MZ7WD120HCFV-00003              
	Serial Number:      S1FZNYAG402762      
	Firmware Revision:  DXM9203Q
	Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0

Understanding dd command options

if=/dev/zero: The name of the input file you want dd the read from.
of=test: The name of the output file you want dd write the input file to.
bs=64k (block-size) : Set the size of the block you want dd to use.
count=16k (number of blocks): The number of blocks you want dd to read.
conv=fdatasync: The flag conv=fdatasync tells dd to sync the write to disk before it exits. Without this flag, dd will perform the write but some of it will remain in memory, not giving you an accurate picture of the true write performance of the disk.

Related Posts:

Leave a Comment

Previous post:

Next post: