<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="" color="#000000" face="Tahoma,sans-serif">OK so now we know that DD parameters have little effect on write speed in most cases. What really does have effect is the type of card and the speed of the writer. Most cheap writers are USB2 but to really achieve speed you need USB3 and a FAST card. Of course you pay for it and unless you are really impatient and write a lot of images it would not be worth it. If you are writing an occasional image to SD just start the burn and go get a cup of coffee!<br><br>Currently the fastest <b>write </b>speed for a micro SD card seems to be Sandisk at better than 50MB/sec<br><br><a href="http://www.bhphotovideo.com/explora/photography/buying-guide/fastest-memory-cards-money-can-buy" target="_blank">http://www.bhphotovideo.com/explora/photography/buying-guide/fastest-memory-cards-money-can-buy</a><br><br id="FontBreak"></font><font style="" face="Tahoma,sans-serif"><a href="http://highonandroid.com/android-accessories/fastest-micro-sd-card-shootout-samsung-vs-sony-vs-sandisk/" target="_blank"><a href="http://highonandroid.com/android-accessories/fastest-micro-sd-card-shootout-samsung-vs-sony-vs-sandisk/" target="_blank">http://highonandroid.com/android-accessories/fastest-micro-sd-card-shootout-samsung-vs-sony-vs-sandisk/</a></a><br><br>BTW they are getting cheaper - the Sandisk Extreme pro 8Gb is $17 at amazon, about twice as much as the standard ultra card.<br></font><br><b><font style="font-size:16pt;" size="4">73 Doug</font><font style="font-size:16pt;" size="4"><br></font><font style="font-size:16pt;" size="4">WA3DSP</font><font style="font-size:16pt;" size="4"><br></font><font style="font-size:16pt;" size="4">http://www.crompton.com/hamradio</font></b><font style="font-size:16pt;" size="4"><br></font><br><br><div>> Date: Sat, 21 Nov 2015 21:13:10 -0500<br>> From: kb4fxc@inttek.net<br>> To: arm-allstar@hamvoip.org<br>> Subject: Re: [arm-allstar] faster SD card write<br>> <br>> <br>> Hi Guys,<br>> <br>> I found this thread interesting, too. Over the last few years, I've<br>> written firmware images to hundreds or thousands of flash cards. And,<br>> years ago, I just increased the buffer sizes in dd (probably following<br>> advise from some website). The increased size made sense to me, it was<br>> much faster and I didn't study it any further. Typically, the<br>> "recommended" command I mention to people is very similar to:<br>> <br>> dd if=<input file> of=/dev/sdX bs=1M<br>> <br>> or<br>> <br>> zcat <gzipped input image file> | dd of=/dev/sdX bs=1M<br>> <br>> ...where /dev/sdX is the linux SD card block interface.<br>> <br>> So, since there is some interest and I'm wondering about the optimal<br>> settings, too, I did some googling and testing. I found this webpage that<br>> has some scripts: http://blog.tdg5.com/tuning-dd-block-size/ ...Please<br>> find the test script I used attached to bottom of this message (below). <br>> For this test, I transferred a 64MB file of zeros from /dev/zero.<br>> <br>> <br>> I tried 3 test setups, all Linux:<br>> <br>> First, my primary setup is a roaring 4-core high-speed 3.6GHz 64-bit linux<br>> PC running Debian Wheezy, with a cheapo 8GB Sandisk SD card attached via a<br>> good performing external USB 2.0 hub. Here are the results:<br>> <br>> david-vb:/home/mcgough/ham/RasPi2# ./dd_obs_test.sh /dev/sdf<br>> <br>> block size : transfer rate<br>> 512 : 2.2 MB/s<br>> 1024 : 2.2 MB/s<br>> 2048 : 2.2 MB/s<br>> 4096 : 5.8 MB/s<br>> 8192 : 5.8 MB/s<br>> 16384 : 5.8 MB/s<br>> 32768 : 5.8 MB/s<br>> 65536 : 5.8 MB/s<br>> 131072 : 5.8 MB/s<br>> 262144 : 5.8 MB/s<br>> 524288 : 5.8 MB/s<br>> 1048576 : 5.4 MB/s<br>> 2097152 : 5.8 MB/s<br>> 4194304 : 5.4 MB/s<br>> 8388608 : 5.8 MB/s<br>> 16777216 : 5.4 MB/s<br>> 33554432 : 5.4 MB/s<br>> 67108864 : 5.4 MB/s<br>> <br>> Second, the same setup as above, except the SD card reader is plugged <br>> directly into a USB 2.0 port on the PC, rather than the external <br>> hub...Virtually the same speed:<br>> <br>> david-vb:/home/mcgough/ham/RasPi2# ./dd_obs_test.sh /dev/sdf<br>> block size : transfer rate<br>> 512 : 2.4 MB/s<br>> 1024 : 2.2 MB/s<br>> 2048 : 2.2 MB/s<br>> 4096 : 5.8 MB/s<br>> 8192 : 5.8 MB/s<br>> 16384 : 5.8 MB/s<br>> 32768 : 5.8 MB/s<br>> 65536 : 5.8 MB/s<br>> 131072 : 5.8 MB/s<br>> 262144 : 5.8 MB/s<br>> 524288 : 5.8 MB/s<br>> 1048576 : 5.8 MB/s<br>> 2097152 : 5.4 MB/s<br>> 4194304 : 5.8 MB/s<br>> 8388608 : 5.8 MB/s<br>> 16777216 : 5.4 MB/s<br>> 33554432 : 5.3 MB/s<br>> 67108864 : 5.4 MB/s<br>> <br>> Finally, the same test, using the same SD card reader, but now plugged <br>> into a RPi2 USB port. Note that the RPi2 is running our latest & greatest <br>> beta firmware with a 4.1.13 kernel. Also, the SD card block device is <br>> now /dev/sda (it was /dev/sdf on the PC):<br>> <br>> <br>> [root@RPi2-dev2 ~]# ./dd_obs_test.sh /dev/sda<br>> block size : transfer rate<br>> 512 : 2.3 MB/s<br>> 1024 : 2.3 MB/s<br>> 2048 : 2.4 MB/s<br>> 4096 : 5.6 MB/s<br>> 8192 : 5.6 MB/s<br>> 16384 : 5.6 MB/s<br>> 32768 : 5.7 MB/s<br>> 65536 : 5.6 MB/s<br>> 131072 : 5.6 MB/s<br>> 262144 : 5.6 MB/s<br>> 524288 : 5.6 MB/s<br>> 1048576 : 5.6 MB/s<br>> 2097152 : 5.6 MB/s<br>> 4194304 : 5.6 MB/s<br>> 8388608 : 5.6 MB/s<br>> 16777216 : 5.6 MB/s<br>> 33554432 : 5.6 MB/s<br>> 67108864 : 5.5 MB/s<br>> <br>> Again, using the RPi2 also yielded the results I expected.<br>> <br>> So, on the positive side, using a 1 megabyte buffer (like I typically <br>> tell people) is perfectly acceptable....But, a smaller buffer is fine <br>> too--ANY buffer size at least 4K bytes seems to yield optimal thru-put. <br>> <br>> NOTE that another useful test would be to monitor CPU use while performing <br>> each test and report this as well...I expect the larger buffer sizes will <br>> win here, slightly, with quickly diminishing returns once past perhaps <br>> 128K byte sizes....<br>> <br>> As with everything, your mileage may vary. I recommend trying this script <br>> on -YOUR- system, too. And, please report the results!<br>> <br>> Here is the script:<br>> <br>> #------------------------------------------------------------------------------------<br>> #!/bin/bash<br>> <br>> # Since we're dealing with dd, abort if any errors occur<br>> set -e<br>> <br>> TEST_FILE=${1:-dd_obs_testfile}<br>> [ -e "$TEST_FILE" ]; TEST_FILE_EXISTS=$?<br>> ###TEST_FILE_SIZE=134217728<br>> TEST_FILE_SIZE=67108864<br>> <br>> # Header<br>> PRINTF_FORMAT="%8s : %s\n"<br>> printf "$PRINTF_FORMAT" 'block size' 'transfer rate'<br>> <br>> # Block sizes of 512b 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M 2M 4M 8M 16M 32M 64M<br>> for BLOCK_SIZE in 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 <br>> 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864<br>> do<br>> # Calculate number of segments required to copy<br>> COUNT=$(($TEST_FILE_SIZE / $BLOCK_SIZE))<br>> <br>> if [ $COUNT -le 0 ]; then<br>> echo "Block size of $BLOCK_SIZE estimated to require $COUNT blocks, aborting further tests."<br>> break<br>> fi<br>> <br>> # Create a test file with the specified block size<br>> DD_RESULT=$(dd if=/dev/zero of=$TEST_FILE bs=$BLOCK_SIZE count=$COUNT 2>&1 1>/dev/null)<br>> <br>> # Extract the transfer rate from dd's STDERR output<br>> TRANSFER_RATE=$(echo $DD_RESULT | \grep --only-matching -E '[0-9.]+ ([MGk]?B|bytes)/s(ec)?')<br>> <br>> # Clean up the test file if we created one<br>> [ $TEST_FILE_EXISTS -ne 0 ] && rm $TEST_FILE<br>> <br>> # Output the result<br>> printf "$PRINTF_FORMAT" "$BLOCK_SIZE" "$TRANSFER_RATE"<br>> done<br>> #------------------------------------------------------------------------------------<br>> <br>> <br>> Have fun!<br>> <br>> 73, David KB4FXC<br>> <br>> _______________________________________________<br>> <br>> arm-allstar mailing list<br>> arm-allstar@hamvoip.org<br>> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar<br>> <br>> Visit the BBB and RPi2 web page - http://hamvoip.org<br>> <br></div> </div></body>
</html>