How to Test SSD Speed in Linux with hdparm and dd

Quick Linux Tip #67:

Question: Is my SSD really as fast as advertised?

Try: sudo hdparm -Tt /dev/sda

Info: hdparm -T measures cached RAM reads; -t benchmarks direct disk reads. dd can test sequential write performance using conv=fdatasync to flush cached writes.

Examples:

  • $ sudo hdparm -I /dev/sda | head -20  # Display drive specs and identity
  • $ fio --name=randwrite --ioengine=libaio --rw=randwrite --bs=4k --size=1G  # Measure random write speed
  • $ iozone -a -g 1G  # Run comprehensive filesystem benchmark

Note: hdparm is useful for sequential read testing. For workload-heavy random I/O, such as databases, use fio. NVMe drives can deliver several GB/s depending on the drive and workload. Always compare benchmark results with the manufacturer's rated specifications and test conditions.




LinuxTeck.com
linuxteck@ubuntu:~$ sudo hdparm -Tt /dev/sda

/dev/sda:
 Timing cached reads:   23456 MB in  2.00 seconds = 11723.45 MB/sec
 Timing buffered disk reads: 1234 MB in  3.00 seconds = 411.23 MB/sec

linuxteck@ubuntu:~$ dd if=/dev/zero of=testfile bs=1M count=1024 conv=fdatasync
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.34 s, 459 MB/s

linuxteck@ubuntu:~$ rm testfile
linuxteck@ubuntu:~$

PREVIOUS ARTICLE Quick Linux Tip #66: How to Redirect stdout and stderr to Separate Files in Linux NEXT ARTICLE Quick Linux Tip #68: How to Extract PDF Pages from the Linux Command Line
About John Britto

John Britto Founder & Chief-Editor @LinuxTeck. A Computer Geek and Linux Intellectual having more than 20+ years of experience in Linux and Open Source technologies.

View all posts by John Britto →

Leave a Reply

Your email address will not be published.