[Fwd: SD card speed]

Marc van Woerkom marc.vanwoerkom at FernUni-Hagen.de
Sun Aug 13 23:42:41 UTC 2006


Mike Tancsa wrote:
> At 03:52 PM 13/08/2006, Marc van Woerkom wrote:
>> Maybe someone here can give a comment?
>>
>> But writing speed seems slow to me, I measure about 56 to 64 kbyte/s 
>> transfer
>> rate only:
>>      tty             ad0              da2             cpu
>> tin tout  KB/t xfrs   MB   KB/t xfrs   MB  us ni sy in id
>>   2  110 16.00   1  0.02   8.00   7  0.05  19  0  4  2 75
>>   9  209 16.00   1  0.02   8.00   7  0.05  17  0  2  1 80
>>   8   94  8.00   1  0.01   8.00   7  0.05  19  0  2  1 78
>>  12  110 40.00   2  0.08   8.00   8  0.06  28  0  2  2 68
>
>
> That seems pretty slow. I get about 2.7MB/s on writes.  How are you 
> writing to it?
>
> port 5 addr 2: high speed, power 250 mA, config 1, Mass Storage 
> Device(0x6362), Generic(0x058f), rev 1.10
>
> This is against 50x CF
>
> % iostat -c 1000 da1
>       tty             da1             cpu
>  tin tout  KB/t tps  MB/s  us ni sy in id
>    0    1 61.19   0  0.01   0  0  0  0 100
>    0  130 64.00  42  2.62   0  0  0  0 100
>    0   44 64.00  43  2.68   0  0  2  0 98
>    0   43 64.00  42  2.62   0  0  3  0 97
>    0   43 64.00  43  2.68   1  0  1  0 98
>    0   43 64.00  41  2.56   0  0  4  0 96
>
> # dd if=/usr/obj/nanobsd.sentex/_.disk.full of=/dev/da1 obs=64k
> 1007616+0 records in
> 7872+0 records out
> 515899392 bytes transferred in 185.655989 secs (2778792 bytes/sec)
>
>
>         ---Mike

Hah, now it gets interesting! :-)

When I write in your fashion, I get similiar results:

[root at hokage /]# dd if=/dev/zero of=/dev/da2 obs=64k
dd: /dev/da2: end of device
967808+0 records in
7560+0 records out
495452160 bytes transferred in 237.168706 secs (2089028 bytes/sec)

To be more precise:
In my case the first couple of seconds nothing at all happened, the transfer
rate was 0 MB/s! No idea why, perhaps some cache effect?
Then the 2.87 MB/s rates kick in. Which is about the reading speed,
I measured originally.

tin tout  KB/t tps  MB/s  us ni sy in id
   0   88  0.00   0  0.00   9  0 10  5 75
   0  163  0.00   0  0.00   5  0  9  5 80
   0  140  0.00   0  0.00   9  0 20  6 64
 368   84  0.00   0  0.00   9  0  5  4 83
  88  100  0.00   0  0.00   2  0  8  2 89
 128   72  0.00   0  0.00   3  0  8  2 88
 200  242 64.00   8  0.50   7  0 12  4 77
 224   75 64.00  38  2.37  26  0 12  5 56
   0  107 64.00  46  2.87  13  0  7  5 74
 184   81 64.00  45  2.81  29  0  6  4 61
 224   93 64.00  46  2.87   8  0  5  3 84
 120   79 64.00  46  2.87   9  0  5  2 84
   0  147 64.00  45  2.81   6  0 12  1 81
   0   91 64.00  46  2.87   6  0  2  2 91
   0   89 64.00  45  2.81   3  0  5  2 90
   0   91 64.00  46  2.87   4  0  4  5 88
   0   98 64.00  46  2.87   3  0  5  3 89
   0   83 64.00  45  2.81   7  0  5  5 82
   0  106 64.00  46  2.87   8  0  6  5 81
   0  100 64.00  45  2.81   7  0  7  2 84

Your question, how I wrote it, was a good one.

Instead of using a USB stick to do quick transfers from my notebook (not 
everywhere I have
a WLAN base station, or ethernet cable available to connect to) I 
intended to use the
cardreader+SD card as an USB stick replacement.

E.g. my wife has a PC with a HP inkjet printer, where the printer has 
its own handy SD
card slot - ready to quickly print photos from SD cards (from digital 
cameras) without
needing the PC to be powered on. It is easier to put a SD card in the 
front slot of the printer
than to fiddle an USB stick into the PCs USB connector at the back side 
of its case.

Usually I put the SD card in the digicam and it gets formated with a FAT 
system.

The SD card I used here, the one with slow write transfer rates, however 
was formatted by me.
Originially I used did a

  newfs_msdos /dev/da2

to format the media as FAT disk..

On the notebook this is ok. I was able to mount it and read/write the card.
However when I put that one in the HP's card reader slot, its LED turned
red instead green and the PC's Windows 2000 compained about a
card failure but then allowed me to see the SD card's contents.

While it worked the red LED buggered me.

After a while I realized that the SD card just got a FAT system,
but was lacking a partioning / slicing. Ouch. :-)

So then I used sysinstall and created a FAT partion on the SD card.
And then I ran

  newfs_msdos /dev/da2s1

to format it.

This made the printer happy (green light) and Windows didn't
feature an error message anymore.

Thus we have this result so far:

- direct writing of the card (dd to /dev/da2) gives full speed transfer 
rates (2.81 MB/s)

- writing to the card, which has a FAT partition (created with 
sysinstall and newfs_msdos),
  via /dev/da2s1 gives slow transfer rates (56-64 kB/s)
  I used the cp command, transfering some podcast mp3 files to the SD card

Now I have to find out who is the culprit.
The formatting? (Because it is formatted at all? Is there a difference 
if I partion and format
the SD card through Windows XP instead of the above FreeBSD command?)
- The cp command?

Regards,
Marc





More information about the freebsd-usb mailing list