LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-06-2009, 01:22 AM   #1
amio.praba@gmail.com
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Rep: Reputation: 0
Exclamation SD card Speed using "dd" - Not working


Hi All,

am calculating throughput for my SD card using "dd" in FC7 2.6.21 kernel.

After mounting the sd card, i run,
:
: time dd if=/dev/zero of=/mnt/sdcard/Myfile.txt bs=512
: count=20480;umount /mnt/sdcard;
: 20480+0 records in
: 20480+0 records out
: 10485760 bytes (10 MB) copied, 0.0658825 s, 159 MB/s
:
: real 0m0.097s
: user 0m0.013s
: sys 0m0.055s

But the throughput shown(159 MB/s) exceeds the throughput of SD specification.
Is it a normal behaviour? What is happening while dd?? Has the data been actually written in the SD card??
Can u pls comment on this??

Thanks,
amio
 
Old 03-06-2009, 01:44 AM   #2
Suresh Maniyath
Member
 
Registered: Feb 2009
Location: India
Distribution: Fedora, Ubuntu
Posts: 37

Rep: Reputation: 19
All the data may not be written into the SD card until a sync is issued, un-mounting the device etc. Could you please try "sync" command and let us know the result.

Regards,
Suresh Maniyath
 
Old 03-06-2009, 02:08 AM   #3
amio.praba@gmail.com
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Suresh,
Thanks for ur reply.
Here is the output with sync.
I tried with sync and umount. It also produces higher number of throughputs..

time dd if=/dev/zero of=/mnt/sdcard/Myfile.txt bs=512 count=204800;sync;
204800+0 records in
204800+0 records out
104857600 bytes (105 MB) copied, 0.720001 s, 146 MB/s

real 0m0.724s
user 0m0.115s
sys 0m0.554s

Am not sure why such higher numbers are got for SD card??
Pls help.

Thanks,
amio
 
Old 03-06-2009, 03:37 AM   #4
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
I think you are probably seeing a cache issue. Try(as root) using hpdarm -tT /dev/sda (or whatever your sd device is ). The -tT should account for the cache.
 
Old 03-06-2009, 03:50 AM   #5
Suresh Maniyath
Member
 
Registered: Feb 2009
Location: India
Distribution: Fedora, Ubuntu
Posts: 37

Rep: Reputation: 19
Amio,
I don't have a disk to try it. But just for a experiment, can you try the two command's in a shell script and time the script. I have a small doubt in the numbers. This is to see a comparative numbers with your previous post.

As mentioned by lazlow you can try "hdparm" utility also.

Suresh Maniyath

Last edited by Suresh Maniyath; 03-06-2009 at 03:56 AM.
 
Old 03-14-2009, 01:01 AM   #6
amio.praba@gmail.com
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks Lazlow and suresh for ur replies..

I tried the following in FC7 for SD cards

hdparm -tT /dev/BlockDev0

/dev/BlockDev0:
Timing cached reads: 1118 MB in 2.00 seconds = 558.61 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
ioctl for device
Timing buffered disk reads: 14 MB in 3.13 seconds = 4.47 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
ioctl for device

Am not sure whether i got the right speed because of the errors "Inappropriate ioctl for device"..

Awainting possible solutions..
Thanks a olot..
Amio
 
Old 03-14-2009, 01:41 AM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,613

Rep: Reputation: 433Reputation: 433Reputation: 433Reputation: 433Reputation: 433
After mounting the sd card, i run,
:
: time dd if=/dev/zero of=/mnt/sdcard/Myfile.txt bs=512
: count=20480;umount /mnt/sdcard;
: 20480+0 records in
: 20480+0 records out
: 10485760 bytes (10 MB) copied, 0.0658825 s, 159 MB/s
:
: real 0m0.097s
: user 0m0.013s
: sys 0m0.055s

But the throughput shown(159 MB/s) exceeds the throughput of SD specification.
Is it a normal behaviour? What is happening while dd?? Has the data been actually written in the SD card??
Can u pls comment on this?
==========

AMIO.PRABA:

There is nothing wrong with your data. Don't worry.
The 159 MB/s is not the size of either your device or the reading. dd does not make pretentions. In your posted data it is very clear that
: 20480+0 records in
: 20480+0 records out
: 10485760 bytes (10 MB) copied
Thats exactly what it is.
The 159 MB/s is the speed in Mega-Bytes-Per-Second that the records were gathered in and accounted out.
So it is only the speed of recording, not the size of device volume.

Go in peace.

Hope this helps.

Last edited by malekmustaq; 03-14-2009 at 01:43 AM.
 
Old 03-14-2009, 02:05 AM   #8
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
amio

You do not want to go that deep into the system (/dev/BlockDev0. At the command line simply type mount. This will give you where the system thinks everything is mounted. That is the point you want to run the hdparm test to.

Quote:
[fred@localhost ~]$ mount
/dev/hda2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda5 on /home type ext3 (rw)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda2 on /media/Storage type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/dev/sdb1 on /media/FEDORA type vfat (rw,noexec,nosuid,nodev,shortname=winnt,uid=500)
In this case (above) you can tell that /dev/sdb1 is the one I would want to run the test on(linked to /media/FEDORA). /media/something is the standard mount point on Fedora for removable media. Depending on your system I would expect your test to be in the /dev/sdX1 format(X=a,b,c,d,...)

Last edited by lazlow; 03-14-2009 at 02:06 AM.
 
Old 03-16-2009, 03:30 AM   #9
amio.praba@gmail.com
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Mustaq,
Thanks for ur explanation.. :-)

Hi Lazlow,
Mount on my system showed /dev/Blockdev0p1 on /mnt/sdcard type ext2 (rw)

I tried "hdparm -tT /dev/BlockDev0p1". But i still get "Inappropriate ioctl for device"..
Are these errors need to be taken into account? Or fine to ignore these??

Thanks,
amio
 
Old 03-16-2009, 03:41 AM   #10
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
That is very strange (/dev/BlockDev0p1). Since FC4 on all my different machines(50+ machines over the years) they have always mounted in the /dev/sdX1 format. Are you manually mounting it by any chance?
 
Old 03-17-2009, 12:17 AM   #11
amio.praba@gmail.com
LQ Newbie
 
Registered: Oct 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hi Lazlow,

I mount my sdcard using my own SD driver and fix the device as BlockDev.
Is it a case that hdparm can only be used on /dev/sdaX..??? :-( .

Still, am not sure about the messages, "HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device" on using hdparm..

Thanks,
Amio
 
Old 03-17-2009, 01:09 AM   #12
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
I THINK there are a few layers that are normally between the block device and the normal device. Skipping those layers MAY be the reason for the error you are seeing.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 08:11 PM
Sound Card not working on "IBM A51 8123-Q2W" pradipta12345 Linux - Hardware 3 05-08-2006 06:29 AM
DLink Wireless Card not working on Ubuntu Linux "Hoary Hedgehog" bluefusionx Linux - Wireless Networking 13 12-25-2005 03:57 PM
ORiNOCO WLAN card not working - "failed to allocate resource" hauneboo Linux - Laptop and Netbook 1 11-29-2005 10:08 AM
"DWL G520+ Dlink Card Not working in FC2" manikantha Linux - Wireless Networking 2 10-06-2004 05:09 PM


All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration