maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   MicroSD benchmark (https://talk.maemo.org/showthread.php?t=64971)

akih 2010-11-03 07:05

MicroSD benchmark
 
1 Attachment(s)
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

bigears5000 2010-11-03 08:03

Re: MicroSD benchmark
 
I have been looking for something like this this for a while and this would be ideal for what I want. But when I run the script, it just says: testing sd card read/write speed. please wait a few minutes.
But I get no result. I have waited for 10 minutes and nothing apart from full cpu usage. Any ideas?

Edit: I have just tried three different sd cards and I know they all work, but I don't get a result for any of them.

akih 2010-11-03 09:46

Re: MicroSD benchmark
 
Quote:

Originally Posted by bigears5000 (Post 861834)
but I don't get a result for any of them.

Error messages are displayed?

This is my result:
Code:

$ sh sdbench.sh
testing SD Card read/write speed. Please wait a few minutes.

Result
Read: 14.9293 MB/s
Write: 8.10511 MB/s


lma 2010-11-03 09:53

Re: MicroSD benchmark
 
For slightly (if you're writing/reading 1GB it doesn't matter that much) more accurate results you may want to clear the kernel caches before each test ("echo 3 > /proc/sys/vm/drop_caches").

one1002 2010-11-03 10:53

Re: MicroSD benchmark
 
i got

Quote:

:not found line 2:
:not found line 8:
:no such file or directory
sdbench.sh : line 26: syntax error: "fi" unexpected (expecting "then")
i just copy pasted the script and save as sdbench.sh...what am i doing wrong?

EDITED : got it to work copying from my ubuntu machine..however, i got the same prob as bigears5000..

i didnt get any result as well..

Quote:

Originally Posted by bigears5000 (Post 861834)
I have been looking for something like this this for a while and this would be ideal for what I want. But when I run the script, it just says: testing sd card read/write speed. please wait a few minutes.
But I get no result. I have waited for 10 minutes and nothing apart from full cpu usage. Any ideas?

Edit: I have just tried three different sd cards and I know they all work, but I don't get a result for any of them.


EDITED : IT WORKED!TOOK 3 MINUTES TO DISPLAY THE RESULT..THX!

bigears5000 2010-11-03 12:46

Re: MicroSD benchmark
 
Okay. I must be doing something wrong. This is what I have done on my n900.
Copied the script from above using the copy function.
Opened xterm
Pasted the script
Pressed enter to run it.
Then xterm says testing sd card read write/speed. Please wait a few minutes.
Then nothing happens. No error message, just high cpu usage. I have left for 10 minutes and still nothing. It should work doing it this way shouldn't it?
If not, how do I save the script to n900 as an .sh file?
Thanks in advance.

akih 2010-11-03 16:10

Re: MicroSD benchmark
 
Quote:

Originally Posted by one1002 (Post 861978)
i just copy pasted the script and save as sdbench.sh...what am i doing wrong?

Your scripts line code was wrong.

I attach a file to the first message.
Please use that file.

akih 2010-11-03 16:22

Re: MicroSD benchmark
 
1 Attachment(s)
Quote:

Originally Posted by bigears5000 (Post 862070)
Then nothing happens. No error message, just high cpu usage. I have left for 10 minutes and still nothing. It should work doing it this way shouldn't it?

Ok, i create a test script.
This is short execute time version. (about 30 to 60 seconds)
Please test attachment file.

bigears5000 2010-11-03 16:46

Re: MicroSD benchmark
 
Quote:

Originally Posted by akih (Post 862356)
Ok, i create a test script.
This is short execute time version. (about 30 to 60 seconds)
Please test attachment file.

Sorry to seem stupid, but you are going to have to explain to me what to do and how to open this file. Thanks

akih 2010-11-03 16:57

Re: MicroSD benchmark
 
Quote:

Originally Posted by bigears5000 (Post 862377)
Sorry to seem stupid, but you are going to have to explain to me what to do and how to open this file. Thanks

Copy sdbench_s.sh.gz to N900
Execute following command on X-Terminal
Code:

gzip -d sdbench_s.sh.gz
Run sdbench_s.sh
Code:

sh sdbench_s.sh


All times are GMT. The time now is 02:29.

vBulletin® Version 3.8.8