[Top] | [Contents] | [Index] | [ ? ] |
Fdutils is a collection of utililties for configuring and using the Linux floppy driver. With fdutils, you can:
This manual describes these utilities, and also the floppy driver itself.
1. Where to get fdutils and its documentation 2. Basic usage How to get started 3. Device numbers 4. Media description How can a floppy disk and a format be described to fdutils? 5. Drive descriptions How can a drive and its characteristics be described to fdutils? 6. Storing more data on a floppy disk How to store more data on your floppy disks 7. How autodetection works How the floppy driver distinguishes among the different kinds of disks 8. Configuring the floppy driver via lilo or insmod Lilo boot options understood by the floppy driver 9. Floppy ioctls The ioctl's understood by the floppy driver 10. Command list The available fdutils commands 11. Compile-time configuration via GNU autoconf How to use GNU autoconf to customize fdutils A. Acronyms A brief listing of acronyms used in this documentation B. Interesting formats A brief list of legacy and other formats Command Index Concept index Concept Index
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Fdutils can be found at the following places (+ mirrors):
ftp://www.tux.org/pub/knaff/fdutils/fdutils-5.5.tar.gz ftp://metalab.unc.edu/pub/Linux/utils/disk-management/fdutils-5.5.tar.gz ftp://tsx-11.mit.edu/pub/linux/sources/sbin/fdutils-5.5.tar.gz |
The FAQ included in this package is also available separetely at:
http://alain.knaff.linux.lu/floppy/FAQ.html http://www.tux.org/pub/knaff/floppy/FAQ.html |
Before reporting a bug, make sure that it has not yet been fixed in the Alpha patches which can be found at:
http://fdutils.linux.lu ftp://www.tux.org/pub/knaff/fdutils |
These patches are named
fdutils-
version-
ddmm.taz
, where version
stands for the base version, dd for the day and mm for the
month. Due to a lack of space, I usually leave only the most recent
patch.
There is an fdutils mailing list at fdutils @ www.tux.org . Please send all bug reports to this list. You may subscribe to the list by sending a message with 'subscribe fdutils @ www.tux.org' in its body to majordomo @ www.tux.org . (N.B. Please remove the spaces around the "@" both times. I left them there in order to fool spambots.) Announcements of new fdutils versions will also be sent to the list, in addition to the linux announce newsgroups. The mailing list is archived at http://www.tux.org/hypermail/fdutils/latest
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This chapter describes basic usage of floppies, and gives a few simple tips for using floppies under Linux.
2.1 How disks are organized How a disk is organized, high-level and low-level formats 2.2 File systems supported by Linux Which file systems does Linux support 2.3 What's in a name How floppy drives are named 2.4 What to do if you get an unidentified floppy disk How to identify a disk 2.5 Nickel tours Short summaries of the various storage methods 2.7 New Features of 1.2+ kernels New features of the kernel, mtools, and fdutils
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
All floppies have two levels of formatting, both of which must be known in order to read them. The first is the binary or sector level format, which is how raw data is stored on the disk. The second is a higher level organization, often called a file system, which allows multiple files to be conveniently stored on the disk.
For example, a typical 1.44MB disk contains a low-level format, with 18 sectors per track, 80 tracks, and two sides (or heads); each sector can hold 512 bytes of data for a total of 1474560 bytes (or 1440 KB). When used under MS-DOS, this floppy would have a small portion of the disk used to keep track of files on the disk (including a bootsector, file allocation tables, directories, etc.).
The floppy driver generally takes care of reading the binary, or
low-level format. It can often "guess" the low-level disk geometry
needed to read the disk. This is called autodetection
(see section 7. How autodetection works). If the driver can't autodetect the disk
(e.g. if it is in an unusual format) you can tell the driver what the
geometry is either by using the setfdprm
(see section 10.9 setfdprm)
utility or by using a fixed geometry device device
(e.g. `/dev/fd0H1440').
Under Linux, many different file systems from many sources can be used.
Some of these file systems are interpreted via a utility program (for
example mtools
for using disks with an MS-DOS file system). Many
file systems can alternatively be "mounted" to appear in the UNIX
directory structure until subsequently being unmounted; this is usually
implemented by having the kernel itself interpret the file system on the
disk.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following file systems are supported:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following figure shows the meaning of the different parts of the name of a floppy device:
+--------------- /dev: directory for devices | +------------- fd: floppy disk device prefix | | +------------ 0: floppy drive #0 (A:) (0-1 typical, 0-7 | | | possible) | | |+-- 3.5" drive: (use d for 5.25" double density drives, and | | || h for 5.25" high density drives, | | || u for 3.5" drive of any density) | | || +---- 1440: Capacity (in KB) of format (usually between | | || | 360 and 3920) /dev/fd0u1440 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
dd if=/dev/fd0 of=/tmp/foo count=1 # If it works: getfdprm # This will report what geometry the disk has file /tmp/foo # This may indicate the type of file system mdir a: # Check for an MS-DOS file system tar tvf /dev/fd0 # Check for a tar archive cpio -itv < /dev/fd0 # Check for a cpio archive e2fsck /dev/fd0 # Check for an "ext2" file system # If it doesn't work: # Try the above dd command using various /dev/fd0* devices |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.5.1 mtools Access MS-Dos disks from Unix 2.5.2 Tar (Tape ARchive) Tarring files directly to floppy disks 2.5.3 CPIO (CoPy In/Out) Another archive format 2.6 Ext2 (Second Extended File System) Seconded Extended File System
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
mdir a: # Read directory of MS-DOS disk in drive A: mcopy /tmp/foo\* a: # Copy files beginning with foo in /tmp to A: mcopy a:\* . # Copy all files from A: to current directory mformat a: # Add MS-DOS file system to formatted disk |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
tar tvf /dev/fd0 # Read directory of tar archive in # drive A: tar cvf /dev/fd0 foo1 foo2 # Write foo1 and foo2 to A: in tar # format foo1/foo2 can be entire # directory trees tar xvfp /dev/fd0 # extract entire tar archive in # drive A: |
Tar is not a file system. Only low-level format (superformat
,
see section 10.10 superformat) are needed to prepare a disk to accept a tar
archive.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
cpio -itv < /dev/fd0 # Read directory of cpio archive in A: find foo1 foo2 -print | cpio -ov < /dev/fd0 # Write foo1/foo2 to A: # foo1/foo2 can be entire directory trees cpio -idumv < /dev/fd0 # extract entire CPIO archive in drive A: |
Note: blocks reported are in 512-byte units (due to UNIX System V heritage). Cpio is not a file system. Only low-level format (fdformat or superformat (see section 10.10 superformat) needed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
mke2fs /dev/fd0 1440 # Makes an ext2 filesystem of 1440 # block on A: mke2fs -c /dev/fd0 1440 # Same as above, but tests floppy first e2fsck /dev/fd0 # Tests filesystem integrity. (like # chkdsk in Dos) e2fsck -p /dev/fd0 # Repairs filesystem. (like chkdsk /f # in Dos) mount -t ext2 /dev/fd0 /mnt # Mounts the disk in A: on /mnt. # The directory /mnt must already exist umount /mnt # Unmounts /mnt. No process should # have its working directory in /mnt # No process should have open files in # /mnt |
Note: don't use ext2 on 2m disks
On some systems mke2fs
is also called mkfs.ext2, and e2fsck is also
called fsck.ext2
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.7.1 New features of 1.2+ kernels New kernel features since 1.2.0 2.7.2 New features of mtools-3.0 New mtools features since mtools-3.0 2.7.3 New Utilities Utilities contained in the fdutils package
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
NOTE: Mtools has no longer maintained by its original maintainer Emmet P. Gray after 2.0.7.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
superformat
(replaces fdformat; up to 3.84 MB floppies, faster,
calls mformat)
getfdprm
/setfdprm
fdrawcmd
(allows user-mode programs to do low-level floppy
actions) floppycontrol
(general-purpose floppy driver
configuration utility)
MAKEFLOPPIES
(makes floppy devices)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The floppy device nodes are usually made using the MAKEFLOPPIES
shell script (See section 10.8 makefloppies.).
The major device number for the floppy drives is 2. The minor device number contains describes which drive it represents, and may in addition describe the kind of media which is currently in the drive.
There are two kind of floppy devices:
minor_device = 128 * fdc_nr + unit_nr |
minor_device = 128 * fdc_nr + unit_nr + 4 * format_nr |
In this formula, fdc_nr is the number of the floppy disk
controller (0 or 1, usually 0), and unit_nr is the Unit number (0
to 3, 0 for Dos drive A:
, and 1 for Dos drive B:
).
Format_nr is only meaningful for the fixed format devices. It
describes the disk geometry that is used. It is an index into the
geometry list 3.3 The geometry list. Using all available
controller numbers and all available drive numbers, you may thus connect
up to 8 floppy drives to a single Linux box.
3.1 Variable format devices 3.2 Fixed format devices 3.3 The geometry list 3.4 Adding new formats
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Variable format devices don't have an intrinsic geometry. When using
these devices, the geometry has to be set either by using autodetection
(see section 7. How autodetection works), or by using the FDSETPRM
or
FDGETPRM
ioctl. The latter ioctl can be issued using the
setfdprm
(see section 10.9 setfdprm) and getfdrpm
(see section 10.7 getfdprm) programs. With the default settings, common formats
are detected transparently, and you can access any disk transparently
using the variable format devices.
The geometry information is kept as long as the disk is in the drive,
and is discarded as soon as the disk is removed, unless the geometry has
been declared permanent by using setfdprm's -p
flag
(see section 10.9 setfdprm).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Fixed format devices should not be used under normal circumstances.
Fixed format devices have an intrinsic geometry. They are useful for
the fdformat
program (which is now considered obsolete), and for
booting off floppies which have formats that are different from the
default format (because during booting, there is no application that can
issue the otherwise needed FDSETPRM
ioctl).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The floppy driver contains a builtin list of 32 formats. This list is used for two purposes:
The following formats (geometries) are known:
This table lists first the format_nr (0-31) used to compute the minor number, then the capacity of the format (360KB - 3200KB), and then the type of the drive in which this format is used.
The formats 0..8 are the standard PC formats. The remaining formats are extended capacity formats. Some of them have been taken from Heiko Schroeder's fdpatches (after correcting some minor bugs). Others have been added by David Niemi and me (Alain Knaff). Formats 9, 12, 13, 16, 17, 30 and 31 are non-interleaved formats with normal sized sectors, and have the highest capacity that can be achieved without resorting to interleaving or bigger sectors (6.1 More sectors per cylinder). Formats 10, 11, 14, 15, 18, 19 use interleaving interleaving to achieve a higher capacity (6.2 Using interleave). Formats 20 and 22 to 29 use bigger sectors than usual (6.5 Larger sectors and 6.6 Mixed sector size (MSS) formats).
In addition to these techniques, formats 13-19 use more cylinders than usual (6.4 More Cylinders). USE THESE FORMATS (13-19) ONLY IF YOUR DRIVE SUPPORTS THE NECESSARY NUMBER OF TRACKS
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can redefine the default formats using the setfdprm program (10.9 setfdprm) (1). The following example illustrates how to add a new 19 sector format, and make a device entry for it. First, we pick an entry for it, which we want to reuse. I recommend to redefine an entry which is only rarely used. For instance, if you have no 5 1/4 drive on your system, you can redefine any 5 1/4 entry without a loss. In our example, we pick 10.
First we make the device node:
mknod /dev/fd0H1520 b 2 40 ^ ^ ^ ^ | | | Minor device number (format number * 4 + | | | drive + controller*128) | | Major device number (always 2!) | Blockdevice A name that you choose for the format. I recommend to base the name on the capacity, but you may choose any name you want. |
Then we redefine the geometry of the new device:
setfdprm /dev/fd0H1520 1520 19 2 80 0 0x1b 0 0xcf 0x6c |
Note: This redefines the geometry for any device node with the same format number, not just the new node.
The new geometry is only valid until the next reboot (or removal of the
floppy module). In order to make it permanent, you have to execute the
setfdprm
command from your `/etc/rc' file or whenever you
insert the floppy module.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.1 Introduction Benefits of the new representation 4.2 Syntax What a media description looks like 4.3 The media description dictionary in /etc/fdmediaprm Refer to media by a symbolic name
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Fdutils-5.0 introduces a new uniform format description, which is supported both by setfdprm and superformat. The new format description is easyer to handle, because it allows to set the different parameters of a format description in a symbolic and position independant way, using a series of variable=value clauses. Moreover, it automatically fills in sensible default values for unspecified parameters. Thus you only need to describe those aspects of the format that are important to you, and let the system handle the others.
Moreover, the new description separates those aspects that were specific to the drive (like for instance its rotation speed) from those that are specific to the media (spacial density, number of sectors, etc.).
The same description can be used both by setfdprm and superformat:
setfdprm /dev/fd0 hd sect=21 cyl=83 superformat /dev/fd0 hd sect=21 cyl=83 |
The first line above configures a 21 sector/83 cylinder format for drive 0, and the second line formats a disk using this same format.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A media description is a series of variable=value and
selector clauses. Value is a number followed by an
optional unit. The unit is either KB
(1024 bytes) or b
(blocks of 512 bytes), or none (bytes).
4.2.1 Selecting the density 4.2.2 Selecting the number of cylinders, heads and sectors 4.2.3 Selecting non-standard sector sizes 4.2.4 Legacy formats 4.2.5 Expert options
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To select a density just insert its two letter code into the format description. Selecting a density also selects its default number of sectors, heads and cylinders. However, these latter parameters can be overridden.
hd
dd
ed
qd
sd
If no density is given, the maximal density supported by the drive is used. However, in order to keep the drive description and the media description independent, I strongly suggest that you always indicate the density anyways.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This subsection describes how to select custom formats with a non-standard number of heads, cylinders or sectors. However, note that just describing the number of sectors, heads and cylinders is not enough: you also need to indicate which density your custom format is based on (cf. previous section).
sect=nb_of_sectors
head=nb_of_heads
cyl=nb_of_cylinders
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In order to achieve a higher capacity, you may want to use a bigger sector size.
ssize=sector_size
sect=nb_of_sectors
hd sect=11
ssize=1024
describes a format where one track (1 side) is made up of 11
sectors of 1024 bytes each (thus 11KB per track, and 22KB per cylinder).
tracksize=size_of_one_track
hd tracksize=11KB
ssize=1KB
describes a format where one track contains 11KB of data
(tracksize) stored in sectors of 1KB each.
This option exists mainly to describe MSS (mixed sector size) formats.
For example, hd tracksize=12KB mss
describes a format where one
track which contains 12 KB of data. The sectors size are chosen by the
system in a way to take up the least raw space: 8KB + 4KB.
mss
This option says that the format is an MSS format.
2m
This option says that the format is a so-called 2M format. These formats are intended for easy readability on DOS boxes. Their first track has the usual 18 sectors, whereas the other tracks have bigger sector, and in some cases mixed sector sizes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The swapsides
format allows to descibe disks whose sides are
swapped, such as CBM1581 disks.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following options are not needed in most common situations, as they are implied by the density selector. They may be needed to read some legacy (CP/M) formats.
tpi=48
tpi=96
fm=0
fm=1
dtr=dtr-code
dtr-code rate for FM rate for MFM ============================================= 0 250kb/s 500kb/s 1 150kb/s 300kb/s 2 125kb/s 250kb/s 3 500kb/s 1000kb/s |
perp=0
perp=1
gap=value
fmt_gap=value
fdformat
program, and not by superformat.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`/usr/local/etc/fdmediaprm' (2) contains a dictionary of commonly used media descriptions. Each description is identified by a name, which can then be used by setfdprm or superformat to refer to it, instead of an explicit description.
Each definition starts with "
name":
, followed by
the actual description. Definitions may be spread over several lines,
for better readability. The file may contain comments, which start with
# and stop at the end of the line.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Unlike earlyer version, fdutils-5.0 separates drive descriptions and media description. For more details on this separation, see section 4.1 Introduction. Drive descriptions are used to describe the hardware characteristics of a drive, such as their maximal density, their rotation speed, their form factor, etc.
5.1 Syntax What to put into a drive description 5.2 The drive definition file in `/usr/local/etc/fddriveprm' Where drive definitions are stored
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A drive description is a series of variable=value and selector clauses.
5.1.1 Density The maximal available density on the drive 5.1.2 Form factor Whether this drive is a 3 1/2", 5 1/4" or 8" drive 5.1.3 Cmos code Sums up both density and form factor 5.1.4 Other parameters Rotation speed and tracks per inch
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The density of a drive is the highest media density that it supports.
Density is one of sd
, dd
, qd
, hd
or
ed
. Usually, you do not need to specify this parameter, as it
can be derived from the drives CMOS code.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The form factor of a drive describes the physical dimensions of the
media it accepts. It is one of 3.5
, 5.25
or 8
.
Usually, you do not need to specify this parameter, as it can be derived
from the drives CMOS code.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The PC Bios already knows on its own about the most common drive types. These are named by an integer from 1 to 6, according to the following table.
0 no drive installed 1 5.25 DD 2 5.25 HD 3 3.5 DD 4 3.5 HD 5 3.5 ED 6 3.5 ED |
As you see 3.5 ED drives have two possible codes. Some BIOSes use 5, others use 6. The reason for this is that initially 5 was intended for floppy tape drives, and only 6 was for 3.5 ED drives. However, some BIOS manufacturers didn't know about this convention, and used 5 for the then "new" 3.5 ED drives.
Usually, you do not need to specify this parameter, as it can be read from the physical CMOS of your PC. This parameter may be useful if your BIOS does not store the drive's CMOS code at the expected place, or if you have more than two drives.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
deviation=deviation
Deviation is expressed in ppm. Positive values mean a higher raw
capacity than normal, and negative values mean a lower raw capacity than
normal. The deviation can be measured using the floppymeter
program.
rpm=rotation_speed
Prescribed rotation speed of the drive, expressed in rotations per minute. This is 360 for 5 1/4 HD drives, and 300 for all other commonly available drive types. Usually, you do not need to specify this parameter, as it can be derived from the drive's CMOS code. It is useful however for single density drives or other drives not commonly found on a PC. Usually, you do not to specify this parameter, as it can be derived from the drive's form factor and maximal density.
tpi=cylinder_density
This parameter is only meaningful for 5 1/4 drives. It expresses
whether the drive is able to use 80 tracks (tpi=96
) or only 40
(tpi=48
). Usually, you do not to specify this parameter, as it
can be derived from the drive's maximal density: quad density and high
density drives are 96 tpi, whereas double density drives are 48 tpi.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
`/usr/local/etc/fddriveprm' (4) contains a dictionary of commonly used media descriptions. Each description is identified by a name, which can then be used by setfdprm or superformat to refer to it, instead of an explicit description.
Each definition starts with "drive
number":
,
followed by the actual description. Definitions may be spread over
several lines, for better readability. The file may contain comments,
which start with # and stop at the end of the line.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes the techniques that are used by Linux' floppy driver and superformat to store more data than usual on a floppy disk.
Each section contains a description of the technique used, lists the usages of the disks formatted using this technique (whether they are bootable, whether they are accessible on MS-DOS and for which kind of filesystems they are suitable) and finishes with a table listing the most interesting formats which can be obtained by the described technique.
The table lists for each format the media type it is used for, the total
capacity which can be achieved, the throughput for large reads or writes
and the media description for these disks. This description can the be
used with superformat to make such disks, or with setfdprm to configure
the drive to read/write to them. Some formats (the XDF and XXDF
formats) cannot be accessed directly, and thus there is no media
description for them. For these, we indicate a formatting command used
to make these disks. The formatting command assume that the disk is in
the first drive (/dev/fd0
). Substitute /dev/fd1
if you
want to format XDF or XXDF disks in the second drive.
6.1 More sectors per cylinder Using more sectors per track by packing them close together 6.2 Using interleave Use interleave to pack the sectors even closer together 6.3 Sector skewing Speeding up multi-track reads 6.4 More Cylinders Use up to 83 cylinders 6.5 Larger sectors Minimize per byte overhead by using larger sectors 6.6 Mixed sector size (MSS) formats Minimize slack by using several sector sizes in a same track 6.7 Smart use of the data transfer rate How to get more out of your disk by playing games with the data transfer rate 6.8 2M formats Make autodetection easyer by using a readable first track 6.9 XDF formats Fast high capacity formats 6.10 XXDF formats Fast formats with even higher capacity
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The official formats used by MS-DOS and other operating systems are generally very conservative. It is often possible to fit more sectors on each track than the default by simply reducing the size of the gap between tracks and/or the size of the leftover space at the end of the disk.
For example, a 3 1/2 disk has a raw track capacity of around 12500 bytes. The raw capacity of a floppy disk is not rigorously constant among different boxes, because both the data transfer rate of the floppy controller, and the rotation speed of the drive are subject to small variations. In order to account for these, we have to use a safety margin, and we only use up 12450 bytes of the 12500 bytes that are theoretically available.
A sector contains a header of 62 bytes and 512 bytes of data. A minimum gap of about 45 bytes should be used in order to leave enough time to the floppy controller to "rest" between reading two successive sectors. In total, 619 bytes per sector are thus needed.
This shows that we can fit 12450 / 619 = 20 sectors per track.
Usage: These disks are bootable by Lilo, and can be read in
MS-DOS using numerous shareware utilities such as vgacopy
, or
fdformat
or many others. Check your nearest Simtel mirror.
With dos6, you don't need any add-on utilities, just put the following
line in your config.sys
:
drivparm=/d:0 /f:7 /h:2 /s:21 /t:82 ^ ^ \______________/ | | | drive number | max geometry | drive type, consult the dos help system for details |
Interesting Formats:
density tot. cap. throughput media description 5 1/4 DD 800KB 30KB/s dd sect=10 3 1/2 DD 800KB 25KB/s dd sect=10 3 1/2 HD 1600KB 50KB/s hd sect=21 3 1/2 ED 3200KB 100KB/s ed sect=42 |
The --dd
, --hd
and --ed
options describe the
density of the media to be formatted (double density, high density or
extra density).
The -s
options describes the number of 512 byte sectors per
track.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
After having read a sector, the floppy controller needs to "rest" for a short time. This time is used to compute checksums, to reset internal circuitry, etc. During this time, the floppy disk continues to rotate, and the "rest" time thusly translates to a certain minimal gap size. If a smaller gap is used, the next sector header flies by the read-write head before the floppy controller is ready again to pick up the data. Thus, it has to wait until the next disk rotation until that sector comes back again. This leads to an unacceptably low throughput, as now the system can only read one sector per rotation instead of all sectors in one rotation. If we want to use smaller gaps, we have thus to use sector interleaving. This technique consists in arranging the sectors in a way such that the next logical sector does not immediately follow the current sector, but instead another sector is inserted between two successive sectors. Instead of having the following order:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 |
we would use the following order:
1,12,2,13,3,14,4,15,5,16,6,17,7,18,8,19,9,20,10,21,11, |
This new order allows the floppy controller to rest during the whole time that sector 12 flies by between reading sector 1 and 2. This technique still cuts throughput in half, because two rotations are needed (one for reading sectors 1 to 11, and the second to read sectors 12 to 21). However, this is far better than the 21 rotations which would be needed without interleave.
This technique allows us to use a gap size of just 1, and thus fit 21 sectors on one track.
Usage: Once formatted, interleaved disks can be used in a
similar way to disks which have simply more tracks. They can be
accessed using vgacopy
in Dos, you can boot from them using Lilo,
and you may install any filesystem on them.
Interesting Formats:
density tot. cap. throughput media description 5 1/4 HD 1440KB 27KB/s hd sect=18 3 1/2 HD 1680KB 26KB/s hd sect=21 3 1/2 ED 3360KB 52KB/s ed sect=42 |
You don't need to tell superformat
to use interleaving, it
figures out by itself when interleaving is needed. You don't need to
tell setfdprm
either that a disk is interleaved, as this
information is not needed to read the disk
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Sector skewing is a technique that allows bigger throughputs. It does not increase the capacity of the disk. Sector skewing is only relevant during formatting. Sector skewed disks are indistinguishable from non-skewed disk by software, except for a different throughput.
The principle of sector skewing is to start each track a little bit later than the previous one, i.e. the first logical sector of the second cylinder would for exemple lie near the sixth logical sector of the first cylinder. This is done in order to account for the time needed to seek the drive head from the first cylinder to the second. Without skewing, the first sector would already have passed the drive head after seeking, and we would need to wait for a whole rotation for it to come back again.
By default, superformat applies appropriate skewing to all formats, and
the listed throughput values refer to skewed disks. It is possible to
provide different values for the skew using the --head_skew
and
--track_skew
parameters. head_skew
refers to the offset
between both sides of the same cylinder, and track_skew
refers to
the offset of two consecutive cylinders. 0 means no skew.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Many nominally 40-cylinders or 80-cylinder drives are capable of more cylinders, usually 41 and 83 respectively. These can be used to get extra capacity. However, not all drives can seek to these unofficial extra cylinders, and even on drives which can, these extra cylinders tend to be less reliable.
WARNING: Although most drives are able to use 83 cylinders, some may not. If your drive is making strange noises while accessing these tracks.
Although most drives support more than 80 tracks, I have heard rumors
that some do not, and repeatedly trying to read beyond track 80 might be
damaging to them. In order to know wether your drive supports more than
eighty tracks, first set the number of allowed tracks to 82. (using
floppycontrol --cylinders 82 -d
drive)
Then format a disk with a 82 track format (for example `/dev/fd0H1722'), and copy on or several files to the disk until there are less than 18 KB of free space on the disk. Then eject and reinsert the disk, and compare the files on the disk with the originals. If they are the same, your drive does support 82 tracks. If so, you might want to go further and try with 83 cylinders: `/dev/fd0H1743') This single experience should not damage the drive, although repeating it many times may be dangerous.
If you do have a drive which supports more than 80 cylinders, you have
to call floppycontrol --cylinders 82 drive
before you can
use the extra cylinders. You may put this line into your
`/etc/rc.local', so that the driver is automatically configured for
the addition cylinder after each boot.
If on the other hand your drive doesn't support more than 80 tracks,
you should remove the entries for formats 13-19 from your `/dev'
directory after running MAKEFLOPPIES
, and you should call
floppycontrol --cylinder 80 drive
from your
`/etc/rc.local' (or floppycontrol --cylinder 40 drive
for 5 1/4 DD drives).
By default, 83 cylinder are enabled for any high density and double density drives. 3 1/2 double density drives have 80 cylinders enables, and 5 1/4 double density drives have 40 enabled.
Usage: These disks can be booted from using LILO, and can be
accessed in MS-DOS using vgacopy
.
Interesting Formats:
All formats presented in the two previous sections may be amended to use
83 cylinders instead of 80. Just add the cyl=83
to the format
description for superformat. Using more cylinders has no effect on the
throughput.
density tot. cap. throughput media description 5 1/4 HD 1494KB 27KB/s hd sect=18 cyl=83 3 1/2 HD 1743KB 26KB/s hd sect=21 cyl=83 3 1/2 ED 3486KB 52KB/s ed sect=42 cyl=83 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The floppy controller allows us to use larger sectors than the default size of 512 bytes. All powers of two larger than 256 bytes are acceptable sector sizes. Large sectors have the same header and gap sizes than smaller sectors, thus the overhead per byte of data is smaller. A little calculation shows this: A 1024 byte sector takes up at least 1024+62+1 = 1087 raw bytes. You can fit eleven sectors of this size into a 12450 byte track. This represents 11KB of data per track, versus the 10.5KB only that can be achieved with 512 byte sectors.
Usage: MS-DOS and other operating systems cannot normally read these formats. Lilo is not yet able to boot from this kind of disks.
Performance: When any portion of one of these larger sectors is read, the entire sector must be read. When any portion of such a sector is written to, the entire sector must be read, and then written back with just the necessary portion modified. Both of these circumstances can entail worse performance than are listed in this table for small reads and (especially) small writes.
Interesting Formats:
density tot. cap. throughput media description 5 1/4 HD 1440KB 30KB/s dd sect=9 ssize=1KB 3 1/2 HD 1760KB 55KB/s hd sect=11 ssize=1KB 3 1/2 ED 3520KB 110KB/s ed sect=11 ssize=2KB |
The ssize
parameter of the format description indicates the
sector size to be used.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Using larger sectors has the disadvantage that the granularity is larger. For example, when using 4096 byte sectors, there is enough space to fit two sectors in a track of 12450 bytes raw capacity, but not three. However, the two sector format leaves plenty of space available (4132 bytes), in which smaller sectors would fit. For example, these 4142 raw bytes can be put to good use by filling them with a 2 KB sector (2048+62), plus an 1 KB sector (1024+62) and a 512 byte sector, leaving still 362 bytes for gaps.
Mixed sector size formats take advantage of this by using sectors of several different sizes on a same track. This way, a maximum capacity of 12KB per track, distributed in one 8k sector and one 4k sector can be achieved.
Usage: There is no known MS-DOS utility which can read basic MSS disks. Lilo is not yet able to boot from this kind of disks.
Performance: As any format with larger sectors, the performance for small reads and writes is worse due to the larger granularity.
Interesting Formats:
density tot. cap. throughput media description 3 1/2 DD 880KB 28KB/s hd tracksize=11b mss 5 1/4 HD 1600KB 30KB/s hd tracksize=10KB mss 3 1/2 DD 880KB 28KB/s hd tracksize=11b mss 3 1/2 HD 1840KB 28KB/s hd tracksize=23b mss 3 1/2 HD 1920KB 30KB/s hd tracksize=12KB mss 3 1/2 ED 3680KB 56KB/s ed tracksize=23KB mss 3 1/2 ED 3840KB 60KB/s ed tracksize=24KB mss |
For MSS formats, the system figures out the most efficient repartition
of sector sizes by itself. You do not need to describe the number of
sectors and their size. For MSS disks, the capacity of one track is
described directly, using the tracksize
parameter.
The 1920KB
and 3840KB
formats may be unreliable on some
computers.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Due to different drive rotations speeds, 5 1/4 double density disks and 3 1/2 double density disks are accessed using different raw data transfer rates (300 kb/s for the faster spinning 5 1/4 disks, and only 250 kb/s for the slower spinning 3 1/2 disks). The method described in this section consists in using the faster data transfer rate intended for 5 1/4 disks on 3 1/2 disks, and thus boost the raw capacity per track of these disks. This is possible because 300 kb/s is still low enough not to excede the specification of the disk surface of a double density disk (which 500 kb/s would).
Usage: this method is only available for 3 1/2 double density disks. The disk obtained cannot be booted from by LILO, and are inaccessible from MS-DOS.
The following table shows the media description for a format using this method in conjuncion with the previous methods:
density tot. cap. throughput media description 3 1/2 DD 1120KB 17KB/s qd tracksize=7KB mss |
We use the QD
density selector to describe this particular DTR
set-up, although the acronym QD
is already taken to name 96tpi
double density 5 1/4 disks. However, as this dtr trickery is only
meaningful for 3 1/2, we hope that there will be no ambiguity.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2M formats use a standard geometry (18 normal sized sectors) on the first side of the first cylinder, and an MSS geometry on the rest of the disk. They are inspired for Ciriaco Garcia de Celis' 2M utility for MS-DOS.
The advantage of 2M disks over simple MSS disks is twofold:
Although 2m disk have less sectors on the first track than on the others, the Linux floppy driver, and 2M's low level floppy access routines pretend that it contains the same number of sectors. The missing sectors are called phantom sectors. Writes to these sectors are ignored, and reads return random data. In order to make up for this, 2M and mtools pretend that there is a duplicate FAT in the missing sectors, which is simulated by using data from the first (real) FAT. Thus 2M disks work fine for their intended purpose, which is to hold an MS-DOS filesystem. Never use 2M disks for anything other than a MS-DOS filesystem. For example, never make an ext2 filesystem on a 2M disk. If you need a high capacity ext2 filesystem (or minix fs, raw tar or cpio archive), use the corresponding MSS format instead
Usage: 2M disks are not bootable by LILO. They can be accessed in MS-DOS using the 2M utility. 2M can be found at ftp://FTP.Coast.NET/SimTel/msdos/diskutil/2m30.zip or at any other simtel mirror. 2M disks are not suitable for non MS-DOS filesystems.
Performance: Just as with MSS disks, performance is bad for small reads and writes.
To describe a 2M format, add the keyword 2m
to its media
description:
density tot. cap. throughput media description 3 1/2 HD 1840KB 28KB/s hd tracksize=23b mss 2m |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
XDF is the format used for OS/2 installation floppies.
Just like 2M, XDF uses mixed sector sizes on "generic tracks". The first cylinder uses 512 byte sectors.
However, for XDF disks, the logical order of the sectors on a given track, and their physical order is not the same. This allows a faster access, in a similar way that interleaving does for disk with normal sized sectors and too small gaps. XDF's sector arrangement allows it to read sectors alternatively from both sides, i.e. the first sector from side 0, the second from side 1, and the third from side 0 again. This differs from the usualy formats, where first the entire side 0 is read, and then the entire side 1. This technique allows to read both sides of a disk in roughly three rotations.
The following example illustrates how this is done. In our example we use the XDF format used for 3 1/2 HD disks, which contains one 8KB sector, one 2KB sector, one 1KB sector, and one 512 byte sector per track. The upper line represents the sectors on side 0, and the lower line represents the sectors on side 1. Different numbers represent different sectors. Repeated identical numbers represent a single larger sector. As the disk is circular, some sectors wrap around at the end: we find parts of the 8KB sector, represented by 6, both at the beginning and at the end of each track.
position:| 1 2 5 4 | 1234567890123456789012345678901234567890 |========================================== side 0: | 6633332244444446666666666666666666666666 side 1: | 6666444444422333366666666666666666666666 2 512 byte sector 3 1KB sector 4 2KB sector 6 8KB sector |
When reading a track, sectors are read in the following order:
sector id head position at start position at end ---------------------------------------------------------- 3 0 3 7 4 0 9 16 6 1 18 5 (1st wrap around) 2 0 7 9 2 1 12 14 6 0 16 3 (2nd wrap around) 4 1 5 12 3 1 14 18 |
We notice that the start of each sector happens at least 2 units of position (around 300 bytes), after the end of the previously read sector, thus allowing the floppy disk controller sufficient time to rest. Moreover, we notice two wrap-arounds, yielding three rotations to read the whole cylinder (the third rotation is due to the fact that we stop at a higher position than we started, and that we also need to allow some time for seeking to the next track).
MSS or 2M formats of the same capacity nead at least 2 rotations per side (i.e. 4 per track), yielding a lower throughput.
Usage: XDF disks are not bootable by LILO. They can be
accessed from MS-DOS and OS/2 using xdfcopy.exe
or
xdf.com
. They are only suitable for MS-DOS filesystems. The
floppy driver has no direct support for this format yet, but
mtools
is able to read them using the FDRAWCMD
ioctl.
Interesting Formats:
density tot. cap. throughput formatting command 5 1/4 HD 1600KB 46KB/s xdfcopy -0 /dev/fd0 3 1/2 HD 1840KB 38KB/s xdfcopy -1 /dev/fd0 3 1/2 ED 3840KB 102KB/s xdfcopy -2 /dev/fd0 |
The options -1
, -2
and -3
descibre one out of the
five formats understoood by xdfcopy
(3 XDF formats and 2 XDF
formats).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These use the simple principle as XDF, but use a higher geometry. No new principle is used, these formats are simply more daring (smaller gaps, and smaller margin at the end of the sector).
Usage: XXDF disks are not bootable by LILO, and can't be
accessed by MS-DOS. They are only suitable for MS-DOS filesystems. The
floppy driver has no direct support for this format yet, but
mtools
is able to read them using the FDRAWCMD
ioctl. Due
to their smaller tolerances, XXDF formats may not work on all
drives. Problems may also occur if you write to XXDF disks using a
different drive than the one you used to format the disk.
Interesting Formats:
density tot. cap. throughput formatting command 3 1/2 HD 1920KB 45KB/s xdfcopy -3 /dev/fd0 3 1/2 ED 3840KB 90KB/s xdfcopy -4 /dev/fd0 |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The principle of autodetection is rather simple. When a floppy disk is first accessed, and its geometry is not yet known, the floppy driver tries out a list of up to 8 geometries (format descriptions) until one is found that matches (i.e. that makes it possible to read the first sector or track). This list of geometries is called the autodetection list. There is one autodetection list per drive type (as indicated in the cmos).
The autodetection list doesn't contain the geometry descriptions
themselves, but rather references to entries in the geometry list
(see section 3.3 The geometry list). Each list may contain up to 8 such references.
Each reference can be tagged with a t
flag. If this tag is set,
the floppy driver tries to read the whole track when trying out that
description; if it is not set, it only tries to read the boot sector.
Reading the whole track is useful to distinguish among geometries which
differ only in the amount of sectors per track. In order to do this,
put the geometry with the most sectors first in the list, and set its
t
tag. Use the t
tag only in this case, as it makes
autodetection slower.
Autodetection cannot distinguish between geometries that only differ in the number of heads or in the number of tracks.
Autodetection is meant to supply only a first approximation of the
actual format of the disk. It supplies enough information to enable a
program such as mtools
to read the boot sector, which contains
the exact information. Mtools
then uses the information
contained in the boot sector to set the exact geometry.
The autodetection list is set using the following command:
floppycontrol --autodetect list |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following example restores the default autodetection sequence for a 3 1/2 ED drive:
floppycontrol --autodetect 7,8,4,25,28,22,31,21 |
The following example changes this sequence, so as to add the 1680KB
format (number 11). As only 8 formats are allowed in the autodetection
list, we have to dump one entry (we chose the last, which is numbered
21). The 1680KB format is identical with the default 1440KB format
except for the number of sectors. Thus we must read the whole track in
order to distinguish it from the 18 sector format (t
flag).
Furthermore, the the 1680KB sector format should be detected first, as
an 21 sector disk would also matches the standard format with its 18
sectors.
floppycontrol --autodetect 11t,7,8,4,25,28,22,31 |
The following example attempts to autodetect CBM 1581 disks along with the more usual formats. CBM 1581 disks are not among the predefined formats. Thus we first have to pick one of the predefined formats and change it so it fits our needs. We may for example pick one of the rarely used 5 1/4 formats, such as h880, which bears number 20). We first make a device node bearing the requested number (so that we have a filename to pass to setfdprm), then we chmod it so it becomes accessible to mortal users, finally we configure the geometry of the new node, and enter it into the autodetection list. We place it at the 4th position, just behind the usual ED, HD and DD formats, and before the more exotic extended formats. Indeed, formats which are nearer to the head of the list are autodetected faster, and hence more commonly used formats should be put nearer to the beginning (5).
mknod /dev/fd0cbm1581 b 2 80 chmod 666 /dev/fd0cbm1581 setfdprm /dev/fd0cbm1581 DD DS sect=10 cyl=80 ssize=512 fmt_gap=35 gap=12 swapsides floppycontrol --autodetect 7,8,4,20,25,28,22,31 |
Some formats use more than 80 tracks. It is not possible for the kernel to autodetect the number of tracks in a reasonable time, so you have to use a sufficiently recent version of mtools to set the number of tracks according to the boot sector of the disk. Mtools 3.0 and up are ok. This doesn't obviously work with disks containing something else than a MS-DOS filesystem.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The floppy driver is configured using the floppy=
options in
lilo. These options can be typed at the boot prompt, or entered in the
lilo configuration file.
Example: If your kernel is called linux-2.0
, type the following
line at the lilo boot prompt (if you have a thinkpad):
linux-2.0 floppy=thinkpad |
linux-2.0
:
append = "floppy=thinkpad" |
Several floppy related options may be given, example:
linux-2.0 floppy=daring floppy=two_fdc append = "floppy=daring floppy=two_fdc" |
If you give options both in the lilo config file and on the boot prompt, the option strings of both places are concatenated, the boot prompt options coming last. That's why there are also options to restore the default behaviour.
If you use the floppy driver as a module, use the following syntax:
insmod floppy 'floppy="options"'
. (This line may be
unreadable in the info version of this document. If so, please refer to
the printed version).
Example:
insmod floppy 'floppy="daring two_fdc"' |
Note that in this case floppy=
should only be typed out once,
and not once for each option. You need at least modules-1.3.57 for this
method. However, the older environment variable based syntax is still
available:
floppy="daring two_fdc" insmod floppy
setenv floppy "daring two_fdc" ; insmod floppy
Some versions of insmod are buggy in one way or another. If you have
any problems (options not being passed correctly, segfaults during
insmod), first check whether there is a more recent version. If there
isn't, use the old method using environment variables. Problems with
insmod
happen mostly for options involving both a number and a
string, such as floppy=0,4,cmos
. Options only involving strings,
such as floppy=daring
are not affected.
The floppy related options include:
floppy=daring
floppy=0,daring
floppy=one_fdc
floppy=two_fdc
floppy=address,two_fdc
floppy=thinkpad
floppy=0,thinkpad
floppy=omnibook
floppy=nodma
Tells the floppy driver not to use Dma for data transfers. This is needed for instance on some HP Omnibooks, which don't have a workable DMA channel for the floppy driver. This option is also useful if you frequently get "Unable to allocate DMA memory" messages. Indeed, dma memory needs to be continuous in physical memory, and is thus harder to find, whereas non-dma buffers may be allocated in virtual memory. However, I advise against this if you have an FDC without a FIFO (8272A or 82072). 82072A and later are OK. You also need at least a 486 to use nodma. If you use nodma mode, I suggest you also set the FIFO threshold to 10 or lower, in order to limit the number of data transfer interrupts.
floppy=dma
floppy=nofifo
floppy=fifo
floppy=threshold,fifo_depth
To tune the fifo threshold, switch on over/underrun messages using
floppycontrol --messages
. Then access a floppy disk. If you get a
huge amount of Over/Underrun - retrying
messages, then the fifo
threshold is too low. Try with a higher value, until you only get an
occasional Over/Underrun. It is a good idea to compile the floppy
driver as a module when doing this tuning. Indeed, it allows to try
different fifo values without rebooting the machine for each test. Note
that you need to do floppycontrol --messages
every time you
re-insert the module.
Usually, tuning the fifo threshold should not be needed, as the default (0xa) is reasonable.
floppy=drive,type,cmos
0
1
2
3
4
5
6
Note that there are two valid types for ED drives. This is because 5 was initially chosen to represent floppy tapes, and 6 for ED drives. AMI ignored this, and used 5 for ED drives. That's why the floppy driver handles both) Setting the CMOS to 0 for the first two drives (default) makes the floppy driver read the physical cmos for those drives.
floppy=unexpected_interrupts
floppy=no_unexpected_interrupts
floppy=L40SX
floppy=broken_dcl
floppy=debug
Print debugging messages
floppy=messages
Print informational messages for some operations (disk change notifications, warnings about over and underruns, and about autodetection)
floppy=silent_dcl_clear
Uses a less noisy way to clear the disk change line (which doesn't involve seeks). Implied by daring.
(There are other options as well, but they are considered obsolete, and thus they are not documented here)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
All these ioctl's may be issued using the floppycontrol program. (See also floppycontrols man page)
FDSETPRM
FDDEFPRM
FDGETPRM
FDCLRPRM
FDFLUSH
FDGETDRVTYP
MAKEFLOPPIES
. For the naming convention, see the description
of the MAKEFLOPPIES
script. For formats which work in several drive
types, FDGETDRVTYP
return a name which is appropriate for the oldes
drive type which supports this format.
FDSETDRVPRM
FDGETDRVPRM
FDGETDRVSTAT
FDPOLLDRVSTAT
FDGETFDCSTAT
FDRESET
FDRAWCMD
FDWERRORCLR
FDWERRORGET
FDSETMAXERRS
FDSETDRVPRM
because FDSETDRVPRM
is only accessible to the
superuser whereas FDSETMAXERRS
is accessible to whoever has write access
to the floppy device.
FDMSGON/FDMSGOFF
FDMSGON/FDMSGOFF
don't need superuser status.
There are other ioctls as well, but they are considered obsolete and their use is discouraged.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes the available fdutils commands, and the command line parameters that each of them accepts.
10.1 diskd detect a disk change and execute a command 10.2 diskseekd seeks the drive from time to time to shake of the dust 10.3 fdmount automatically mounts and unmounts floppy disks 10.4 fdrawcmd send raw commands to the floppy disk controller 10.5 floppycontrol configure the floppy driver 10.6 floppymeter measures characteristic parameters of a floppy drive 10.7 getfdprm print current geometry parameters 10.8 makefloppies makes the floppy device entries 10.10 superformat formats high capacity disks 10.9 setfdprm changes the current and permanent geometry parameters 10.11 xdfcopy copies and formats XDF disks
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The diskd command has the following syntax:
|
Diskd waits for a disk to be inserted into a given drive, and then either executes the command or exits. This program can be used to automatically mount a disk as soon as it is inserted.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This program works by switching the motor on for a very short interval, and then seeking to track -1. This might damage hardware in the long run. Amigas, which also use these techniques, are known for having problems with their disk drives no longer spinning up properly after a few month of usage.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-d drive
/dev/fd0
) is observed.
-i interval
-e command
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
fdmountd
program allows automatic unmounting by using the
SYNC
mount options, which switches off write buffering
(see section 10.3 fdmount).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Several people have noticed that Linux has a bad tendency of killing
floppy drives. These failures remained completely mysterious, until
somebody noticed that they were due to huge layers of dust accumulating
in the floppy drives. This cannot happen under Messy Dos, because this
excuse for an operating system is so unstable that it crashes roughly
every 20 minutes (actually less if you are running Windows). When
rebooting, the BIOS seeks the drive, and by doing this, it shakes the
dust out of the drive mechanism. diskseekd
simulates this effect
by seeking the drive periodically. If it is called as diskseek
,
the drive is seeked only once.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The syntax for diskseekd
is as follows:
|
-d drive
-i interval
diskseekd
and 0 for diskseek
.
-p pidfile
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The fdmount
program mounts a floppy disk in the specified
drive. It tries to figure out the exact format and filesystem type of
the disk from data in the disk's boot sector or super block and the
auto-detected track layout.
Currently, fdmount supports the filesystems minix
, ext
,
ext2
, xia
, and msdos
, and includes special support
for disks formatted by the 2M
utility for MS-DOS.
It also checks whether the disk is write protected, in which case it is mounted read-only.
The symbolic drivename is (currently) one of `fd[0-7]', corresponding to the special device files `/dev/fd[0-7]'. If drivename is not specified, `fd0' is assumed.
The disk is mounted on the directory mountpoint, if specified, or on `/fd[0-7]'. In either case, the mount point must be an existing, writable directory.
Due to a bug in the floppy driver (?), the polling interval (-i flag) must be longer than the spindown offset. Thus you need to do (for example) floppycontrol --spindown 99 before starting fdmountd in daemon mode
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-l --list
-d --daemon
--detach
-p file
--pidfile file
Dumps the process id of the daemon to
file. This makes killing the daemon easier:
kill -9 `cat file`
-i interval
--interval interval
-o options
--options options
check
, conv
, dotsOK
, debug
, fat
,
quiet
, blocksize
. The following Ext2 options are
supported: check
, errors
, grpid
, bsdgroups
,
nogrpid
, sysvgroups
, bsddf
, minixdf
,
resgid
, debug
, nocheck
. When running as a daemon,
options not applying to the disk that is inserted (because of its
filesystem type) are not passed to mount.
-r --readonly
-s --sync
SYNC
option.
--nosync
SYNC
option, even when running as daemon.
--nodev
NODEV
option. Ignored for msdos
filesystems, otherwise always set for non-root users.
--nosuid
NOSUID
option. Ignored for msdos
filesystems, otherwise always set for non-root users.
--noexec
NOEXEC
option.
-f --force
-h --help
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When mounting on the default mount point, the mount points' owner is set
to the current user, and the access flags according to the user's umask.
For a specified mountpoint, owner and permissions are left
unchanged. Default mount points are called /fd0
, /fd1
,
... , /fd7
.
The user running fdmount must have read access to the floppy device for read only mounts, and read/write access for read/write mounts.
Fdmount can be run suid root, allowing users to mount floppy disks. The following restrictions are placed upon non-root users:
nodev
and
nosuid
flags set.
However, do not rely on fdmount being secure at the moment.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In daemon mode, the specified drive is periodically checked and if a disk is inserted, it is automatically mounted.
When the disk is removed, it is automatically unmounted. However, it is
recommended to unmount the disk manually before removing it. In
order to limit corruption, disks are mounted with the SYNC option when
running in daemon mode, unless the --nosync
flag is given.
Note that this mode has some potential drawbacks:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
error opening device name
error reading boot/super block
unknown filesystem type
sorry, can't figure out format (fs filesystem)
failed to mount fs> <sizeK-disk
mount
system call failed.
failed to unmount
unmount
system call failed.
cannot create lock file /etc/mtab~
Can't access mountpoint
mountpoint is not a directory
not owner of mountpoint
No write permission to mountpoint
Not owner of mounted directory: UID=uid
invalid drive name
drive name does not exist
Drive name is mounted already
--force
option if you think this is wrong.
Drive name is not mounted
--force
option if you think this is wrong.
ioctl(...) failed
FDGETDRVTYP
or FDGETDRVSTAT
,
ioctl's you should probably update your Linux kernel.
mounted fs size-disk (options)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
fdrawcmd
is used to send raw commands to the floppy disk controller, after
having selected a given drive. You must have write permission to the
selected drive.
When writing to a disk, data is read from stdin; when reading, data is printed to stdout. Diagnostic messages, return values from the controller, and the value of the disk change line after the command are printed to stderr.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
All numbers may be given in octal (0211), decimal (137), or hexadecimal (0x89).
drive=drive
rate=rate
length=length
repeat=count
cylinder=count
command
read
or write
), or a number representing the
commands floppy disk controller opcode. A named command has already a
mode associated with it, whereas for a number the mode parameter should
be described using the mode
option.
parameters
mode
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The description of the various floppy commands given in this manpage is very sketchy. For more details get the 82078 spec sheet which can be found at:
http://www-techdoc.intel.com/docs/periph/fd_contr/datasheets/ |
Look for the chapter COMMAND SET/DESCRIPTIONS
. Older FDCs only
support a subset of the commands described therein, but the syntax for
the commands that do exist is the same.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
read drvsel cyl head sect szcod spt rw-gap szcod2
spt
, this is used to switch to the second head when the first
side has been read), and size of the read-write gap. szcod2 should
be 0xff. read
returns ST0 ST1 ST2 and cyl head sect
szcod of the next sector to be read; see
`/usr/include/linux/fdreg.h' .
N.B. Certain newer floppy disk controllers are buggy, and do not
correctly recognize the end of transfer when operating in virtual DMA
mode. For these, you need to set spt
to the id of the last
sector to be read (for example, if you intend to read sectors 2, 3, 4,
set spt
to 4, even if the disk has more sectors), and set the
no-mt
flag.
write drvsel cyl head sect szcod spt rw-gap szcod2
read
.
sense drvsel
recalibrate drvsel
seek drvsel cyl
specify drvsel spec1 spec2
format drvsel szcod sect-per-track fmt-gap fmt-fill
readid drvsel
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
dumpregs
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
configure conf1 conf2 conf3
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
version
perpendicular rate
seek-out drvsel n
seek-in drvsel n
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
lock
unlock
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
partid
powerdown powerconf
option iso
save
restore r1 r2 r3 ... r16
format_n_write drvsel szcod sect-per-track fmt-gap fmt-fill
drivespec dspec1 dspec2 ... specn terminator
drivespec
command. It is either
0xc0 or 0x80. If it is 0xc0, no result phase follows; if it is 0x80, the
current data rate table configuration for the four drives is echoed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you give a command name followed by explicit modes, both the implicit flags of the command name, and the explicit modes are or'ed together.
If on the other hand you give a command name preceded by explicit modes, only the explicit modes are or'ed together.
read
write
intr
spin
disk
no-motor
no-motor-after
fm
read
, readid
, write
and
format
commands.
no-mt
read
, readid
and
write
commands. This is needed on certain broken FDC's which
don't recognize end of transfer when running in nodma
mode. In
order to use these safely, set no-mt
, and chose the id of the
last sector to be read as sect-per-track
.
fdrawcmd
opens the device node with the NDELAY
flag. This
means that the driver should not try to autodetect the disk type (it
might not be formatted), and that it should not reset the FDC. If a
reset was needed, the command simply fails. If that happens, execute
floppycontrol --resetnow 0
, and try again.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The floppycontrol
program is used to configure the floppy driver.
10.5.1 General Options General purpose options 10.5.2 One time actions Perform various actions 10.5.3 Printing current settings Print out current configuration 10.5.4 Drive type configuration and autodetection Do you have a 3 1/2 double density drive or a 5 1/4 high density drive? 10.5.5 Configuration of the disk change line Disk change line configuration. 10.5.6 Timing Parameters Change the timings of various operations 10.5.7 Debugging messages Switching debugging messages on/off 10.5.8 Error Handling Options How should the floppy driver react when encountering disk errors 10.5.9 Write error reporting gather statistics about write errors 10.5.10 Other drive configuration options Other configuration options
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-h
--help
-d drive
--drive drive
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following floppycontrol
options don't set a configuration
parameter, but perform a one-time action. They are available to anybody
who has write access to the drive
-f
--flush
-x
--eject
--reset condition
0
1
2
This command may be needed after some failed raw commands (see section 10.4 fdrawcmd).
-F
--formatend
fdformat
in an unclean way. superformat
is not subject to
this.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-T
--type
MAKEFLOPPIES
script. The drive name is a letter (describing the
drive type) followed by the capacity of the format in bytes. The letter
is E for 3.5 ED drives, H for 3.5 HD drives, D for 3.5 DD drives, h for
5.25 HD drives and d for 5.25 DD drives. The drive type letter
corresponds to the oldest drive type supporting the format of this
device node (not necessarily the type of the drive refered by this
node.) For the generic format nodes (/dev/fd0 et al.) the name of
"native format" of the drive is printed, and for the default formats, if
a generic format has been redefined, its name becomes (null)
.
-p
--print
-P
--printstate
drive present
disk present
disk writable
spinup
select
first_read
probed_fmt
cylinder
maxblock
maxcylinder
generation
refs
device
last_checked
--pollstate
--Printstate
only prints out the cached information
without actually polling the drive for a disk change.)
--printfdcstate
spec1
spec2
rate
rawcmd
dor
version
reset
need_configure
FD_CONFIGURE
command.
has_fifo
FD_CONFIGURE
command.
perp_mode
address
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following options handle the different available drive types, such as double density vs. high density vs. extra density drives, and 5 1/4 drives vs 3 1/2 drives. Usually the drive type is stored in a non-volatile memory, called CMOS, under the form of an integer ranging from 1 to 6.
Different drive types are able to handle and autodetect different formats (different autodetection lists). They also have different "native format name". The native format is the "usual" format with the highest capacity supported by the drive. (For example 720KB on a double density 3 1/2 drive, and 1.2MB on a high density 5 1/4 drive.)
These settings are only changeable by the super user.
-c cmos-type
--cmos cmos-type
superformat
,
floppymeter
or MAKEFLOPPIES
). It is also possible to
supply a virtual CMOS type with the cmos
boot option
(see section 8. Configuring the floppy driver via lilo or insmod). If possible, I recommend you use the
boot option, rather than floppycontrol
, because the boot option
also sets any parameters derived from the CMOS type, such as the
autodetection list and the native format, whereas floppycontrol
does not.
-A autodetect-seq
--autodetect autodetect-seq
t
. For drive 0, the format number is the
minor device number divided by 4. The autodetection sequence is used by
the driver to find out the format of a newly inserted disk. The formats
are tried one after the other, and the first matching format is
retained. To test the format, the driver tries to read the first sector
on the first track on the first head when t
is not given, or the
whole first track when t
is given. Thus, autodetection cannot
detect the number of tracks. However, this information is contained in
the boot sector, which is now accessible. The boot sector can then be
used by mtools to configure the correct number of tracks.
Example:
7,4,24t,25 |
Reading the whole track at once allows you to distinguish between two formats which differ only in the number of sectors. (The format with the most sectors must be tried first.) If you use mtools(6), you do not need this feature, as mtools can figure out the number of sectors without any help from the floppy driver, by looking at the boot sector.
Reading the whole track at once may also speed up the first read by 200 milliseconds. However, if, on the other hand, you try to read a disk which has less sectors than the format, you lose some time.
I suggest that you put the most often used format in the first place (barring other constraints), as each format that is tried out takes 400 milliseconds.
-n native-format
--native_format native-format
MAKEFLOPPIES
script which uses it to decide which device nodes to
create.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
--broken_dcl
This option should be used if disk changes are either not detected at all, or if disk changes are detected when the disk was actually not changed. If this option fixes the problem, I'd recommend that you try to trace the root cause of the problem. Indeed, this options results in reduced performance due to spurious cache flushes.
The following hardware problems may lead to a bad disk change line:
broken_dcl
option on.
--working_dcl
--inverted_dcl
--no_inverted_dcl
--noisy_dcl_clear
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes how to configure drive timings. To set these parameters, you need superuser privileges. All times are in "jiffy" units (10 milliseconds), unless otherwise specified.
--hlt hlt
--hut hut
--srt srt
-u spinup-time
--spinup spinup-time
-o spindown-time
--spindown spindown-time
-O spindown-offset
--spindown_offset spindown-offset
This is done by clocking the time where the first I/O request completes, and using this time to calculate the current position of the disk.
-s select-delay
--select_delay select-delay
-C check-interval
--checkfreq check-interval
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This subsection describes how to switch the available debugging messages on and off.
--debug
--nodebug
--messages
--nomessages
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following options configure the behavior of the floppy driver in case of read/write errors. They may be used by any user who has write privileges for the drive. Whenever the floppy driver encounters an error, a retry counter is incremented. If the value of this counter gets bigger than the thresholds described below, the corresponding actions are performed at the next retry. The counter is reset when the read or write finally terminates, whether successfully or not.
-a operation-abort-trshld
--abort operation-abort-trshld
-t read-track-trshld
--readtrack read-track-trshld
-r recalibrate-trshld
--recalibrate recalibrate-trshld
-R reset-treshold
--reset reset-threshold
-e error-report-trshld
--reporting error-report-trshld
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Due to the buffer cache, write errors cannot always be reported to the writing user program as soon as the write system call returns. Indeed, the actual writing may take place much later. If a write error is encountered, the floppy driver stores information about it in its per drive write error structure. This write error structure stays until explicitly cleared. It can for example be queried by a backup program which wants to make sure that the data has been written successfully.
--clrwerror
--printwerror
write_errors
badness
first_error_sector
first_error_generation
last_error_sector
last_error_generation
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This subsection lists per drive configuration options, which don't fit in any other category. They are available only to the superuser:
--tracks max-tracks
If you trust your users and your disks, you don't need this. With most drives you don't need to worry anyways. See section 6.4 More Cylinders, for details.
-i sector-interleave
--interleave sector-interleave
FDFMTTRK
ioctl. The
fdformat
command, which is now considered obsolete, uses
FDFMTTRK
ioctl, but superformat
does not.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The floppymeter
program measures characteristic parameters of a
floppy drive and floppy controller, such as the rotation speed of the
drive, the data transfer rate of the controller, and the resulting raw
capacity of a disk track. To use this program, insert a disposable
floppy in the drive, and type floppymeter --
density, where
density describes the density of the disk used for the test. (Should be
one of dd, hd
or ed
). CAUTION: the data on the
disk will be erased. This program should be used to verify whether the
drive and controller are out of tolerance if you experience problems
with some high capacity formats. It only needs to be run once per
drive: although a disk is needed to perform the measurements, the
measured data only depend on the drive and the controller, and not on
the disk.
To measure the raw capacity of the disk track, the floppymeter program formats the first track of the drive in a special way that allows it to read the raw data (gaps and headers) of the disk. Thus, all data previously stored on that disk is lost.
The rotation speed is measured by timing the return time of a
readid
command. In order to gain more precision, the command is
issued many times in a row. During this phase, the number of rotations
til the start of the test, the average time per rotation til the start,
and a sliding average of the times of the last 30 rotations is printed,
and updated continously.
The data transfer rate is deduced from the two parameters above.
At the end of the program, all parameters (raw capacity, duration of one rotation, and data transfer rate) are printed again, as well as their relative deviation to the standard value. Finally, it suggests a capacity deviation description line, which can be directly pasted into the drive definition file (See section 5. Drive descriptions.).
Usually, the data transfer rate should not deviate more than 150 ppm from the expected value, and the rotation speed of the drive should not deviate more than 3000 ppm from the expected value. If these deviations are bigger, you may get problems with certain high capacity formats.
If the raw capacity of the drive is too small, some high capacity formats may become unformattable on this drive/controller combo.
If on the other hand, the raw capacity of the drive is too big, you may
get problems when writing to a disk formatted by this drive on another
drive with a smaller raw capacity. In order to avoid this, increase
superformats gap parameter (-G
).
-h
--dd
--hd
--ed
-f
-W Window
-c cycles
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This program is quite new, and may have bugs. Here are a few suggested tests to check its sanity:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
getfdprm
prints the current geometry information for drive .
This information can be set using
setfdprm
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
The MAKEFLOPPIES
shell script creates the new floppy block device
node. It uses the floppycontrol program to translate the minor device
numbers into meaningful names. It also uses these names to decide
whether to create a given block device file or not, depending on the
type of the physical drive (for instance, for a 3 1/2 drive, the formats
corresponding to a 5 1/4 drive are not created).
If you have more than two floppy drives, you need to tell the kernel
the CMOS types of those additional drives using the
floppy=
drive,
type,cmos
lilo option.
If the drives parameter is given, only the device nodes for the listed drives are made. By default, all only the two first drives are tried.
MAKEFLOPPIES
does not work if you redefine your default formats.
Caution:
MAKEFLOPPIES
removes already existing floppy device nodes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-t
-m
-l
-v
-n
-g
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
setfdprm
is a utility that can be used to load disk parameters
into the auto-detecting floppy devices and "fixed parameter" floppy
devices, to clear old parameter sets and to disable or enable diagnostic
messages. These parameters are derived from a media-description,
see section 4. Media description for more details.
Without any options, setfdprm
loads the device (for example
`/dev/fd0' or `/dev/fd1') with a new parameter set with the
name entry found in `/etc/fdprm' (usually named 360/360,
etc.). For autodetecting floppy devices, these parameters stay in
effect until the media is changed. For "fixed parameter" devices, they
stay in effect until they are changed again.
Setfdprm
can also be used by the superuser to redefine the
default formats.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-p device name
-c device
-y device
-n device
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
superformat
is used to format disks with a capacity of up to
1992K HD or 3984K ED. See section 6. Storing more data on a floppy disk, for a detailed
description of these formats. See section 4. Media description, for a detailed
description of the syntax for the media description. If no media
description is given, superformat formats a disk in the highest
available density for that drive, using standard parameters (i.e. no
extra capacity formats).
When the disk is formatted, superformat
automatically invokes
mformat
in order to put an MS-DOS filesystem on it. You may
ignore this filesystem, if you don't need it.
Supeformat allows to format 2m formats. Be aware, however, that these
2m
formats were specifically designed to hold an MS-DOS
filesystem, and that they take advantage of the fact that the MS-DOS
filesystem uses redundant sectors on the first track (the FAT, which is
represented twice). The second copy of the FAT is not represented
on the disk.
High capacity formats are sensitive to the exact rotation speed of the
drive and the resulting difference in raw capacity. That's why
superformat
performs a measurement of the disks raw capacity
before proceeding with the formatting. This measurement is rather time
consuming, and can be avoided by storing the relative deviation of the
drive capacity into the drive definition file file. See section 5. Drive descriptions, for more details on this file. The line to be inserted
into the drive definition file is printed by superformat after
performing its measurement. However, this line depends on the drive and
the controller. Do not copy it to other computers. Remove it before
installing another drive or upgrade your floppy controller. Swap the
drive numbers if you swap the drives in your computer.
10.10.1 Common Options The most frequently used options 10.10.2 Advanced Options For experts 10.10.3 Sector skewing options Optimizing throughput by creatively arranging the sectors 10.10.4 Examples Some example command lines 10.10.5 Troubleshooting Most common failure modes 10.10.6 Bugs Nobody is perfect
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-h
--help
-D drive
--dosdrive dos-drive
mformat
(for example a:
or
b:
). The colon may be omitted. The default is derived from the
minor device number. If the drive letter cannot be guessed, and is not
given on the command line, mformat
is skipped.
-v verbosity-level
--verbosity verbosity-level
--superverify
-B
--dosverify
mbadblocks
program.
mbadblocks
marks the bad sectors as bad in the FAT. The
advantage of this is that disks which are only partially bad can still
be used for MS-DOS filesystems.
-V
--verify_later
-f
--noverify
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-b begin-track
--begin_track begin-track
-e end-track
--end_track end-track
-S sizecode
--sizecode sizecode
--stretch stretch
-G fmt-gap
--format_gap fmt-gap
-F final-gap
--final_gap final-gap
-i interleave
--interleave interleave
-c chunksize
--chunksize chunksize
--biggest-last
--zero-based
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In order to maximize the user data transfer rate, the sectors are arranged in such a way that sector 1 of the new track/head comes under the head at the very moment when the drive is ready to read from that track, after having read the previous track. Thus the first sector of the second track is not necessarily near the first sector of the first track. The skew value describes for each track how far sector number 1 is away from the index mark. This skew value changes for each head and track. The amount of this change depends on how fast the disk spins, and on how much time is needed to change the head or the track.
--absolute_skew absolute-skew
Set the absolute skew. This skew value is used for the first formatted track. It is expressed in raw bytes.
--head_skew head-skew
Set the head skew. This is the skew added for passing from head 0 to head 1. It is expressed in raw bytes.
--track_skew track-skew
Set the track skew. This is the skew added for seeking to the next track. It is expressed in raw bytes.
Example: (absolute skew=3, head skew=1, track skew=2)
track 0 head 0: 4,5,6,1,2,3 (skew=3) track 0 head 1: 3,4,5,6,1,2 (skew=4) track 1 head 0: 1,2,3,4,5,6 (skew=0) track 1 head 1: 6,1,2,3,4,5 (skew=1) track 2 head 0: 4,5,6,1,2,3 (skew=3) track 2 head 1: 3,4,5,6,1,2 (skew=4) |
N.B. For simplicitie's sake, this example expresses skews in units of sectors. In reality, superformat expects the skews to be expressed in raw bytes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following example shows how to format a 1440K disk in drive 0:
superformat /dev/fd0 hd |
The following example shows how to format a 1200K disk in drive 1:
superformat /dev/fd1 hd |
The following example shows how to format a 1440K disk in drive 1:
superformat /dev/fd1 hd sect=18 |
The following example shows how to format a 720K disk in drive 0:
superformat /dev/fd0 dd |
The following example shows how to format a 1743K disk in drive 0 (83 cylinders times 21 sectors):
superformat /dev/fd0 sect=21 cyl=83 |
The following example shows how to format a 1992K disk in drive 0 (83 cylinders times 2 heads times 12 KB per track)
superformat /dev/fd0 tracksize=12KB cyl=83 mss |
The following example shows how to format a 1840K disk in drive 0. It will have 5 2048-byte sectors, one 1024-byte sector, and one 512-byte sector per track:
superformat /dev/fd0 tracksize=23b mss 2m ssize=2KB |
All these formats can be autodetected by mtools, using the floppy driver's default settings.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
FDC busy, sleeping for a second
superformat
has to wait until the other
access is finished. If this happens, check whether any other program
accesses a drive (or whether a drive is mounted), kill that program (or
unmount the drive), and the format should proceed normally.
I/O errors during verification
floppymeter
(see section 10.6 floppymeter)
to find out an appropriate value for this parameter, and add the
suggested margin
parameter to the command line
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
superformat
is running produces
overrun errors. These errors are benign, as the failed operation is
automatically retried until it succeeds.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
|
Xdfcopy
is a utility to copy and format XDF disks. XDF (eXtended
Density Format) is a format used by OS/2 which can hold 1840KB of data
(on a 3 1/2 high density disk). Its advantage over 2m formats is that it
is faster: 38KB/s. Because of this fast speed, I extended the XDF
standard to higher capacities (1992KB) with a transfer rate of 45KB/s. I
called the new formats XXDF.
This program works best with kernels newer than 2.0.0.
If both source and target are given, xdfcopy copies the disk image from
file to floppy disk or vice-versa. When copying to a floppy disk, the
disk is first formatted, unless the -n
option is given.
If no source is given, the target is only formatted. In this case, the target must be a floppy drive.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Formats are selected by the format_id. The following formats are understood:
0
1
2
3
4
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-D dosdrive
Example of a working mtoolsrc line:
A /dev/fd0 0 0 0 0 |
Examples of a non-working mtoolsrc line:
A /dev/fd0 12 80 2 18 |
-n
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-t cylinder skew
-t
parameter is ignored.
-h head skew
-d
-T end-cylinders
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Before it can be compiled, fdutils must be configured using the GNU
autoconf script ./configure
. In most circumstances, running
./configure
without any parameters is enough. However, you may
customize fdutils using various options to ./configure
. The
following options are supported:
--prefix directory
--sysconfdir directory
prefix
(see above). N.B. For backward compatibility reasons, the
old-style floppy parameter file `fdprm' is always in `/etc',
regardless of the setting for sysconfdir
--enable-fdmount-floppy-only
fdmount
program only to members of the group
floppy
In addition to the above-listed options, the other standard GNU autoconf
options apply. Type ./configure --help
to get a complete list of
these.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Double density disks have only a hole on one side (for write protection).
Double density uses a data transfer rate of 250 kb/s or 300 kb/s depending on the drive type: 5 1/4 high density drives use 300 kb/s when writing to a double density diskm 250 kb/s is used in all other circumstances. The reason why double density disks in high density drives need a higher data transfer rate is because these drives rotate faster (360 rpm instead of 300 rpm).
ED uses a data transfer rate of 250 kb/s.
http://www.moria.de/~michael/floppy/floppy.ps |
http://www.moria.de/~michael/floppy/floppy.ps |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This table lists a few interesting formats. Some of them are not
included in the table of predefined formats due to lack of space. You
may use these by setting the geometry of the variable geometry device
using setfdprm
. Most of the entries in the following table do
not describe a single format, but rather a family of formats which share
a common characteristic. For this reason, no precise parameters are
included.
PC: MS-DOS, 10 sectors, DS, 40 tracks; formatted by various utilities; readable by some versions of MS-DOS.
2m and Linux only: noninterleaved 1024-byte sector 18-sector-equivalent 360 rpm 500kb/s; 18-sector MS-DOS. A good substitute for 1.44MB 3.5" floppies.
2m and Linux only: 1 8KB sector, 1 4KB sector; 500kb/s, interleaved?
Linux is able to read almost any MFM disk. These include many CP/M disks and also Commodore 1581 disks. Please get Michael Haardt's documentation on floppy drives for a detailed description of those formats. This can be ftp'ed from the following location:
http://www.moria.de/~michael/floppy/ |
Commodore 1581 disks are not yet described in this documentation. Use
setfdprm /dev/fd0 DD DS sect=10 cyl=80 swapsides
. If you want to
use these disks often, redefine one of the "default" formats to be
Commodore 1581, and then put it into the autodetection list for the
drive. The following example describes how to redefine format number 31
(minor device number 124) to be Commodore 1581:
mknod /dev/fd0cbm1581 b 2 124 setfdprm /dev/fd0cbm1581 DD DS sect=10 cyl=80 swapsides floppycontrol --autodetect /dev/fd0 31,7,8,4,25,28,22,21 |
The two latter commands have to be issued after each reboot, so I suggest you put them into your `/etc/rc' files if you use many Commodore 1581 disks.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | D F G M S X |
---|
Jump to: | D F G M S X |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | 2
8
A B C D E F G H I K L M N O P R S T V X |
---|
Jump to: | 2
8
A B C D E F G H I K L M N O P R S T V X |
---|
[Top] | [Contents] | [Index] | [ ? ] |
In that case, the MAKEFLOPPIES
program
(10.8 makefloppies) no longer works to generate a correct name for
these formats, and you have to make them manually.
The actual location of this
file depends on the value of the sysconfdir
compile time
configuration variable (see section 11. Compile-time configuration via GNU autoconf for details)
drives do not always rotate at exactly 5 or 6 rotations per second, but some may be slightly faster or slightly slower than spec
The actual location of this
file depends on the value of the sysconfdir
compile time
configuration variable (see section 11. Compile-time configuration via GNU autoconf for details)
except of course if several formats only differ in the number of sectors per track, in which case the formats with the most sectors should come first
Version 3.0 or higher
[Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
General Introduction
1. Where to get fdutils and its documentation
2. Basic usage
3. Device numbers
4. Media description
5. Drive descriptions
6. Storing more data on a floppy disk
7. How autodetection works
8. Configuring the floppy driver via lilo or insmod
9. Floppy ioctls
10. Command list
11. Compile-time configuration via GNU autoconf
A. Acronyms
B. Interesting formats
Command Index
Concept index
[Top] | [Contents] | [Index] | [ ? ] |
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | previous or up-and-previous section | 1.1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next or up-and-next section | 1.3 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | concept index | |
[ ? ] | About | this page |