Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: how to test SD read/write speed

  1. #1
    Join Date
    Jan 2009
    Beans
    13

    [SOLVED] how to test SD read/write speed

    Hi!

    Just got a brand new SD card off ebay, but bought it from a seller in Hong-Kong and when I got it, it wasn't the same brand as advertised... in fact, it didn't have any brand at all..

    It has a sticker in it saying it is a class 6 device.

    How can I test its read/write speed?
    Looked all over and found nothing for Linux...

    Cheers!
    Last edited by macakinho; May 10th, 2009 at 11:36 PM. Reason: [SOLVED]

  2. #2
    Join Date
    Apr 2009
    Beans
    1,173

    Re: how to test SD read/write speed

    Quote Originally Posted by macakinho View Post
    How can I test its read/write speed?
    Find out which device it mounts as and run hdparm -t. For instance, if I plug a USB pendrive in it mounts as /dev/sdb:

    Code:
    sudo hdparm -t /dev/sdb
    
    /dev/sdb:
    Timing buffered disk reads:   58 MB in  3.10 seconds =  18.70 MB/sec

  3. #3
    Join Date
    Jan 2009
    Beans
    13

    Re: how to test SD read/write speed

    Quote Originally Posted by StuartN View Post
    Find out which device it mounts as and run hdparm -t. For instance, if I plug a USB pendrive in it mounts as /dev/sdb:

    Code:
    sudo hdparm -t /dev/sdb
    
    /dev/sdb:
    Timing buffered disk reads:   58 MB in  3.10 seconds =  18.70 MB/sec

    Thank you!
    This only gave me the write speed though... Read the ma hdparm and didn't find any option to test the write or erase speed.
    Any help here?

  4. #4
    Join Date
    Sep 2007
    Location
    Surrey, UK
    Beans
    1,903
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to test SD read/write speed

    You can use DD to test disk speed, but it can easily lead to damaged data (partitions) if used incorrectly but is probably the most direct way of testing.

    So for example my second internal disk is mount /media/HD2 so running this gives me the write speed:
    Code:
    dd count=1k bs=1M if=/dev/zero of=/media/HD2/test.img
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 7.69365 s, 140 MB/s
    that command writes 1GB to the disk, this large number is because the filesystem on the device will speed up the transfer by caching the data if a small transfer is carried out.

    --edit--
    This is a VERY dangerous command if you miss-type the output file so obviously take care using it and be sure to type correctly!
    System Specs:
    Desktop: E6420 (@3.4GHz, Water Cooled), 4GB DDR2, 1.6 TB HDs, X1950 Pro (OS Driver),
    Dual Boot Win7/Jaunty, 19" 4:3 + 24" 16:9.
    Laptop: Toshiba L30, T2080 Pentium Dual Core, 2 GB DDR2, 250GB Hard disk.

  5. #5
    Join Date
    Jan 2009
    Beans
    13

    Re: how to test SD read/write speed

    Quote Originally Posted by danwood76 View Post
    Code:
    dd count=1k bs=1M if=/dev/zero of=/media/HD2/test.img
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 7.69365 s, 140 MB/s
    Thanks! That did it!

    I'm really disappointed now...
    sticker on SD card: "Class 6"
    terminal: "1073741824 bytes (1.1 GB) copied, 212.248 s, 5.1 MB/s"
    wikipedia : "Class 4"



  6. #6
    Join Date
    Sep 2007
    Location
    Surrey, UK
    Beans
    1,903
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: how to test SD read/write speed

    It could be your card reader/writer that is slower as opposed to the card?
    System Specs:
    Desktop: E6420 (@3.4GHz, Water Cooled), 4GB DDR2, 1.6 TB HDs, X1950 Pro (OS Driver),
    Dual Boot Win7/Jaunty, 19" 4:3 + 24" 16:9.
    Laptop: Toshiba L30, T2080 Pentium Dual Core, 2 GB DDR2, 250GB Hard disk.

  7. #7
    Join Date
    Jan 2009
    Beans
    13

    Re: how to test SD read/write speed

    Quote Originally Posted by danwood76 View Post
    It could be your card reader/writer that is slower as opposed to the card?
    humm.. how can I know that?
    Will try a different SD card. One I know it's not class 6 and post tthe results here.

  8. #8
    Join Date
    Jan 2009
    Beans
    13

    Re: how to test SD read/write speed

    On a SD card I though would be way slower:

    "1073741824 bytes (1.1 GB) copied, 117.218 s, 9.2 MB/s"

    damn it, those cheecky ebayers...

  9. #9
    Join Date
    Oct 2007
    Beans
    154
    Distro
    Edubuntu 6.06 Dapper

    Re: how to test SD read/write speed

    Quote Originally Posted by danwood76 View Post
    Code:
    dd count=1k bs=1M if=/dev/zero of=/media/HD2/test.img
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 7.69365 s, 140 MB/s
    that command writes 1GB to the disk, this large number is because the filesystem on the device will speed up the transfer by caching the data if a small transfer is carried out.
    If you use that command multiple times, is it normal for the speed to be lower on subsequent runs? The first time I ran it, creating a new file, test.img, I got 110MB/sec,* then each time after I run it, I get just under 50MB/sec. I changed to a different output file name, and the same thing happens, faster the first time at 114MB/s, then slower.

    *the 110MB/sec is actually faster than what I get from the hdparm -t command: 90MB/s.

  10. #10
    Join Date
    Jan 2009
    Location
    Vancouver
    Beans
    27

    Re: how to test SD read/write speed

    Quote Originally Posted by danwood76 View Post
    You can use DD to test disk speed, but it can easily lead to damaged data (partitions) if used incorrectly but is probably the most direct way of testing.

    So for example my second internal disk is mount /media/HD2 so running this gives me the write speed:
    Code:
    dd count=1k bs=1M if=/dev/zero of=/media/HD2/test.img
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 7.69365 s, 140 MB/s
    that command writes 1GB to the disk, this large number is because the filesystem on the device will speed up the transfer by caching the data if a small transfer is carried out.

    --edit--
    This is a VERY dangerous command if you miss-type the output file so obviously take care using it and be sure to type correctly!

    Thanks for this info, works like a charm,

    I played around with the 1k(1000 times) and 1M (1 Mb file) to test my 16 GB SD card.
    Keep in mind FAT32 formated card only support single files (thats why the second one gave me a file too large.
    Code:
    tilo@t-laptop:/media/5E33-82DF$ dd count=1k bs=1M if=/dev/zero of=/media/5E33-82DF/test0.img
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 113.36 s, 9.5 MB/s
    tilo@t-laptop:/media/5E33-82DF$ dd count=2k bs=4M if=/dev/zero of=/media/5E33-82DF/test1.img
    dd: writing `/media/5E33-82DF/test.img': File too large
    1024+0 records in
    1023+0 records out
    4294967295 bytes (4.3 GB) copied, 285.687 s, 15.0 MB/s
    tilo@t-laptop:/media/5E33-82DF$ dd count=1k bs=3M if=/dev/zero of=/media/5E33-82DF/test2.img
    1024+0 records in
    1024+0 records out
    3221225472 bytes (3.2 GB) copied, 246.827 s, 13.1 MB/s
    tilo@t-laptop:/media/5E33-82DF$ dd count=1k bs=3M if=/dev/zero of=/media/5E33-82DF/test3.img
    1024+0 records in
    1024+0 records out
    3221225472 bytes (3.2 GB) copied, 269.524 s, 12.0 MB/s
    tilo@t-laptop:/media/5E33-82DF$ dd count=1k bs=3M if=/dev/zero of=/media/5E33-82DF/test4.img
    1024+0 records in
    1024+0 records out
    3221225472 bytes (3.2 GB) copied, 268.86 s, 12.0 MB/s
    tilo@t-laptop:/media/5E33-82DF$

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •