--- tapes.mm	2002/01/11 00:26:24	4.1
+++ tapes.mm	2003/06/24 05:25:49
@@ -1,148 +1,167 @@
 .\" This file is in -*- nroff-fill -*- mode
-.\" STATUS: draft 4th edition
-.\" $Id: tapes.mm,v 4.1 2002/01/11 00:26:24 grog Exp $
+.\" STATUS: 4th edition
+.\" $Id: tapes.mm,v 4.11 2003/05/18 02:08:10 grog Exp grog $
 .\"
 .Chapter \*[nchtapes] "Tapes, backups and floppy disks"
-In the last chapter, we looked at hard disks.  In this chapter, we'll consider
-how to guard against data loss, and how to transfer data from one location to
-another.  These are functions that UNIX traditionally performs with tapes, and
-we'll look at them in the next sections.  Because FreeBSD runs on PCs, however,
-you can't completely escape floppy disks, though it would be an excellent idea.
-We'll look at floppies on page \*[bloody-floppies].
+.P
+In Chapter
+.Sref \*[nchdisks] \&
+we looked at hard disks.  In this chapter, we'll consider how to guard against
+data loss, and how to transfer data from one location to another.  These are
+functions that UNIX traditionally performs with tapes, and we'll look at them in
+the next sections.  Because FreeBSD runs on PCs, however, you can't completely
+escape floppy disks, though it would be an excellent idea.  We'll look at
+floppies on page
+.Sref \*[bloody-floppies] .
 .H2 "Backing up your data"
-.X "Backing up your data"
+.X "backing up your data"
 No matter how reliable your system, you are never completely protected against
 loss of data.  The most common reasons are hardware failure and human error.
-By comparison, it's \fIvery\fP\| seldom that a software error causes data loss,
+By comparison, it's \fIvery\fP\/ seldom that a software error causes data loss,
 but this, too, can happen.
 .P
 .X "archive"
 .X "tarball"
-.X "tar, command"
-.X "command, tar"
 UNIX talks about \fIarchives\fP, which are copies of disk data in a form
 suitable for writing on a serial medium such as tape.  You can, however, write
 them to disk files as well, and that's what people do when they want to move a
 source tree from one system to another.  You'll also hear the term
-\fItarball\fP\| for an archive made by the \fItar\fP\| program, which we will
-discuss below.
+\fItarball\fP\/ for an archive made by the
+.Command tar
+program, which we discuss below.
 .H3 "What backup medium?"
 Traditionally, PCs use floppy disks as a removable storage medium.  We'll look
-at floppies below, but you can sum the section up in one statement:
-.Highlight
-.ce
-Don't use floppy disks.
-.End-highlight
+at floppies below, but you can sum the section up in one statement: don't use
+floppy disks.
+.P
 Floppy disks are particularly unsuited as a backup medium for modern computers.
-Consider a typical system with a 2 GB hard disk.  Storing 2 GB of data on
+Consider even a minimal system with a 2 GB hard disk.  Storing 2 GB of data on
 floppies requires about 1,500 floppies, which, at $0.30 each, would cost you
 $450.  Copying the data to a floppy takes about 50 seconds per floppy, so the
 raw backup time would be about 21 hours, plus the time it takes you to change
-the floppies, which could easily take another 3 or more hours.  During this time
-you have to sit by the computer playing disk jockey, a total of three days' work
-during which you could hardly do anything else.  When you try to read in the
-data again, there's a virtual certainty that one of the floppies will have a
-data error, especially if you read them with a different drive.
-.P
-By contrast, a QIC-525 tape cartridge will store 500 MB of data for about $20.
-The media for the same operation would cost $80, and it will take about 6 hours,
-during which you just need to change the tapes three times.  A single DDS or
-Exabyte cassette stores several gigabytes and costs about $6.  The backup time
-for 2 GB is about 90 minutes, and the operation can be performed completely
-unattended.
-.P
-There used to be a number of relatively cheap tape drives which can connect to
-your floppy controller.  Don't buy them.  FreeBSD used to have some kind of
-support for them, but it was rudimentary, and the drives themselves are
-unreliable and slow, and support for them died for lack of love: there's no
-point in making a backup if you can't read the data in again when you need it.
-.P
-You can also use writeable CD-ROMS (\fICD-R\fP\|s) for backup purposes.  By
-modern standards, the media are small (about 650 MB), and they're still
-relatively expensive, but they have the advantage of being readily accessible on
-other systems.  We'll look at CD-Rs in \*[cdburn].
+the floppies, which could easily take another three or more hours.  During this
+time you have to sit by the computer playing disk jockey, a total of three days'
+work during which you could hardly do anything else.  When you try to read in
+the data again, there's a virtual certainty that one of the floppies has a data
+error, especially if you read them with a different drive.
+.P
+By contrast, a single DDS or Exabyte cassette stores several gigabytes and costs
+about $6.  The backup time for 2 GB is about 90 minutes, and the operation can
+be performed completely unattended.
+.P
+A number of cheaper tape drives are also available, such as Travan tapes.
+FreeBSD supports them, but for one reason or another, they are not popular.
+FreeBSD once used to have support for ``floppy tape,'' run off a floppy
+controller, but these tapes were very unreliable, and they are no longer
+supported.
+.P
+You can also use writeable ``CD-ROMs'' (\fICD-R\fP\/s) for backup purposes.  By
+modern standards, the media are small (up to 700 MB), but they have the
+advantage of being readily accessible on other systems.  We looked at CD-Rs in
+Chapter
+.Sref "\*[ncdburn]" .
 .H3 "Tape devices"
-.X "tape device"
+.X "tape, device"
 .Pn tape-devices
-.X "/dev/nsa0"
-FreeBSD tape devices have names like \fI/dev/nsa0\fP\| (see page \*[rsa0]).
+FreeBSD tape devices have names like
+.Device nsa0
+(see page
+.Sref \*[sa0] ).
 Each letter has a significance:
 .Ls B
 .LI
-.X "tape, non-rewinding"
-.X "tape, rewind device"
-.X "/dev/sa0"
-\f(CWn\fP means \fInon-rewinding\fP.  When the process which accesses the tape
+.X "tape, device"
+\f(CWn\fP means \fInon-rewinding\fP.  When the process that accesses the tape
 closes it, the tape remains at the same position.  This is inconvenient if you
 want to remove the tape (before which you should rewind it), but it's the only
 way if you want to handle multiple archives on the tape.  The name of the
-corresponding \fIrewind device\fP\| has no \f(CWn\fP (for example, the rewind
-device corresponding to \fI/dev/nsa0\fP\| is \fI/dev/sa0\fP\|).  A rewind device
-rewinds the tape when it is closed.
+corresponding \fIrewind device\fP\/ has no \f(CWn\fP (for example, the rewind
+device corresponding to
+.Device nsa0
+is
+.Device sa0 \/).
+A rewind device rewinds the tape when it is closed.
 .Aside
-Older versions of FreeBSD used the names \fI/dev/nrsa0\fP\| and \fI/dev/rsa0\fP.
+Older releases of FreeBSD used the names
+.Device nrsa0
+and
+.Device rsa0 .
 \f(CWr\fP stands for \fIraw\fP, in other words a character device.  Since the
 removal of block devices, this letter is superfluous, but you might see it
 occasionally in older documents.
 .End-aside
 .LI
-.X "/dev/ast0"
-.X "/dev/wst0"
 \f(CWsa\fP stands for \fIserial access\fP, and is always SCSI.  You can also get
-ATAPI tape drives, which are called \fI/dev/ast0\fP and \fIdev/nast0\fP, and the
-older QIC-02 interface tapes are called \fI/dev/wst0\fP and \fIdev/nwst0\fP.
+ATAPI tape drives, which are called
+.Device ast0
+and
+.Device nast0 ,
+and the older QIC-02 interface tapes are called
+.Device wst0
+and
+.Device nwst0 .
 .LI
 \f(CW0\fP is the \fIunit number\fP.  If you have more than one tape, the next
-will be called \fI/dev/nsa1\fP, and so on.
+will be called
+.Device -n nsa1 ,
+and so on.
 .Le
 .H3 "Backup software"
 .X "backup software"
-FreeBSD does not require special ``backup software''.  The base operating system
+.Pn backups
+FreeBSD does not require special ``backup software.''  The base operating system
 supplies all the programs you need.  The tape driver is part of the kernel, and
 the system includes a number of backup programs.  The most popular are:
 .Ls B
 .LI
-.X "tar, command"
-.X "command, tar"
-.X "tape archiver"
-\fItar\fP\|, the \fItape archiver\fP, has been around longer than anybody can
-remember.  It is particularly useful for data exchange, since everybody has it.
-There are even versions of \fItar\fP\| for Microsoft platforms.  It's also an
-adequate backup program.
-.LI
-.X "cpio, command"
-.X "command, cpio"
-\fIcpio\fP\|
+.X "tape, archiver"
+.Command tar ,
+the \fItape archiver\fP, has been around longer than anybody can remember.  It
+is particularly useful for data exchange, since everybody has it.  There are
+even versions of
+.Command tar
+for Microsoft platforms.  It's also an adequate backup program.
+.LI
+.Command cpio
 is an alternative backup program.  About its only advantage over
-\fItar\fP\| is that it can read \fIcpio\fP\| format archives.
+.Command tar
+is that it can read
+.Command cpio
+format archives.
+.LI
+.Command pax
+is another alternative backup program.  It has the advantage that it can also
+read and write
+.Command tar
+and
+.Command cpio
+archives.
+.LI
+.Command dump
+is geared more towards backups than towards archiving.  It can maintain multiple
+levels of backup, each of which backs up only those files that have changed
+since the last backup of the next higher (numerically lower) level.  It is less
+suited towards data exchange because its formats are very specific to BSD.  Even
+older releases of FreeBSD cannot read dumps created under FreeBSD Release 5.
 .LI
-.X "pax, command"
-.X "command, pax"
-\fIpax\fP\| is another alternative backup program.  It has the advantage that it
-can also read and write \fItar\fP\| and \fIcpio\fP\| archives.
-.LI
-.X "dump, command"
-.X "command, dump"
-\fIdump\fP\| is geared more towards backups than towards archiving.  It can
-maintain multiple levels of backup, each of which backs up only those files
-which have changed since the last backup of the next higher (numerically lower)
-level.  It is less suited towards data exchange, since its formats are very
-specific to BSD.
-.LI
-.X "amanda, command"
-.X "command, amanda"
-\fIamanda\fP, in the Ports Collection, is another popular backup program.
+.Command amanda ,
+in the Ports Collection, is another popular backup program.
 .Le
 Backup strategies are frequently the subject of religious wars.  I personally
-find that \fItar\fP\| does everything I want, but you'll find plenty of people
-who will recommend \fIdump\fP\| or \fIamanda\fP\| instead.  In the following
-section, we'll look at the basics of using \fItar\fP.  See the man page
-\fIdump(8)\fP\| for more information on \fIdump\fP.
-.H3 "\fItar\fP\|"
-.X "tar, command"
-.X "command, tar"
-.X "tape archiver"
-\fItar\fP, the \fItape archiver\fP, performs the following functions:
+find that
+.Command tar
+does everything I want, but you'll find plenty of people who recommend
+.Command dump
+or
+.Command amanda
+instead.  In the following section, we'll look at the basics of using
+.Command tar .
+See the man page \fIdump(8)\fP\/ for more information on
+.Command dump .
+.H3 "tar"
+.X "tape, archiver"
+.Command tar ,
+the \fItape archiver\fP, performs the following functions:
 .Ls B
 .LI
 .X "archive"
@@ -153,20 +172,26 @@
 .LI
 Listing the contents of an archive.
 .Le
-.X "gzip, command"
-.X "command, gzip"
-\fItar\fP\| does not compress the data.  The resulting archive is slightly
-larger than the sum of the files which it contains, since it also contains a
-certain amount of header information.  You can, however, use the \fIgzip\fP\|
-program to compress a \fItar\fP\| archive, and \fItar\fP\| will invoke it for
-you automatically.  The resultant archives are typically 80% smaller than the
-constituent files.
-.H4 "Creating a \fItar\fP\| archive"
-.X "creating a \fItar\fP\| archive"
+.Command tar
+does not compress the data.  The resulting archive is slightly larger than the
+sum of the files that it contains, since it also contains a certain amount of
+header information.  You can, however, use the
+.Command gzip
+program to compress a
+.Command tar
+archive, and
+.Command tar
+invokes it for you automatically with the \f(CW-z\fP option.  The size of the
+resultant archives depends strongly on the data you put in them.  JPEG images,
+for example, hardly compress at all, while text compresses quite well and can be
+as much as 90% smaller than the constituent files.
+.H4 "Creating a tar archive"
+.X "creating a tar archive"
 .X "tar, creating an archive"
 Create an archive with the \f(CWc\fP option.  Unlike most UNIX programs,
-\fItar\fP\| does not require a hyphen (\f(CW-\fP) in front of the options.  For
-example, to save your complete kernel source tree, you could write:
+.Command tar
+does not require a hyphen (\f(CW-\fP) in front of the options.  For example, to
+save your complete kernel source tree, you could write:
 .Dx
 # \f(CBtar cvf source-archive.tar /usr/src/sys\fP
 tar: Removing leading / from absolute path names in the archive.
@@ -177,42 +202,58 @@
 usr/src/sys/CVS/Entries
 usr/src/sys/compile/
 usr/src/sys/compile/CVS/
-\fI\&(etc)\fP\|
+\fI\&(etc)\fP\/
 .De
 The parameters have the following meaning:
 .Ls B
 .LI
-\f(CWcvf\fP are the options.  \f(CWc\fP stands for \fIcreate\fP\| an archive,
-\f(CWv\fP specifies \fIverbose\fP\| operation (in this case, this causes
-\fItar\fP\| to produce the list of files being archived), and \f(CWf\fP
+\f(CWcvf\fP are the options.  \f(CWc\fP stands for \fIcreate\fP\/ an archive,
+\f(CWv\fP specifies \fIverbose\fP\/ operation (in this case, this causes
+\fItar\fP\/ to produce the list of files being archived), and \f(CWf\fP
 specifies that the next parameter is the name of the archive file.
 .LI
 \f(CWsource-archive.tar\fP is the name of the archive.  In this case, it's a
 disk file.
 .LI
-\f(CW/usr/src/sys\fP is the name of the directory to archive.  \fItar\fP\|
+\f(CW/usr/src/sys\fP is the name of the directory to archive.
+.Command tar
 archives all files in the directory, including most devices.  For historical
-reasons, \fItar\fP\| can't back up devices with minor numbers greater than
-65536, and changing the format would make it incompatible with other systems.
+reasons,
+.Command tar
+can't back up devices with minor numbers greater than 65536, and changing the
+format would make it incompatible with other systems.
 .Le
 The message on the first line (\f(CWRemoving leading / ...\fP) indicates that,
-although the directory name was specified as \f(CW/usr/src/sys\fP, \fItar\fP\|
-treats it as \fIusr/src/sys\fP.  This makes it possible to restore the files
-into another directory at a later time.
+although the directory name was specified as \f(CW/usr/src/sys\fP,
+.Command tar
+treats it as
+.Directory -n usr/src/sys .
+This makes it possible to restore the files into another directory at a later
+time.
 .P
 You can back up to tape in exactly the same way:
 .Dx
 # \f(CBtar cvf /dev/nsa0 /usr/src/sys\fP
 .De
-There is a simpler way, however: if you don't specify a file name, \fItar\fP\|
+There is a simpler way, however: if you don't specify a file name,
+.Command tar
 looks for the environment variable \f(CWTAPE\fP.  If it finds it, it interprets
 it as the name of the tape drive.  You can make things a lot easier by setting
-the following line in the configuration file for your shell (\fI.profile\fP\|
-for \fIsh\fP,  \fI.bashrc\fP\| for \fIbash\fP, \fI.login\fP\| for \fIcsh\fP\|
-and \fItcsh\fP\|):
+the following line in the configuration file for your shell (
+.File .profile
+for
+.Command sh ,
+.File .bashrc
+for
+.Command bash ,
+.File .login
+for
+.Command csh
+and
+.Command tcsh ):
 .Dx
-TAPE=/dev/nsa0 export TAPE			\fIfor sh and bash\fP\|
-setenv TAPE /dev/nsa0				\fIfor csh and tcsh\fP\|
+TAPE=/dev/nsa0 export TAPE                      \fIfor sh and bash\fP\/
+setenv TAPE /dev/nsa0                           \fIfor csh and tcsh\fP\/
 .De
 After this, the previous example simplifies to:
 .Dx
@@ -220,11 +261,11 @@
 .De
 .sp -1v
 .H4 "Listing an archive"
-.X "listing a \fItar\fP\| archive"
+.X "listing a \fItar\fP\/ archive"
 .X "tar, listing an archive"
 To list an archive, use the option \f(CWt\fP:
 .Dx
-# \f(CBtar t\fP							\fIfrom tape\fP\|
+# \f(CBtar t\fP                                         \fIfrom tape\fP\/
 usr/src/sys/
 usr/src/sys/CVS/
 usr/src/sys/CVS/Root
@@ -233,8 +274,8 @@
 usr/src/sys/compile/
 usr/src/sys/compile/CVS/
 usr/src/sys/compile/CVS/Root
-\fI\&(etc)\fP\|
-# \f(CBtar tvf source-archive.tar\fP			\fIfrom disk\fP\|
+\fI\&(etc)\fP\/
+# \f(CBtar tvf source-archive.tar\fP                    \fIfrom disk\fP\/
 drwxrwxrwx root/bin          0 Oct 25 15:07 1997 usr/src/sys/
 drwxrwxrwx root/bin          0 Oct 25 15:08 1997 usr/src/sys/CVS/
 -rw-rw-rw- root/wheel        9 Sep 30 23:13 1996 usr/src/sys/CVS/Root
@@ -242,39 +283,44 @@
 -rw-rw-rw- root/bin        346 Oct 25 15:08 1997 usr/src/sys/CVS/Entries
 drwxrwxrwx root/bin          0 Oct 27 17:11 1997 usr/src/sys/compile/
 drwxrwxrwx root/bin          0 Jul 30 10:52 1997 usr/src/sys/compile/CVS/
-\fI\&(etc)\fP\|
+\fI\&(etc)\fP\/
 .De
-This example shows the use of the \f(CWv\fP (\fIverbose\fP\|) option with
-\f(CWt\fP.  If you don't use it, \fItar\fP\| displays only the names of the
-files (first example, from tape).  If you do use it, \fItar\fP\| also displays
-the permissions, ownerships, sizes and last modification date in a form
-reminiscent of \fIls -l\fP\| (second example, which is from the disk file
-\fIsource-archive.tar\fP\|).
+This example shows the use of the \f(CWv\fP (\fIverbose\fP\/) option with
+\f(CWt\fP.  If you don't use it,
+.Command tar
+displays only the names of the files (first example, from tape).  If you do use
+it,
+.Command tar
+also displays the permissions, ownerships, sizes and last modification date in a
+form reminiscent of \fIls -l\fP\/ (second example, which is from the disk file
+.File -n source-archive.tar ).
 .H4 "Extracting files"
 .X "tar, extracting files"
 To extract a file from the archive, use the \f(CWx\fP option:
 .Dx
-# \f(CBtar xv usr/src/sys/Makefile\fP			\fIfrom tape\fP\|
-usr/src/sys/Makefile					\fIconfirms that the file was extracted\fP\|
+# \f(CBtar xv usr/src/sys/Makefile\fP                   \fIfrom tape\fP\/
+usr/src/sys/Makefile                            \fIconfirms that the file was extracted\fP\/
 .De
-As with the \f(CWc\fP option, if you don't use the \f(CWv\fP option, \fItar\fP\|
-will not list any file names.  If you omit the names of the files to extract,
-\fItar\fP\| will extract the complete archive.
+As with the \f(CWc\fP option, if you don't use the \f(CWv\fP option,
+.Command tar
+does not list any file names.  If you omit the names of the files to extract,
+.Command tar
+extracts the complete archive.
 .H4 "Compressed archives"
 .X "tar, compressed archives"
-.X "gzip, command"
-.X "command, gzip"
-.X "tar, command"
-.X "command, tar"
-You can use the \fIgzip\fP\| program in combination with \fItar\fP\| by
-specifying the \f(CWz\fP option.  For example, to create the archive
-\fIsource-archive.tar.gz\fP\| in compressed format, write:
+You can combine
+.Command gzip
+with
+.Command tar
+by specifying the \f(CWz\fP option.  For example, to create the archive
+.File -n source-archive.tar.gz
+in compressed format, write:
 .Dx
 # \f(CBtar czf source-archive.tar.gz /usr/src/sys\fP
 .De
-You \fImust\fP\| specify the \f(CWz\fP option when listing or extracting
+You \fImust\fP\/ specify the \f(CWz\fP option when listing or extracting
 compressed archives, and you must not do so when listing or extracting
-non-compressed archives.  Otherwise you will get messages like:
+non-compressed archives.  Otherwise you get messages like:
 .Dx
 # \f(CBtar tzvf source-archive.tar \fP
 gzip: stdin: not in gzip format
@@ -284,13 +330,13 @@
 .De
 .sp -1v
 .H2 "Using floppy disks under FreeBSD"
-.X "floppy disks"
+.X "floppy disk"
 .Pn bloody-floppies
 I don't like floppy disks.  UNIX doesn't like floppy disks.  Probably you don't
 like floppy disks either, but we occasionally have to live with them.
 .P
 FreeBSD uses floppy disks for one thing only: for initially booting the system
-on systems which can't boot from CD-ROM.  We've already seen that they're
+on systems that can't boot from CD-ROM.  We've already seen that they're
 unsuitable for archival data storage and data transfer.  For this purpose,
 FreeBSD uses tapes and CD-ROMs, which are much more reliable, and for the data
 volumes involved in modern computers, they're cheaper and faster.
@@ -317,88 +363,94 @@
 .Sref \*[make-floppy-fs] .
 .LI
 When exchanging with Microsoft users, you need to create a Microsoft file system.  We'll
-look at that on page \*[DOS-fs].
+look at that on page
+.Sref \*[DOS-fs] .
 .LI
-When exchanging with other UNIX users, whether FreeBSD or not, use \fItar\fP or
-\fIcpio\fP.  We'll look at how to do that on page \*[frisbee].
+When exchanging with other UNIX users, whether FreeBSD or not, use
+.Command tar
+or
+.Command cpio .
+We'll look at how to do that on page
+.Sref \*[frisbee] .
 .LE
 .H3 "Formatting a floppy"
-.X "formatting floppy disks"
-.X "floppy disks, formatting"
+.X "formatting, floppy disk"
+.X "floppy disk, formatting"
 .Pn fdformat
-.X "FORMAT, MS-DOS command"
-.X "MS-DOS command, FORMAT"
+.X "FORMAT, MS-DOS program"
+.X "MS-DOS program, FORMAT"
 .X "low-level format"
 .X "format, low-level"
 .X "high-level format"
 .X "format, high-level"
-.X "fdformat command"
-.X "command, fdformat"
 Even if you buy preformatted floppies, it's a good idea to reformat them.  Track
 alignment can vary significantly between individual floppy drives, and the
 result can be that your drive doesn't write quite on top of the pre-written
 tracks.  I have seen read failure rates as high as 2% on pre-formatted floppies:
 in other words, after writing 100 floppies with valuable data, the chances are
-that two of them will have read errors.  You can reduce this problem by
-reformatting the floppy in the drive in which it is to be written, but you can't
-eliminate it.
+that two of them have read errors.  You can reduce this problem by reformatting
+the floppy in the drive in which it is to be written, but you can't eliminate
+it.
 .P
-.X "FORMAT, MS-DOS command"
-.X "MS-DOS command, FORMAT"
+.X "FORMAT, MS-DOS program"
+.X "MS-DOS program, FORMAT"
 .X "low-level format"
 .X "high-level format"
 .X "format, low-level"
 .X "format, high-level"
-.X "fdformat, command"
-.X "command, fdformat"
-On Microsoft platforms, you format floppies with the \fIFORMAT\fP\| program,
-which performs two different functions when invoked on floppies: it performs
-both a \fIlow-level\fP\| format, which re-writes the physical sector
-information, and then it performs a \fIhigh-level\fP\| format, which writes the
-information necessary for Microsoft platforms to use it as a file system.  UNIX
-calls the second operation creating a file system.  It's not always necessary to
-have a file system on the diskette\(emin fact, as we'll see, it can be a
-disadvantage.  In addition, FreeBSD offers different kinds of file system, so it
-performs the two functions with different programs.  In this section, we'll look
-at \fIfdformat\fP, which performs the low-level format.  We'll look at how to
-create a \fIufs\fP\| or Microsoft file system in the next section.
-.P
-.X "/dev/fd0"
-To format the first floppy drive, \fI/dev/fd0\fP, you would enter:
+On Microsoft platforms, you format floppies with the
+.Command -n FORMAT
+program, which performs two different functions when invoked on floppies: it
+performs both a \fIlow-level\fP\/ format, which rewrites the physical sector
+information, and then it performs what it calls a \fIhigh-level\fP\/ format,
+which writes the information necessary for Microsoft platforms to use it as a
+file system.  UNIX calls the second operation creating a file system.  It's not
+always necessary to have a file system on the diskette\(emin fact, as we'll see,
+it can be a disadvantage.  In addition, FreeBSD offers different kinds of file
+system, so it performs the two functions with different programs.  In this
+section, we'll look at
+.Command fdformat ,
+which performs the low-level format.  We'll look at how to create a \fIUFS\fP\/
+or Microsoft file system in the next section.
+.P
+To format a diskette in the first floppy drive,
+.Device fd0 ,
+you would enter:
 .Dx
 $ \f(CBfdformat /dev/fd0\fP
 Format 1440K floppy `/dev/fd0'? (y/n): \f(CBy\fP
 Processing ----------------------------------------
 .De
-Each of the hyphen characters (\f(CW-\fP) represent two tracks.  As the format
-proceeds, they change individually to an \f(CBF\fP (Format) and then to
+Each hyphen character (\f(CW-\fP) represents two tracks.  As the format
+proceeds, the hyphens change individually to an \f(CBF\fP (Format) and then to
 \f(CBV\fP (Verify) in turn, so at the end the line reads
 .Dx
 Processing VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV done.
 .De
 .sp -1v
 .H3 "File systems on floppy"
-.X "File systems on floppy"
+.X "file system, floppy"
 .Pn make-floppy-fs
-.X "ufs"
-.X "/etc/disktab"
+.X "UFS"
 It's possible to use floppies as file systems under FreeBSD.  You can create a
-\fIufs\fP\| file system on a floppy just like on a hard disk.  This is not
-necessarily a good idea: the \fIufs\fP\| file system is designed for
+\fIUFS\fP\/ file system on a floppy just like on a hard disk.  This is not
+necessarily a good idea: the \fIUFS\fP\/ file system is designed for
 performance, not maximum capacity.  By default, it doesn't use the last 8% of
-disk space, and it includes a lot of structure information which further reduces
+disk space, and it includes a lot of structure information that further reduces
 the space available on the disk.  Here's an example of creating a file system,
-mounting it on the directory \fI/A\fP, and listing the remaining space available
-on an empty 3\(12\f(CW"\fP floppy.  We use the \fIdisktab\fP\| approach to
-labelling the disk, as we saw on page
+mounting it on the directory
+.Directory /A ,
+and listing the remaining space available
+on an empty 3\(12\f(CW"\fP floppy.  We use the
+.Command disktab
+approach to labelling the disk, as we saw on page
 .Sref \*[disktab] .
-.X "/etc/disktab"
-\fI/etc/disktab\fP\| does have labels for floppy disks: use \f(CWfd1440\fP for a
-3\(12\f(CW"\fP 1.44 MB floppy, and \f(CWfd1200\fP for a 5\(14\f(CW"\fP 1.2 MB
-floppy:
+.File /etc/disktab
+does have labels for floppy disks: use \f(CWfd1440\fP for a 3\(12\f(CW"\fP 1.44
+MB floppy, and \f(CWfd1200\fP for a 5\(14\f(CW"\fP 1.2 MB floppy:
 .Dx
-# \f(CBdisklabel -w -r /dev/fd0 fd1440\fP	\fIlabel the floppy\fP\|
-# \f(CBdisklabel -r /dev/fd0\fP			\fIand list the information\fP\|
+# \f(CBbsdlabel -w /dev/fd0 fd1440\fP                   \fIlabel the floppy\fP\/
+# \f(CBbsdlabel /dev/fd0\fP                             \fIand list the information\fP\/
 # /dev/fd0:
 type: unknown
 disk: fd1440
@@ -423,87 +475,100 @@
   a:     2880        0    unused      512  4096         # (Cyl.    0 - 79)
   b:     2880        0    unused      512  4096         # (Cyl.    0 - 79)
   c:     2880        0    unused      512  4096         # (Cyl.    0 - 79)
-# \f(CBnewfs /dev/fd0\fP				\fIcreate a new file system\fP\|
+# \f(CBnewfs /dev/fd0\fP                                \fIcreate a new file system\fP\/
 Warning: Block size restricts cylinders per group to 6.
 Warning: 1216 sector(s) in last cylinder unallocated
 /dev/fd0.1440: 2880 sectors in 1 cylinders of 1 tracks, 4096 sectors
         1.4MB in 1 cyl groups (6 c/g, 12.00MB/g, 736 i/g)
 super-block backups (for fsck -b #) at:
  32,
-# \f(CBmount /dev/fd0 /A\fP				\fImount the floppy on /A\fP\|
-# \f(CBdf /A\fP						\fIdisplay the space available\fP\|
+# \f(CBmount /dev/fd0 /A\fP                             \fImount the floppy on /A\fP\/
+# \f(CBdf /A\fP                                         \fIdisplay the space available\fP\/
 Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
 /dev/fd0           1319        0     1213     0%    /mnt
 .De
 Let's look at this in a little more detail:
 .Ls B
 .LI
-.X "disklabel command"
-.X "command, disklabel"
-.X "newfs command"
-.X "command, newfs"
-.X "ufs"
-The first invocation of \fIdisklabel\fP, with the \f(CW-w\fP option, writes a
-disk label to the floppy, which supplies enough information for \fInewfs\fP\| to
-create a \fIufs\fP\| file system on it.
-.LI
-The second invocation of \fIdisklabel\fP, just with the \f(CW-r\fP option, lists
-the information written by the first invocation.  This isn't necessary for
-creating the file system, but it helps to check that the disk is labelled
-correctly.
-.LI
-\fInewfs\fP\| creates the \fIufs\fP\| file system on the floppy.
-.LI
-.X "mount command"
-.X "command, mount"
-We have already seen \fImount\fP\| on page \*[mount].  In this case, we use it
-to mount the floppy on the file system \fI/A\fP.
-.LI
-.X "df command"
-.X "command, df"
-The \fIdf\fP\| program shows the maximum and available space on a file system.
-By default, \fIdf\fP\| displays usage in blocks of 512 bytes, an inconvenient
-size.  In this example, the environment variable \f(CWBLOCKSIZE\fP was set to
-1024 to display the usage in 1 kB (1024 byte) blocks.  See page
-\*[environment-variables] for more details of environment variables.
+.X "UFS"
+The first invocation of
+.Command bsdlabel ,
+with the \f(CW-w\fP option, writes a disk label to the floppy, which supplies
+enough information for
+.Command newfs
+to create a \fIUFS\fP\/ file system on it.
+.LI
+The second invocation of
+.Command bsdlabel ,
+without options, lists the information written by the first invocation.  This
+isn't necessary for creating the file system, but it helps to check that the
+disk is labelled correctly.
+.LI
+.Command newfs
+creates the \fIUFS\fP\/ file system on the floppy.
+.LI
+We have already seen
+.Command mount
+on page
+.Sref \*[mount] .
+In this case, we use it to mount the floppy on the file system
+.Directory /A .
+.LI
+The
+.Command df
+program shows the maximum and available space on a file system.
+By default,
+.Command df
+displays usage in blocks of 512 bytes, an inconvenient size.  In this example,
+the environment variable \f(CWBLOCKSIZE\fP was set to 1024 to display the usage
+in 1 kB (1024 byte) blocks.  See page
+.Sref \*[environment-variables] \&
+for more details of environment variables.
 .Le
-.X "tunefs command"
-.X "command, tunefs"
-The output of \fIdf\fP\| looks terrible!  Our floppy only has 1213 kB left for
-normal user data, even though there is nothing on it and even \fIdf\fP\| claims
-that it can really store 1319 kB.  This is because \fIufs\fP\| keeps a default
-of 8% of the space free for performance reasons.  You can change this, however,
-with \fItunefs\fP, the file system tune program:\*F
+The output of
+.Command df
+looks terrible!  Our floppy only has 1213 kB left for normal user data, even
+though there is nothing on it and even
+.Command df
+claims that it can really store 1319 kB.  This is because \fIUFS\fP\/ keeps a
+default of 8% of the space free for performance reasons.  You can change this,
+however, with
+.Command tunefs ,
+the file system tune program:\*F
+.X "tuna fish"
 .FS
 To quote the man page: \fIYou can tune a file system, but you can't tune a
 fish\fP.
 .FE
 .Dx
-# \f(CBumount /A\fP					\fIfirst unmount the floppy\fP\|
-# \f(CBtunefs -m 0 /dev/fd0\fP			\fIand change the minimum free to 0\fP\|
+# \f(CBumount /A\fP                                     \fIfirst unmount the floppy\fP\/
+# \f(CBtunefs -m 0 /dev/fd0\fP                          \fIand change the minimum free to 0\fP\/
 tunefs: minimum percentage of free space changes from 8% to 0%
 tunefs: should optimize for space with minfree < 8%
-# \f(CBmount /dev/fd0 /A\fP				\fImount the file system again\fP\|
-# \f(CBdf /A\fP						\fIand take another look\fP\|
+# \f(CBmount /dev/fd0 /A\fP                             \fImount the file system again\fP\/
+# \f(CBdf /A\fP                                         \fIand take another look\fP\/
 Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
 /dev/fd0           1319        0     1319     0%    /A
 .De
 Still, this is a far cry from the claimed data storage of a Microsoft disk.  In
-fact, Microsoft disks can't store the full 1.4 MB either, since it also needs
-space for storing directories and allocation tables.  The moral of the story:
-only use file systems on floppy if you don't have any alternative.
+fact, Microsoft disks can't store the full 1.4 MB either: they also need space
+for storing directories and allocation tables.  The moral of the story: only use
+file systems on floppy if you don't have any alternative.
 .H3 "Microsoft file systems"
 .X "Microsoft file systems"
 .Pn DOS-fs
-To create an MS-DOS file system, use the \fInewfs_msdos\fP\| command:
+To create an MS-DOS file system, use the
+.Command newfs_msdos
+command:
 .Dx
 $ \f(CBnewfs_msdos -f 1440 /dev/fd0\fP
 .De
-The specification \f(CW-f 1440\fP tells \fInewfs_msdos\fP\| that this is a 1.4
-MB floppy.
-.X "mformat command"
-.X "command, mformat"
-Alternatively, you can use the \fImformat\fP\| command:
+The specification \f(CW-f 1440\fP tells
+.Command newfs_msdos
+that this is a 1.4 MB floppy.
+Alternatively, you can use the
+.Command mformat
+command:
 .Dx
 $ \f(CBmformat A: \fP
 .De
@@ -514,14 +579,13 @@
 .Dx
 $ mformat -t 80 -s 18 A:
 .De
-.X "mtools"
-\fImformat\fP\| is one of the \fImtools \fP\ that we will look at in the next
-section.
+.Command mformat
+is one of the
+.Command mtools
+that we look at in the next section.
 .H3 "Other uses of floppies"
 .X "frisbee"
 .Pn frisbee
-.X "tar, command"
-.X "command, tar"
 Well, you could take the disks out of the cover and use them as a kind of
 frisbee.  But there is one other useful thing you can do with floppies: as an
 archive medium, they don't need a file system on them.  They just need to be
@@ -536,70 +600,82 @@
 \&.twmrc
 \&.rnsoft
 \&.rnlast
-\&.rhosts~
-\&.rhosts
-\fI\&...etc\fP\|
+\fI\&...etc\fP\/
 Prepare volume #2 for /dev/fd0 and hit return:
 .De
-Since we are writing to the floppy as a character device, the name is
-\fI/dev/\f(BIr\fIfd0\fR\(emas with tapes, the \f(CWr\fP stands for the
-\fIraw\fP\| device.  Note also the solitary dot (\f(CW.\fP) at the end of the
-command line.  That's the name of the current directory, and that's what you're
-backing up.  Note also the option \f(CWM\fP, which is short for
-\f(CW--multi-volume\fP.  There's a very good chance that you'll run out of space
-on a floppy, and this option says that you have a sufficient supply of floppies
-to perform the complete backup.
-.P
-.X "tar, command"
-.X "command, tar"
-To extract the data again, use \fItar\fP\| with the \f(CWx\fP option:
+Note also the solitary dot (\f(CW.\fP) at the end of the command line.  That's
+the name of the current directory, and that's what you're backing up.  Note also
+the option \f(CWM\fP, which is short for \f(CW--multi-volume\fP.  There's a very
+good chance that you'll run out of space on a floppy, and this option says that
+you have a sufficient supply of floppies to perform the complete backup.
+.P
+To extract the data again, use
+.Command tar
+with the \f(CWx\fP option:
 .Dx
 $ \f(CBtar xvfM /dev/fd0\fP
 \&./
 \&.xfmrc
 \&.x6530modkey
 \&.uwmrc
-\fI\&...etc\fP\|
+\fI\&...etc\fP\/
 .De
-See the man page \fItar(1)\fP\| for other things you can do with \fItar\fP.
+See the man page \fItar(1)\fP\/ for other things you can do with
+.Command tar .
 .H3 "Accessing Microsoft floppies"
 .Pn mtools
-.X "mtools"
-.X "ATTRIB, MS-DOS command"
-.X "MS-DOS command, ATTRIB"
-.X "CD, MS-DOS command"
-.X "MS-DOS command, CD"
-.X "COPY, MS-DOS command"
-.X "MS-DOS command, COPY"
-.X "DEL, MS-DOS command"
-.X "MS-DOS command, DEL"
-.X "DIR, MS-DOS command"
-.X "MS-DOS command, DIR"
-.X "FORMAT, MS-DOS command"
-.X "MS-DOS command, FORMAT"
-.X "LABEL, MS-DOS command"
-.X "MS-DOS command, LABEL"
-.X "MD, MS-DOS command"
-.X "MS-DOS command, MD"
-.X "RD, MS-DOS command"
-.X "MS-DOS command, RD"
-.X "READ, MS-DOS command"
-.X "MS-DOS command, READ"
-.X "REN, MS-DOS command"
-.X "MS-DOS command, REN"
-Of course, most of the time you get data on a floppy, it's not in \fItar\fP\|
+.X "ATTRIB, MS-DOS program"
+.X "MS-DOS program, ATTRIB"
+.X "CD, MS-DOS program"
+.X "MS-DOS program, CD"
+.X "COPY, MS-DOS program"
+.X "MS-DOS program, COPY"
+.X "DEL, MS-DOS program"
+.X "MS-DOS program, DEL"
+.X "DIR, MS-DOS program"
+.X "MS-DOS program, DIR"
+.X "FORMAT, MS-DOS program"
+.X "MS-DOS program, FORMAT"
+.X "LABEL, MS-DOS program"
+.X "MS-DOS program, LABEL"
+.X "MD, MS-DOS program"
+.X "MS-DOS program, MD"
+.X "RD, MS-DOS program"
+.X "MS-DOS program, RD"
+.X "READ, MS-DOS program"
+.X "MS-DOS program, READ"
+.X "REN, MS-DOS program"
+.X "MS-DOS program, REN"
+Of course, most of the time you get data on a floppy, it's not in
+.Command tar
 format: it has a Microsoft file system on it.  We've already seen the Microsoft
-file system type on page \*[msdosfs], but that's a bit of overkill if you just
-want to copy files from floppy.  In this case, use the \fImtools\fP\| package.
-\fImtools\fP\| is an implementation of the MS-DOS commands \fIATTRIB\fP,
-\fICD\fP, \fICOPY\fP, \fIDEL\fP, \fIDIR\fP, \fIFORMAT\fP, \fILABEL\fP, \fIMD\fP,
-\fIRD\fP, \fIREAD\fP, \fIREN\fP, and \fITYPE\fP under UNIX.  To avoid confusion
-with existing utilities, the UNIX versions of these commands start with the
-letter \f(CWm\fP.  They are also written in lower case.  For example, to list
-the contents of a floppy and copy one of the files to the current (FreeBSD)
-directory, you might enter:
+file system type on page
+.Sref \*[msdosfs] ,
+but that's a bit of overkill if you just want to copy files from floppy.  In
+this case, use the
+.Command mtools
+package from the Ports Collection.
+.Command mtools
+is an implementation of the MS-DOS programs
+.Command -n ATTRIB ,
+.Command -n CD ,
+.Command -n COPY ,
+.Command -n DEL ,
+.Command -n DIR ,
+.Command -n FORMAT ,
+.Command -n LABEL ,
+.Command -n MD ,
+.Command -n RD ,
+.Command -n READ ,
+.Command -n REN ,
+and
+.Command -n TYPE
+under UNIX.  To avoid confusion with existing utilities, the UNIX versions of
+these commands start with the letter \f(CWm\fP.  They are also written in lower
+case.  For example, to list the contents of a floppy and copy one of the files
+to the current (FreeBSD) directory, you might enter:
 .Dx
-$ \f(CBmdir\fP						\fIlist the current directory on A:\fP\|
+$ \f(CBmdir\fP                                          \fIlist the current directory on A:\fP\/
  Volume in drive A is MESSED OS
  Directory for A:/
 
@@ -612,8 +688,8 @@
 AUTOEXEC BAT         191   12-24-92  11:10a
 MOUSE            <DIR>     12-24-92  11:09a
       12 File(s)      82944 bytes free
-$ \f(CBmcd nfs\fP						\fIChange to directory A:\eNFS\fP\|
-$ \f(CBmdir\fP						\fIand list the directory\fP\|
+$ \f(CBmcd nfs\fP                                       \fIchange to directory A:\eNFS\fP\/
+$ \f(CBmdir\fP                                          \fIand list the directory\fP\/
  Volume in drive A is MESSED OS
  Directory for A:/NFS
 
@@ -622,22 +698,24 @@
 HOSTS               5985   10-07-94   7:34p
 NETWORK  BAT         103   12-24-92  12:28p
 DRIVES   BAT          98   11-07-94   5:24p
-\&\fI...and many more\fP\|
+\&\fI...and many more\fP\/
       51 File(s)      82944 bytes free
-$ \f(CBmtype drives.bat\fP				\fItype the contents of DRIVES.BAT\fP\|
+$ \f(CBmtype drives.bat\fP                              \fItype the contents of DRIVES.BAT\fP\/
 net use c: presto:/usr/dos
 c:
 cd \enfs
 # net use f: porsche:/dos
 # net use g: porsche:/usr
-$ \f(CBmcopy a:hosts .\fP				\fIcopy A:HOSTS to local UNIX directory\fP\|
+$ \f(CBmcopy a:hosts .\fP                               \fIcopy A:HOSTS to local UNIX directory\fP\/
 Copying HOSTS
-$ \f(CBls -l hosts\fP					\fIand list it\fP\|
+$ \f(CBls -l hosts\fP                                   \fIand list it\fP\/
 -rw-rw-rw-   1 root     wheel        5985 Jan 28 18:04 hosts
 .De
-You must specify the drive letter to \f(CWmcopy\fP, since it uses this
-indication to decide whether the file name is a UNIX file name or a Microsoft
-file name.  You can copy files from FreeBSD to the floppy as well, of course.
+You must specify the drive letter to
+.Command mcopy ,
+because it uses this indication to decide whether the file name is a UNIX or a
+Microsoft file name.  You can copy files from FreeBSD to the floppy as well, of
+course.
 .P
 .Pn Microsoft-staircase
 \fIA word of warning\fP.  UNIX uses a different text data format from Microsoft: in
@@ -649,10 +727,14 @@
 compatibility problems, since both characters are usually invisible on the
 screen.
 .P
-In FreeBSD, you won't normally have many problems.  Occasionally a program will
-complain about non-printable characters in an input line.  Some, like
-\fIEmacs\fP, will show them.  For example, our last file, \fIdrives.bat\fP,
-would show as:
+In FreeBSD, you won't normally have many problems.  Occasionally a program
+complains about non-printable characters in an input line.  Some, like
+.X "emacs, command"
+.X "command, emacs"
+.Command -n Emacs ,
+show them.  For example, Emacs shows our last file,
+.File drives.bat ,
+like this:
 .Dx
 net use c: presto:/usr/dos^M
 c:^M
@@ -661,8 +743,11 @@
 # net use g: porsche:/usr^M
 .De
 This may seem relatively harmless, but it confuses some programs, including the
-C compiler and pagers like \fImore\fP, which may react in confusing ways.  You
-can remove them with the \f(CW-t\fP option of \fImcopy\fP\|:
+C compiler and pagers like
+.Command more ,
+which may react in confusing ways.  You
+can remove them with the \f(CW-t\fP option of
+.Command mcopy \/:
 .Dx
 $ \f(CBmcopy -t a:drives.bat .\fP
 .De
@@ -679,9 +764,8 @@
                                    # net use f: freedom:/dos
                                                             # net use g: freedom:/usr
 .De
-.X "mcopy, command"
-.X "command, mcopy"
 This is a typical result of removing the \fBCarriage Return\fP characters.  The
-\f(CW-t\fP option to \fImcopy\fP\| can help here, too.  If you use it when
-copying \fIto\fP\| a Microsoft file system, it will reinsert the \fBCarriage
-Return\fP characters.
+\f(CW-t\fP option to
+.Command mcopy
+can help here, too.  If you use it when copying \fIto\fP\/ a Microsoft file
+system, it reinserts the \fBCarriage Return\fP characters.
