From 75b2f56efcabd75d2f39089049075993dd3fd9f3 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 7 Dec 2017 20:23:26 +0800 Subject: Add unix/iotest.sh: a simple IO test tool using dd --- unix/iotest.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 unix/iotest.sh (limited to 'unix/iotest.sh') diff --git a/unix/iotest.sh b/unix/iotest.sh new file mode 100644 index 0000000..fe81c97 --- /dev/null +++ b/unix/iotest.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Simple test to the disk write speed using `dd`. +# +# Aaron LI +# 2017-11-06 +# + +IN=/dev/zero +OUT=/tmp/iotest.$$ +BS=16k +COUNT=16000 + +RESULT=${HOME}/iotest.txt + +CMD="dd if=${IN} of=${OUT} bs=${BS} count=${COUNT} conv=sync" +SPEED=$(${CMD} 2>&1 | grep 'bytes/sec' | awk -F'[()]' '{ print $2 }') +rm ${OUT} +DATE=$(date +'%Y-%m-%d %H:%M') +echo "${DATE} ${BS}*${COUNT} ${SPEED}" >> ${RESULT} -- cgit v1.2.2