From owner-freebsd-usb@FreeBSD.ORG Sun Aug 13 23:42:41 2006 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9144B16A4DD for ; Sun, 13 Aug 2006 23:42:41 +0000 (UTC) (envelope-from q5480035@mailstore.FernUni-Hagen.de) Received: from cl-mailhost.FernUni-Hagen.de (cl-mailhost.fernuni-hagen.de [132.176.114.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 122C743D46 for ; Sun, 13 Aug 2006 23:42:40 +0000 (GMT) (envelope-from q5480035@mailstore.FernUni-Hagen.de) Received: from mailstore.fernuni-hagen.de ([132.176.114.185]) by cl-mailhost.FernUni-Hagen.de with esmtp (Exim 4.24) id 1GCPbL-0004Nr-3R; Mon, 14 Aug 2006 01:42:39 +0200 Received: from [84.151.52.111] (account q5480035 HELO [192.168.178.24]) by mailstore.fernuni-hagen.de (CommuniGate Pro SMTP 5.0.2) with ESMTPA id 16777648; Mon, 14 Aug 2006 01:42:38 +0200 Message-ID: <44DFBA1F.5070405@fernuni-hagen.de> Date: Mon, 14 Aug 2006 01:47:43 +0200 From: Marc van Woerkom User-Agent: Thunderbird 1.5.0.5 (X11/20060731) MIME-Version: 1.0 To: Mike Tancsa References: <44DF8308.9080700@fernuni-hagen.de> <6.2.3.4.0.20060813170759.12be7730@64.7.153.2> In-Reply-To: <6.2.3.4.0.20060813170759.12be7730@64.7.153.2> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-prewhitelist: your reply will pass through without greylisting Cc: freebsd-usb@freebsd.org Subject: Re: [Fwd: SD card speed] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 23:42:41 -0000 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@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