From c7d5702f89e9a60e9bfa2f9c8363c2e0aae2e54a Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 16 Dec 2021 23:28:41 +0100 Subject: [PATCH] bin/disktest: create to test disk performance --- .local/bin/scripts/disktest | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 .local/bin/scripts/disktest diff --git a/.local/bin/scripts/disktest b/.local/bin/scripts/disktest new file mode 100755 index 0000000..3b56a81 --- /dev/null +++ b/.local/bin/scripts/disktest @@ -0,0 +1,11 @@ +#!/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/zero of=tempfile bs=1M count=1K + sudo rm tempfile +fi