The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Test disk read/write speeds

Contributed by: Marco Nelissen
This tip is valid for: Both BeOS and Haiku

There are a number of ways to test the write and read speeds of your hard drive(s). One good test is to use the dd command in conjunction with /dev/zero to create a file of predetermined size, packed with zeroes. Run this through the “time” command and you’ll get a fairly accurate reading of time and processor usage consumed. Try this:

time dd if=/dev/zero of=temp.txt bs=1024k count=128

This will print the time it takes to write 128 MBs of data in 1 MB blocks to the file temp.txt. Doing this on my system gives:

 128+0 records in
 128+0 records out

 real    0m9.258s
 user    0m0.011s
 sys     0m1.472s

which indicates that it achieved a writing speed of 128/9.258=13.8 megabytes per second. Since total CPU usage is user+sys, this shows CPU usage of (1.1472+0.011)/9.258, or 12.5%.

Bob Rost ( and Ramon Barrios Lascar ( show us how to use dd to test read speeds as well:

Create a 128mb file “temp.dat” on the Desktop, with this command:

time dd if=/dev/zero of=/boot/home/Desktop/temp.dat bs=1024k count=128

Then use dd and direct it toward /dev/null to test the pure read speed:

time dd if=/boot/home/Desktop/temp.dat of=/dev/null bs=1024k count=128
128+0 records in
128+0 records out

real    0m7.312s
user    0m0.004s
sys     0m0.338s

Dividing 128 by 7.312 tells me that my hard drive can read 17.5 mb/sec. Whoopee!

Other disk speed tests include iozone/iostone from BeBits, and the disk benchmarking tools in BeRometer.

Posted in Miscellaneous

(comments are closed).