LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2006, 01:57 PM   #1
markos
LQ Newbie
 
Registered: Mar 2006
Location: Laurel, Maryland US
Distribution: Fedora
Posts: 17

Rep: Reputation: 0
what's the optimum bs for dd for floppies


I keep reading conflicting things about this topic.
I wanted to make a dban disk wiping floppy. Some
people say use:

Code:
dd if=dban.IMG of=/dev/fd0 bs=512
others say

Code:
dd if=dban.IMG of=/dev/fd0 bs=18k
or even:
Code:
dd if=dban.IMG of=/dev/fd0 bs=1440

I would think the latter two would be much faster
because the 512 bytes would need about 2800
write events to do the whole 1.44 megs
but doing it in 18k or 1440 chunks would be faster.
But someone said that if the bs is too big
there might be a problem if the image is
really crammed to fit the floppy, you might lose
that last part? The reason I was wanting to not
use 512 is the drive seems to take forever using
it that way. If the exact byte size of the image
is:

Code:
ls -l
1474560   dban-beta.2006031900_i386.IMA
could I do this:

Code:
dd if=dban-beta.2006031900_i386.IMA of=/dev/fd0 
                            bs=1474560 count=1
just write the whole thing in one big stream?

Mark
 
Old 03-26-2006, 03:18 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
Quote:
could I do this (...)?
from 'How to ask questions the smart way' (www.catb.org/~esr/faqs/smart-questions.html):

"Try it and see. If you did that, you'd learn the answer."

Seriously. Try it, see if it works. If it doesn't, create the floppy in some other way.

What's fastest probably depends on a lot of factors, but I figure the time per write operation is affinely linear in the number of bytes; that is, the number of seconds per write is a*x + b for x bytes and some magic numbers a and b.

However, the kernel may muck with the writes, delaying them a bit to optimize it.

Bottom line: try a handful of bs/count combinations, see if they work, time them to see which is fastest. You'll probably see a pattern, so investigate that.

hth --Jonas
 
Old 03-26-2006, 07:32 PM   #3
markos
LQ Newbie
 
Registered: Mar 2006
Location: Laurel, Maryland US
Distribution: Fedora
Posts: 17

Original Poster
Rep: Reputation: 0
The smaller block size causes the floppy to get hit with many more
interrupts than the bigger size. I guess what I was asking was
whether there's a risk of bytes being lost if you use the
bigger bs. I also don't just want to experiment with it because
one of the image writes I wanted to do was for a DVD writer
firmware update, and in that case every single byte has to
be correct or my DVD could become a paperweight. I suppose
I could do the experiment and then mount the image file
via loopback and compare the two, that should be able to
confirm an exact copy.
 
Old 03-27-2006, 04:05 PM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
yeah, that ought to work.

For the next time around, make sure to state the whole problem in the thread--if I had known that you weren't just backing up your porn movies, I might have offered a different answer.

Also, be aware that Linux might cache what it has written to the disk (I'm not sure), so if you want to be totally sure (but see also "Trusting Trust", and think about whether you trust your hardware), you might have to shoot that cache (I don't know how, or if it caches writes as reads--one good argument to not do that is that the write might have been unsuccessful... maybe?).
 
  


Reply



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
Optimum Mode Prim3 SUSE / openSUSE 5 08-18-2006 02:22 PM
optimum distro jwijesundra Linux - Newbie 2 02-07-2005 04:45 AM
There is a task of optimum adjustment ukrainet Linux - Newbie 0 02-07-2005 03:30 AM
Optimum Online DHCP rob_roman23 Linux - Networking 7 09-04-2003 05:40 PM
Optimum Online connection tckarthik Linux - Networking 1 07-10-2003 08:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:14 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
Open Source Consulting | Domain Registration