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

bigears5000 2010-11-03 17:01

Re: MicroSD benchmark
 
Ok. First command says no such
file or directory. I have saved it to MyDocs in n900?

one1002 2010-11-03 17:35

Re: MicroSD benchmark
 
1 Attachment(s)
well..i had the same problem as you at first..and i was using windows to create the script..

then i booted into ubuntu machine..copy pasted the same way..yet it worked!

i have attach the file..

try this steps:

0. download the attachment (sdbench.sh.txt)
1. rename it to "sdbench.sh" (be sure to untick "hide extensions for known file types". to do this, open My Computer --> Tools --> Folder Options --> View tab.)
2. then copy the script to the phone.. (i copied straight to /home/user/MyDocs/)
3. in xterm, "cd /home/user/MyDocs/" and enter (without the quotes).
4. type "sh sdbench.sh" and enter (without the quotes)
5. it'll display ".......please wait a few minutes"
6. depending on your microSD speed, and size..it'll take at least 2 minutes to display the result..

akih 2010-11-03 18:04

Re: MicroSD benchmark
 
Quote:

Originally Posted by bigears5000 (Post 862392)
Ok. First command says no such
file or directory. I have saved it to MyDocs in n900?

Code:

gzip -d  MyDocs/sdbench_s.sh.gz

bigears5000 2010-11-03 18:20

Re: MicroSD benchmark
 
Ok. Thanks for all the help.
@one1002. Followed this to the letter. Still get testing message and nothing happens after 10 mins
@akih. Typed that in xterm and it says gzip: can't open 'MyDocs/sdbench_s.sh' : File exists

kureyon 2010-11-04 04:04

Re: MicroSD benchmark
 
Quote:

Originally Posted by one1002 (Post 862422)
well..i had the same problem as you at first..and i was using windows to create the script..

then i booted into ubuntu machine..copy pasted the same way..yet it worked!

Text files created using Windows apps will mostly likely default to using CRLF as end of line character(s), this will choke on linux which uses LF.

http://en.wikipedia.org/wiki/Crlf

JayBEE 2010-11-04 04:37

Re: MicroSD benchmark
 
akih:
Thanks for the script! I just ran it and got the following:

Patriot Class 10 8GB
Read: 14.0621 MB/s
Write: 11.4785 MB/s

bountou 2010-11-04 05:33

Re: MicroSD benchmark
 
thanks for the share. worked for me :cool:

question thou, how would i know what class the mmc is? it didn't show up on the results. just the read and write results. thanks

lunat 2010-11-04 05:56

Re: MicroSD benchmark
 
hi,
why don't you use the usual tools like hdparm and the like. do they deliver bad results? doesn't hdparm -tT /dev/mmcblk0 do what you want?

JayBEE 2010-11-04 06:30

Re: MicroSD benchmark
 
Quote:

Originally Posted by bountou (Post 862898)
thanks for the share. worked for me :cool:

question thou, how would i know what class the mmc is? it didn't show up on the results. just the read and write results. thanks

The script does not tell you this, that's for sure. Hopefully the packaging your microSDHC card came in, if you still have it around, would mention it. Some cards have the designation on it, if you have good eyes or a magnifying glass. I believe class designation came about with SDHC. http://en.wikipedia.org/wiki/Secure_Digital

JayBEE 2010-11-04 06:42

Re: MicroSD benchmark
 
Quote:

Originally Posted by lunat (Post 862904)
hi,
why don't you use the usual tools like hdparm and the like. do they deliver bad results? doesn't hdparm -tT /dev/mmcblk0 do what you want?

A quick search around TMO suggested that hdparm can only be had on the N900 by installing Easy Debian. So this script is a simpler means until someone ports hdparm to the N900.

czajunia 2010-11-17 11:46

Re: MicroSD benchmark
 
Results for vanilla Nokia 2GB card (from my old E71) using short script:

Read: 8.25764 MB/s
Write: 6.58328 MB/s

strange1712 2011-03-01 04:38

Re: MicroSD benchmark
 
My result with short script:

Kingston microSDHC 16GB Class 4

Read: 5.20291 MB/s
Write: 8.31255 MB/s

The slower Read I've seen around :(
I'm trying to decide if Buying Class 6 or Class 10, but I'm not convinced at all...

дмитрий 2011-03-01 05:14

Re: MicroSD benchmark
 
Quote:

Originally Posted by akih (Post 861795)
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

How is it that your class 2 is faster than class 4 ?

shadowjk 2011-03-01 09:13

Re: MicroSD benchmark
 
Sandisk is good :-)

Anyway, the class rating is a very specific measurement of /minimum/ speed in one very specific use, that resembles the kinda of load a card would see in a simple digital/video camera.

Your benchmarks are not measuring class rating, and neither class rating nor benchmarks measure how fast the card would perform for nitdroid or meego..

Actually it's probably impossible to determine the real proper class rating through benchmarks, it requires intimate knowledge of the internal structures and operation of the card in question, something only the manufacturer would know.

My own benchmarks of Sandisk, Kingston and Transcend cards have generally shown the sandisk class 2 as having an overall more consistent performance across a wide range of different type of loads, while class 6 kingston and transcend have beaten sandisk class 2 only in the sequential write/read patterns..

bigears5000 2011-03-01 10:16

Re: MicroSD benchmark
 
@one1002 - Since this thread has been bumped, I had another go, and following your instruction, I finally got it to work - After 15 minutes! The only card which I had enough space on for the test to be able to run, was a sandisk class 2. This is obviously why it took a long time, but 15 minutes.

Seems to me like a very long time to read and write, then delete just 1GB, but hey, got it to work, so thanks for your help and also thanks to akih for the script.

vi_ 2011-03-01 10:22

Re: MicroSD benchmark
 
ahem, hdparm?

wnd 2011-03-01 10:45

Re: MicroSD benchmark
 
I know it really depends on what you want to test, but personally I prefer to divide speed tests to raw media speed and file system performance. For raw media speed read/write speed I use dd to read/write the media directly (e.g. dd if=random.static of=/dev/foo bs=1M). For file system performance, I've found bonnie++ to be sufficient. If you want to compile bonnie++ as a Debian package, just grab the sources from unstable; it should compile nicely for Maemo (at least for Diablo) as well.

ciraj 2011-03-04 02:43

Re: MicroSD benchmark
 
hello, please can you make a script for microSD detection issue?? I'm having problems with detection, mem card is ok I tried three, i converted the file system to ext2 as w2el but nit even dmesg shows anything... please help me

casketizer 2011-03-04 03:10

Re: MicroSD benchmark
 
Result
Read: 12,5 MB/s
Write: 10 MB/s

Sandisk Premier 8GB from 2007. No Idea what class but they were the fastest cards on the market back then. Had lots of windows open when I ran the test. Might be faster right after boot.

WhiteWolf 2011-09-01 09:18

Re: MicroSD benchmark
 
None of the scripts work for me.

He throws an error when using /dev /null.

The message reads:

Code:

cp: write error: No space left on device

Result:
Read: awk: cmd. line: 1: Division by zero
Write: awk: cmd. line: 1: Division by zero

I tried to test directly from the terminal and gives the same error. As much as "user" as "root"

I am testing a microSD 32GB Class 10 Lexor.

jschan 2011-09-01 09:46

Re: MicroSD benchmark
 
Not sure if it's the same since I don't have an a 32gb class 10 card, but have you checked out the Fix for Class 10 microSD cards thread?

WhiteWolf 2011-09-01 16:00

Re: MicroSD benchmark
 
is not an issue of the card is to use "/ dev / null"

To write and read it I had no problems.

lunat 2011-09-01 20:56

Re: MicroSD benchmark
 
Quote:

Originally Posted by WhiteWolf (Post 1080099)
is not an issue of the card is to use "/ dev / null"

To write and read it I had no problems.

what are you doing with /dev/null anyways? messuring the speed of /dev/null/ ?

further: no problems reading from /dev/null ? you didn't ("Reads from /dev/null shall always return end-of-file ")! so what did you do?

trlopes1974 2011-09-02 12:04

Re: MicroSD benchmark
 
3 Consecutive runs of 100MB test script.
Lenco 16GB class 6

Nokia-N900:/home/user# ./testsd.sh
testing SD Card read/write speed. Please wait a few minutes.
Testing _WRITE SPEED
Testing READ SPEED
Deleting test file
Result
Read: 10.2354 MB/s
Write: 12.4069 MB/s

Nokia-N900:/home/user# ./testsd.sh
testing SD Card read/write speed. Please wait a few minutes.
Testing _WRITE SPEED
Testing READ SPEED
Deleting test file
Result
Read: 6.77507 MB/s
Write: 20.7469 MB/s

Nokia-N900:/home/user# ./testsd.sh
testing SD Card read/write speed. Please wait a few minutes.
Testing _WRITE SPEED
Testing READ SPEED
Deleting test file
Result
Read: 7.08215 MB/s
Write: 21.978 MB/s



EDIT: New Test with 1GB test file
testing SD Card read/write speed. Please wait a few minutes.
Testing WRITE SPEED
Testing READ SPEED
Deleting test file
Result
Read: 12.221 MB/s
Write: 3.12109 MB/s



Conclusion:Unconclusive

WhiteWolf 2011-09-02 12:19

Re: MicroSD benchmark
 
The line of script that checks from the card reading done:

"time -p cp / media/mmc1/test.dat /dev/null"

The virtual device "/dev/null" is a black hole. Where not to save anything, is used to simulate the copy from one point to another point.

In my device returns the following message:

"cp: can create ' dev/null ' : File exists"

in my GNU/Linux the script works perfectly.

WhiteWolf 2011-09-02 13:41

Re: MicroSD benchmark
 
I have tried to re-create "/ dev / null".

# Sudo gainroot

# Mv / dev / null / dev / null.old
# Mknod-m 0666 / dev / null c 1 3

The result is that in writing ...

# Ls -l /dev/null

It shows that ceased to occupy 9MB, but still displays the same error messages when using "/dev/null"

WhiteWolf 2011-10-04 11:59

Re: MicroSD benchmark
 
Fixed. It allows the use of "/dev/null" as the destination for the command "cp".

I've solved it using "dd" to replace cpmando "cp".

I put the example:

dd if=$DAT of=/dev/null bs=1M 2>&1|head -1


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

vBulletin® Version 3.8.8