View Single Post
Posts: 8 | Thanked: 16 times | Joined on May 2010
#1
I am create a MicroSD read/write speed benchmark script.
  • Simple shell script
  • No require additional software (busybox command only)
  • Create 1GB file on MicroSD

sdbench.sh
Code:
#!/bin/sh

MMC="/media/mmc1"
DAT="$MMC/test.dat"
CNT=1024
SDREAD=""
SDWRITE=""

grep -q "$MMC" /etc/mtab
if [ $? == 0 ];
then
  echo "testing SD Card read/write speed. Please wait a few minutes."
  # Write test
  SDWRITE=`time -p dd if=/dev/zero of=$DAT bs=1M count=$CNT 2>&1|head -3|tail -1`
  # Read test
  SDREAD=`time -p cp $DAT /dev/null 2>&1|head -1`
  # Delete data file
  rm $DAT

  echo
  echo "Result"
  echo $SDREAD | awk '{print "Read:", 1024/$2, "MB/s"}'
  echo $SDWRITE | awk '{print "Write:", 1024/$2, "MB/s"}'
else
  echo "SD Card not found."
fi
usage:
    1. Copy sdbench.sh to home directory
    2. Open X-Terminal
    3. Run script (eg. sh sdbench.sh)
    4. wait a few minute

My result
SanDisc Class2 16GB
Read: 14.5952 MB/s
Write: 8.53831 MB/s

Buffalo Class4 8GB
Read: 13.4031 MB/s
Write: 4.84413 MB/s
Attached Files
File Type: gz sdbench.sh.gz (372 Bytes, 170 views)

Last edited by akih; 2010-11-03 at 16:04.
 

The Following 14 Users Say Thank You to akih For This Useful Post: