Unix/Linux Basics: Floppy Disks
If you are coming from the Windows world, Unix floppy drives are
going to seem really dumb. In Windows, the drive is just there: you
pop it open in My Computer, the files are visible, you run the
program you want or just drag files off to your hard drive.
Unix makes it much harder. You gain something because it's
harder, but that gain is not obvious at first, and if you don't
need anything but the simple Windows like access, you may feel that
the Unix way is dumb. It really isn't, so grit your teeth and bear
Windows and DOS people are
used to using floppy drives as file systems. Unix folk are more apt
to use floppies like you'd use a tape (Unix floppies CAN be used
the Windows way, it's just not typical). Because of that basic
culture clash, you need to understand some differences:
When you use "format" in Windows or DOS, you actually get much
more than a format: you also get a file system. That's why you can
copy files to A:, that's why it looks just like your C: drive, only
When you format in Unix, you don't get a file system. Of course
you can get one if you want it, but that's a separate command: mkfs
(or, for a more friendly front-end [SCO]: mkdev fd).
So when you stick a floppy into a Unix box, you can't just copy
files to it or from it as you would in DOS. If you did want to use
it that way, you'd need to make a filesystem on it, and then
mount that filesystem into your hierarchy.
A floppy filesystem does allow you to transfer files from one
place to another by way of a shirt pocket. However, a file system
has a fair amount of overhead (which means that it will hold less
data) and absolutely cannot carry files bigger than 1 floppy in
size. In Dos or Windows if we want to copy a big file like that, we
might use an archive program like Zip or just use the BACKUP
program to span the file across multiple file systems. Unix has
things like Zip, and has tools like BACKUP. The common Unix tools
are "tar" and "cpio", which are very similar to BACKUP in concept
and use, but they dispense with the unnecessary file system for
such tasks. Why waste the space? By not having a file system, there
is less overhead, and (probably more importantly) you can split
large files across multiple floppies, or just put lots of files out
there without worrying about when you will run out of space-
because tar and cpio will tell you when they need another
Some old versions of tar don't understand splitting files
across multiple volumes. Newer versions do, and some of the newest
also offer the ability to compress while creating the archive.
There are third party tar compatible programs, too: see The Supertars
I'm going to assume that your floppy is a 3.5 inch 1.44 MB and
that it is unit 0. If that's true, you could put everything in
/usr/dfw onto floppies with:
tar cvf /dev/fd0 .
Or, if you wanted just certain files, you might do something
tar cvf /dev/fd0 document*
If all of your files won't fit on one floppy, tar will ask you
for another, and so on. Note there is no mounting or unmounting,
and that you didn't need to make a filesystem on the floppy, though
you probably should format new floppies.
To examine what you put on, do:
tar tvf /dev/fd0
After taking these floppies somewhere else, lets say you wanted
to restore them to /usr/dfw2. You'd just:
tar xvf /dev/fd0
If you wanted one specific file, you might say:
tar xvf /dev/fd0 document1
Isn't that easier than mounting and unmounting filesystems?
To find out more about tar and other archivers, do:
The difference between tar or cpio disks and file system disks
sometimes causes real confusion for Dos/Windows people when they
have ftp'd a patch file and the instructions are to put it on a
Unix floppy. The problem often is that the file downloaded is
obviously too big to fit on a floppy- or too big to fit on a Dos
Such a file is often a floppy image: that is, it is the bytes
that tar or cpio would write directly to the floppy. You may not
need to transfer this to a floppy at all. If it is a tar or cpio
image, you can just ftp it to the Unix machine and use it as such
without bothering to put it on a floppy at all. If you DO want or
need it on a floppy, you need to use "dd":
dd if=myimagefile of=/dev/fd0
That's a minimal invocation; in practice I might really do
something more complex but apt to be faster:
dd if=myimagefile of=/dev/fd0135ds18 bs=18k
There are also Windows tools that will let you create raw disk
images. One is RAWRITE, which is available from a number of places
on the web, including ftp://stage.sco.com/TLS/tls096.zip.
for more information.
Also see my Data Transfer
article for more general advice on transferring data.
Almost all Unixes include the ability to mount Dos diskettes.
Possibly, all you'd have to do is:
mount /dev/fd0 /mnt
However, it may not be quite that easy. For example, on SCO
systems, you might need to enable that capability in the kernel by
running "mkdev dos" first. On some systems, you'd need to specify
that you're mounting a Dos diskette:
mount -f DOS /dev/fd0 /mnt
The exact command is going to vary with whatever Unix you have;
try "man mount" (on SCO, "man ADM mount" is the specific page).
Some systems may, like Windows, automatically mount a floppy or
CDROM. You may find that convenient at first, but sooner or later
you'll probably want to disable it, especially for floppies.
Or, you may be able to access files on a Dos diskette without
mounting: most Unixes include tools that let you directly access
Dos filesystems. Linux uses "mtools". On SCO, either "doscp" or the "mtools" are apt to
be available (for SCO, see Skunkware).
On SCO systems, you have the "diskcp" command, but all that it
does is "dd" up to a temporary file and then back out to a new
floppy, which you can do on any Unix/Linux:
dd if=/dev/fd0 of=myimagefile
dd if=myimagefile of=/dev/fd0
For efficiency you'd probably really do:
dd if=/dev/fd0 of=myimagefile bs=18k
dd if=myimagefile of=/dev/fd0 bs=18k
By the way, although the standard at the time of their beginning to fade was 1.44 MB, those disks could be formatted for 1.68 MB; the device on old SCO Unix was /dev/fd0135ds21 (21 sectors per cylinder and 80 sectors per track). See How to identify an unknown disk for a description of the Linux fdrawcmd - imagine the fun you could have identifying ancient floppy disks :-)
There were a few 2.88 MB floppys. This format did not last long: See reasons why 2.88 MB 3.5" Floppy disks disappeared quickly.
Got something to add? Send me email.
Increase ad revenue 50-250% with Ezoic
More Articles by Tony Lawrence
Find me on Google+
© 2013-03-25 Tony Lawrence