When you're running OpenMediaVault (OMV) on your NAS or home server, it's normal to want to check how fast your drives actually areâespecially when you've just plugged in a new SSD or upgraded your storage. Youâd think testing disk speeds would be easy, but turns out⌠not always.
Here's a no-nonsense guide to testing read/write speed on your drives, based on a real setup with all the little problems you might run intoâand how to fix them.
âď¸ Step 1: Checking for hdparm
You might find an online guide telling you to just run:
hdparm -t --direct /dev/sdXâŚbut then get hit with:
-bash: hdparm: command not foundYep. Not installed.
â
Install hdparm first:
sudo apt update
sudo apt install hdparm -yThen try:
hdparm -VIf that still says âcommand not foundâ⌠welcome to my world.
đ§ Why hdparm Still Doesn't Work?
Turns out the command is installed, but it lives in /usr/sbin, and for non-root users like pi, that folder might not be in your $PATH.
To confirm:
sudo find / -type f -name hdparm 2>/dev/nullExpected result:
/usr/sbin/hdparmYou can run it directly:
sudo /usr/sbin/hdparm -t --direct /dev/sdXOrâŚ
Permanently fix your environment:
Edit your .bashrc:
nano ~/.bashrcAdd this to the bottom:
export PATH=$PATH:/usr/sbinThen load it:
source ~/.bashrcNow hdparm should work normally in the terminal.
đ Run the hdparm test
If you're testing an SSD:
sudo hdparm -t --direct /dev/nvme0n1Or for HDD:
sudo hdparm -t --direct /dev/sdaNote: always test the whole device (e.g.,/dev/nvme0n1), not a partition like/dev/nvme0n1p1.
đŹ Want more accurate results? Use fio
hdparm is fast and simple but not always accurateâespecially for SSDs or NVMe drives. For deeper benchmarking, fio is the tool of choice.
Install it:
sudo apt install fio -yRead speed test (sequential):
sudo fio --name=readtest --filename=/dev/nvme0n1 --direct=1 --rw=read --bs=1M --size=1G --numjobs=1 --time_based --runtime=10 --group_reportingWrite speed test (be careful!):
If youâre OK potentially overwriting data (use only on empty drives or partitions!):
sudo fio --name=writetest --filename=/dev/nvme0n1 --direct=1 --rw=write --bs=1M --size=1G --numjobs=1 --time_based --runtime=10 --group_reportingâ ď¸ Donât run write tests on drives that hold important data, unless you know what you're doing.
đ§ Final Tips
- Always use
sudowhen testing block devices. - Donât test partitionsâtest the full device (e.g.,
/dev/sda, not/dev/sda1). - If a command is ânot foundâ even after installation, check your
$PATH. hdparmis great for quick checks,fiois for real benchmarks.- Donât trust online tutorials blindlyâtest, break, and fix. Thatâs the real fun.
â Example Results
On a typical SSD:
hdparm: 420 MB/sec
fio: 2.7 GiB/sec (sequential read)On an older HDD:
hdparm: 110 MB/sec
fio: ~100-130 MB/sec (varies)Thatâs it. Your drives are tested, your terminal isn't yelling at you anymore, and you (hopefully) didnât wipe anything important.
If this helpedâbookmark it. If it broke somethingâwell, now you know what backups are for đ