Difference between revisions of "Disk Speed Test"

From James Dooley's Wiki
Jump to: navigation, search
(Created page with "==Overview== Runs hdparm -t, seeker and Nates dd script. By default each test is run 3 times to get a good running average. Outputs are cleaned up to provide usable informati...")
 
(Script)
Line 34: Line 34:
 
sync
 
sync
 
echo "Write Test"
 
echo "Write Test"
dd if=/dev/zero bs=1M count=2048 2>/dev/null | pv | dd of=$testpath/ddfile 2>/dev/null
+
dd if=/dev/zero bs=1M count=2048 2>/dev/null | pv | dd of=$testpath/ddfile 2>/dev/null | awk '{print $1" "$2" "$3}'
  
 
sync
 
sync
 
echo "Read Test"
 
echo "Read Test"
cat $testpath/ddfile | pv > /dev/null
+
cat $testpath/ddfile | pv > /dev/null | awk '{print $1" "$2" "$3}'
  
 
rm -f $testpath/ddfile
 
rm -f $testpath/ddfile
 
done
 
done
 
</code>
 
</code>
 +
 
==Usage==
 
==Usage==
 
<code>[bash,n]
 
<code>[bash,n]

Revision as of 19:02, 14 June 2011

Overview

Runs hdparm -t, seeker and Nates dd script.

By default each test is run 3 times to get a good running average.

Outputs are cleaned up to provide usable information

For Nates dd test you will need to have the drive mounted and listed in fstab

Script

[javascript,n]

  1. !/bin/bash

testpath=`grep $1 /etc/fstab | awk '{print $2}'` testcount=3

echo "Testing hdparm -t $1" for i in `seq 1 $testcount`; do hdparm -t $1 | grep "Timing" done

echo "Testing seeker $1" for i in `seq 1 $testcount`; do seeker $1 | grep "Results" done

echo "Testing DD pv" for i in `seq 1 $testcount`; do sync echo "Write Test" dd if=/dev/zero bs=1M count=2048 2>/dev/null | pv | dd of=$testpath/ddfile 2>/dev/null | awk '{print $1" "$2" "$3}'

sync echo "Read Test" cat $testpath/ddfile | pv > /dev/null | awk '{print $1" "$2" "$3}'

rm -f $testpath/ddfile done

Usage

[bash,n] sh hdtest <drive path>

What to change

testcount This should be set to the number of times you want this test to run.