Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to find read and write speed of any storage device in Ubuntu

📅 2013-Mar-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ dd, performance, read, speed, ubuntu, write ⬩ 📚 Archive

You do not need to rely on the read and write speeds provided by a hard disk, USB flash drive or SD card manufacturer. It is quite easy to figure out by yourself the sustained read or write speed of any storage device in Ubuntu.

Make sure your storage device is plugged in, has a filesystem and is mounted under Ubuntu. Assume it is mounted at /media/my-usb-disk/ To find the write and read speeds, we write and read a 100MB file to and from a directory of this storage device using the dd command.

$ dd if=/dev/zero of=/media/my-usb-disk/speed-test-file bs=100K count=1k
$ dd if=/media/my-usb-disk/speed-test-file of=/dev/null bs=100K count=1k
$ rm /media/my-usb-disk/speed-test-file

Replace the location of the speed test file with any directory inside the storage medium you are testing. Also, remember to delete the speed test file once you are done.

Tried with: Ubuntu 12.04 LTS