Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # ddBench v1.01 - A simple SSD/HDD sequential read/write Benchmark
- #
- # Notes and Features:
- # 1. Run this script as sudo, for 'sync' and 'drop_caches'
- # to be properly performed before each cycle and at the end of the benchmark.
- # 2. If you have smartmontools installed, and you're not running off a virtual machine,
- # then search for "UNCOMMENT THE TWO LINES BELOW ME:" inside this script and
- # uncomment the two lines, for added functionality.
- # This *should* enable ddBench to list the total number of hours which you disk has
- # been up and running.
- # 3. The file which this test generates (testfile.test) will be erased after each cycle.
- #
- # Changelog:
- # v1.01 - Added HDD/SSD Model and Firmware output.
- # Added HDD/SSD total uptime output.
- # v1.00 - Initial release
- #
- echo
- echo "ddBench v1.01 - A simple SSD/HDD sequential read/write Benchmark"
- echo "Starting now, paste your results starting below this line:"
- echo
- cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo )
- cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo )
- freq=$( awk -F: ' /cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo )
- tram=$( free -m | awk 'NR==2 {print $2}' )
- swap=$( free -m | awk 'NR==4 {print $2}' )
- up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }')
- echo "CPU model : $cname"
- echo "Number of cores : $cores"
- echo "CPU frequency : $freq MHz"
- echo "Total amount of RAM : $tram MB"
- echo "Total amount of Swap : $swap MB"
- echo "System uptime : $up"
- echo "Listing installed and detected HDD/SSD drives:"
- hdparm -I /dev/sd? | grep -e Model -e Firmware
- # UNCOMMENT THE TWO LINES BELOW ME:
- #echo "Listing installed HDD/SSD drives' total uptime:
- #smartctl -a /dev/sda | grep Power_On
- echo
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo "4KB x 262,144 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=4k count=262144
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "8KB x 131,072 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=8k count=131072
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "16KB x 65,536 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=16k count=65536
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "32KB x 32,768 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=32k count=32768
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "64KB x 16,384 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=64k count=16384
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "128KB x 8,192 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=128k count=8192
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "256KB x 4,096 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=256k count=4096
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "512KB x 2,048 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=512k count=2048
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "1,024KB x 1,024 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=1024k count=1024
- rm testfile.test
- echo
- echo "2,048KB x 512 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=2048k count=512
- rm testfile.test
- echo
- echo "4,096KB x 256 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=4096k count=256
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "8,192KB x 128 times"
- dd if=/dev/zero of=testfile.test conv=fdatasync bs=8192k count=128
- rm testfile.test
- sync && echo 3 > /proc/sys/vm/drop_caches
- echo
- echo "Done. Paste your results above this line."
- echo
Advertisement
Add Comment
Please, Sign In to add comment