13 lines
488 B
Bash
Executable File
13 lines
488 B
Bash
Executable File
#!/bin/sh
|
|
# Test disk performance
|
|
# Adapted from https://www.shellhacks.com/disk-speed-test-read-write-hdd-ssd-perfomance-linux/
|
|
disk="${1:-$(df --output=source . | tail -1)}"
|
|
sudo hdparm -MWAgt "$disk"
|
|
if test $# -eq 0
|
|
then echo "Write test:"
|
|
sync
|
|
#sudo dd status=progress if=/dev/random of=/var/tmp/tempfile bs=1M count=1K && sudo dd status=progress if=/var/tmp/tempfile of=tempfile bs=1M count=1K
|
|
sudo dd status=progress if=/dev/zero of=tempfile bs=1M count=1K
|
|
sudo rm tempfile
|
|
fi
|