Last active
April 29, 2021 03:58
-
-
Save jimmygle/565fd39d61645db1b360437623d53aeb to your computer and use it in GitHub Desktop.
Helpful one liners for testing drive performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Writes zeroes to a drive and reports transfer rate | |
# From here: https://linuxhint.com/benchmark_hard_disks_linux/ | |
cd /mnt/drive | |
dd if=/dev/zero of=benchfile bs=4k count=200000 && sync; rm benchfile | |
# Write & read performance | |
# Writes 1.6GB file to drive and then copies the file to another drive (should be SSD) | |
cd /mnt/drive | |
echo "READ\n" | |
dd if=/dev/zero of=benchfile bs=4k count=400000 | |
echo "WRITE\n" | |
rsync -ah --progress benchfile ~/benchfile | |
rm benchfile && rm ~/benchfile | |
# Tests cache and block speed performance | |
hdparm -tT /dev/sdX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment