Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

Copy a Floppy


The common geometry of a 3.5" floppy disk has 18 sectors per track with two heads and 80 cylinders. Thus, optimising the dd command to read the contents of a floppy we would use:

  $  dd bs=2x80x18b if=/dev/fd0 of=/tmp/floppy.image
  1+0 records in
  1+0 records out

Then to write to another floppy:

  $  dd bs=2x80x18b < /tmp/floppy.image > /dev/fd0 
  1+0 records in
  1+0 records out

The 2x multiplies the sector size by the number of heads while the 80x identifies the number of cylinders. The 18b specifies 18 sectors of 512 bytes. This gives a total of 1,474,560 bytes and issues a single 1,474,560-byte read request to /dev/fd0 and a single 1,474,560 write request to /tmp/floppy.image, rather than the corresponding cp command:

  $ cp /dev/fd0 /tmp/floppy.image

which issues 360 reads and writes of 4,096 bytes each.


Copyright © 1995-2006 [email protected]

 
 
  Published under the terms fo the GNU General Public License Design by Interspire