  ftape-HOWTO
  Kai Harrekilde-Petersen, <khp@pip.dknet.dk>
  v1.53, 2 July 1995 for ftape-2.03b

  This HOWTO discuss the essentials of the do's and dont's for the ftape
  driver under Linux.  The ftape driver interfaces to QIC-40, QIC-80,
  QIC-3010 and QIC-3020 compatible drives only. The QIC-3010 and
  QIC-3020 standards are also known as `QIC-WIDE'.  These drives con-
  nects via the floppy disk controller (FDC).  It does not cover SCSI or
  QIC-02 tape drives.  DAT tape drives usually (always?) connect to a
  SCSI controller.  This is but one of the Linux HOWTO documents.  You
  can get an index of the HOWTOs from the Linux HOWTO index
  <http://sunsite.unc.edu/mdw/HOWTO>, while the real HOWTO's can be
  fetched (using ftp) from sunsite.unc.edu:pub/Linux/doc/HOWTO (this is
  the ``official'' place) or via the World Wide Web from the Linux Docu-
  mentation Project home page <http://sunsite.unc.edu/mdw/linux.hmtl>.

  1.  Legalese


  This is the `Frequently Asked Questions' (FAQ) / HOWTO document for
  the ftape driver (ftape-HOWTO), Copyright (C) 1993, 1994, 1995 Kai
  Harrekilde-Petersen.

  Copyright statement:

  You may distribute this document freely as a whole in any form and
  free of charge.  You may distribute parts of this document, provided
  this copyright message is included and you include a message stating
  that it is not the full HOWTO document and a pointer to where the full
  document can be obtained.  Specifically, it may be included in
  commercial distributions, without my prior consent.  However, I would
  like to be informed of such usage.

  You may translate this HOWTO into any language, whatsoever, provided
  that you leave this copyright statement and the disclaimer intact, and
  that you append a notice stating who translated the document.

  DISCLAIMER:

  While I have tried to include the most correct and up-to-date
  information available to me, I cannot guarantee that usage of the
  information in this document does not result in loss of data.  I
  provide NO WARRANTY about the information in the HOWTO and I cannot be
  made liable for any consequences for any damage resulting from using
  information in this HOWTO.



  2.  News flash


  IMPORTANT: The ftape discussion forum has moved per May 11th, 1995
  from the niksula.hut.fi server to the linux-tape list on
  vger.rutgers.edu.  Please turn to the section ``Following the ftape
  development'' on how to leave the niksula channel and subscribe to the
  vger list.

  This isn't exactly news, but anyway: The ascii and HTML versions have
  some of the section headers permuted.  This is a feature of the SGML
  system that the LDP project uses. I can't help it.



     version 1.53 (July 2, 1995)

     o  Section on the modules updated to v1.2.8

     o  The index in the LaTeX'ed versions are now correct (thanks to an
        updated SGML system)

     o  IOmega Ditto Tape Insider 1700 drive added.

     version 1.52 (June 11, 1995)

     o  Correction of spelling and typos.

     version 1.51 (May 13, 1995)

     o  Updated to ftape-2.03b

     o  Included patch for timeouts on long tapes (QIC-WIDE)

     version 1.5 (May 11, 1995)

     o  Updated to ftape-2.03a

     o  The ftape discussion list has moved to linux-
        tape@vger.rutgers.edu

     o  Conner TSM850R added to list of drives

     o  Colorado FC-20 controller works as of v2.03

     version 1.41 (Apr 1, 1995)

     o  More bad English corrected, thanks to Daniel Barclay (I'm not a
        native speaker :-)

     version 1.4 (Mar 17, 1995)

     o  Mostly typos corrected.



  3.  The preliminaries


  Note that I (the howto-maintainer) no longer use ftape myself, so I
  cannot give much up-to-date advice on e.g. compiling ftape.  If you
  have a problem, try posting on comp.os.linux.help, or to the tape
  discussion list on vger.rutger.edu (see ``Following the ftape
  development'' below).  You should try to post a summary of your
  problems and its solution(s), after you've got it working, even if you
  only got it partially working. Please also send me
  (<khp@pip.dknet.dk>) a copy of your solution so that I can add it to
  the HOWTO.

  I read my mail daily, I try to respond to everyone, but I cannot
  guarantee that I will respond immediately.  Also, I seldomly read the
  newsgroups (comp.os.linux.help et al), as my Internet access is
  through a modem line and I have to read news On-line 8-(.

  If you recieve this as part of a printed distribution or on a CD-ROM,
  please check out the Linux Documentation home page
  <http://sunsite.unc.edu/mdw/linux.hmtl> or ftp to sunsite.unc.edu:
  /pub/Linux/doc/HOWTO to see if there exists a more recent version.
  This could potentially save you a lot of troubles.




  4.  Getting and installing ftape


  I will eventually include an installation guide in this section.
  You'll have to do without it, for the moment being.


  4.1.  What is ftape


  ftape is a driver program that controls various low-cost tape drives
  that connect to the floppy controller.

  ftape is not a backup program as such; it is a device driver, which
  allows you to use the tape drive (just like the SoundBlaster 16 driver
  let you use your sound card) through the device file /dev/[n]rft[0-3].

  ftape is written by Bas Laarhoven <bas@vimec.nl>, with ``a little help
  from his friends'' to sort out the ECC (Error Correcting Code) stuff.
  ftape is copyrighted by Bas under the GNU General Public License,
  which basically says: ``go ahead and share this with the world, just
  don't disallow other people from copying it further''.

  ftape is currently beta testing, and has been that for some time now.
  It is reliable enough for critical backups (but always remember to
  check your backups, so you won't get a nasty surprise some day).

  ftape supports drives that conform to the QIC-117 and one of the
  QIC-80, QIC-40, QIC-3010, and QIC-3020 standards.  ftape does not
  support QIC-02 tape drives or drives that connect via a SCSI
  interface, e.g. DAT drives.  SCSI drives are accessed as
  /dev/[n]st[0-7] and are supported by the kernel through the SCSI
  drivers.  If you look for help on SCSI tape drives, you should read
  the SCSI-howto.  See section ``Supported drives'' and ``Un-supported
  drives'' for a list of supported and unsupported drives.



  4.2.  How fast is ftape?


  You can achieve quite respectable backup and restore speeds with
  ftape: I have a Colorado DJ-20 and an Adaptec 1542CF controller, and
  have measured a 4.25Mbyte/min sustained data transfer rate (no
  compression) across a 70Mbyte tar archive, while comparing the archive
  on the tape with data on my IDE disk.  The speed of ftape is mostly
  dependent on the data transfer rate of your FDC: The AHA1542CF has a
  ``post-1991 82077'' FDC, and it will push 1Mbit/sec at the tape drive.
  If you have an FDC which can only deliver 500Kbit/sec data rates, you
  will see half the transfer rate (well, roughly).



  4.3.  What you need to install ftape


  There are three source distributions that you must have to get ftape
  running:


  o  ftape v2.03 / v2.03a

  o  modules v1.1.87

  o  Linux kernel v1.2.<something>

  4.3.1.  Getting ftape


  ftape can be fetched from the following site (and its mirrors):



           sunsite.unc.edu [152.2.22.81]: /pub/Linux/kernel/tapes/




  You should get the files: ftape-2.03.tar.gz, ftape-2.03a-patch.gz and
  ftape-lsm. The .tar.gz and patch.gz files are the ftape driver proper,
  while the lsm file is a Linux Software Map (LSM) file for the LSM
  project.


  The following patch, which corrects timeouts on long tapes, was sent
  out by Bas on the Linux Tape list on May 13th:



       --- 1.29        1995/05/10 16:09:36
       +++ ftape-read.c        1995/05/12 17:36:37
       @@ -478,10 +478,10 @@
            case QIC_TAPE_QIC80:
              segments_per_1000_inch = 488;
              break;
       -    case QIC_TAPE_QIC3020:
       +    case QIC_TAPE_QIC3010:
              segments_per_1000_inch = 730;
              break;
       -    case QIC_TAPE_QIC3010:
       +    case QIC_TAPE_QIC3020:
              segments_per_1000_inch = 1430;
              break;
            }






  4.3.2.  modules


  Newer kernels (from 1.1.85 and on), have improved support for loadable
  modules (by Bjoern Ekwall and Jacques Gelinas), which (if possible)
  allows you to insert modules compiled for an `old' kernel into a `new'
  kernel.  To compile the kernel with this improved module support, you
  need the modules-1.2.8.tar.gz file.  The modules packages can be found
  on tsx-11.mit.edu and sunsite.unc.edu.  You must compile and install
  it before you compile the kernel.


  4.3.2.1.  What's new in modules-1.2.8?


  The v1.2.8 package no longer exhibits the infamous insmod Oops bug,
  when ftape is inserted into the kernel.  This was, by the way, caused
  because insmod did not handle modules with more that 4Kbyte of static
  data correctly.  However, this is not the greatest advantage of the
  v1.2.8 package.


  With v1.2.8 comes the kerneld daemon which can automatically insert
  the needed modules as needed.  This requires a patch to the v1.2.x
  kernels, but the patch is supposed to be included as a standard part
  of the kernel, when the 1.3 kernel series starts.



  4.3.2.2.  Installing modules-1.1.87


  Although you still can use version 1.1.87 of the modules utilities, I
  recommend that everyone upgrade to the 1.2.8 version.

  If do not wish to upgrade (or cannot), here is what to remember when
  installing the 1.1.87 version:

  The modules-1.1.87 package has a bug which will cause the insmod to
  generate a kernel Oops, which the ftape modules is inserted.  This bug
  is corrected by the insmod.c, insmod.h, and load_aout.c files that you
  can find in the ftape-2.03/insmod directory.  (From now on, mail about
  Oops'es when ftape is inserted will quietly go to /dev/null).



  4.3.3.  The Linux kernel


  Since Linux version 1.2 has been out for some time I assume that
  everyone has switched over to it.  If you have not already switched
  over, I assume you have a very good reason for not doing so, and that
  you can cope with the differences in installation etc, that it will
  make for you.

  The kernel can be fetched from a large number of sites all over the
  world, including these:



           sunsite.unc.edu [152.2.22.81]:   /pub/Linux/kernel/tapes/
           tsx-11.mit.edu  [18.172.1.2]:    /pub/linux/sources/system/
           ftp.funet.fi    [218.214.248.6]: /pub/OS/Linux/PEOPLE/Linus/




  You will find a number of subdirectories, including two named v1.1 and
  v1.2.  These contain (you guessed it!) v1.1 and v1.2 of the kernel.  I
  suggest that you get version 1.2.x.



  4.4.  If you have ftape-2.02, or earlier


  Since ftape both has been improved and some more bugs have been thrown
  out, you should consider upgrading to 2.03b mandatory.


  4.5.  ftape driver Following the development of the


  If you want to follow the development of the ftape driver, you should
  consider subscribing to the TAPE mailing list on vger. To subscribe to
  it, send a mail saying `subscribe linux-tape' to
  majordomo@vger.rutgers.edu.  When you subscribe, you will be sent a
  greeting mail, which will tell you how to submit real mails and how to
  get off the list again.

  Note for old users:

  On May 11th, Bas announced (together with the 2.03a patch) that the
  `official' mailing list from now on will we the linux-tape list on
  vger.  Hence, all that are on the Linux-activists list on Niksula
  should move to the other list.

  Since I once in a while see mail of the type ``Help! I can't get off
  niksula'', I am going to be a bit elaborate on how to get off (and
  what to do before despairing).

  To get off the TAPE channel on Niksula, you send a mail to <linux-
  activists-request@niksula.hut.fi> with the line `X-Mn-Admin: leave
  TAPE'.

  If Niksula refuses, try sending a mail with the line `X-Mn-Info: user
  <yourloginname>'.  This should return you a mail which tells you under
  what email address you are subscribed.  The Niksula mailer is very
  adamant on the point that you must unsubscribe with the same email
  address that you used to subscribe originally.

  If the machine that you originally subscribed with has changed its
  address, you can try to fake the mail by adding the line `From:
  <foo@bar.site.edu>' right before or after the `leave TAPE' line.  This
  should fool niksula into unsubscribing you.  As a very last resort,
  you could talk someone into logging into the SMTP port on niksula and
  creating a faked mail.



  4.6.  Compiling and installing the ftape driver


  There is included an installation guide (the file Install-guide) in
  the ftape distribution; please read that.



  4.7.  Can I format my tapes under Linux?


  No!  Honestly, noone is working on it: If you want to work on it, drop
  Bas a line. Until then, you'll have to use MessyDOS (arghhh!)  instead
  or buy preformatted tapes.  However, some of the preformatted tapes
  are not checked for bad sectors!.  If the ftape driver encounters a
  tape with no bad blocks, it will issue a warning.  If ftape barfs at
  your preformatted tapes, try out your DOS software.  If both the DOS
  software and ftape barfs on your tapes, a reformat will very probably
  cure the problem.

  Note that to be able to use your newly formatted tapes under ftape,
  you must erase the tape first:


               mt -f /dev/nftape erase









  4.8.  Which formatting programs can I use under DOS?


  These are known to work:


  o  Colorado Memory System's software (tape.exe)

  o  Conner Backup Basics v1.1 and all Windows versions

  o  Norton Backup

  o  QICstream version 2

  o  Tallgrass FileSecure v1.52

  o  Escom Powerstream 3.0 (qs3.exe -- QICstream v3?)

  These programs are known to be more or less buggy:


  o  Conner Backup Basics 1.0

  o  Colorado Windows tape program

  o  CP Backup (wastes tape space, but is OK apart from that)

  In fact, most software under DOS should work.  The Conner Backup
  Basics v1.0 has a parameter off by one (someone could not read the
  QIC-80 specs right!), which is corrected in version 1.1.  However,
  ftape detects this, and will work around it.  Dennis T. Flaherty
  (<dennisf@denix.elk.miles.com>) report that Conner C250MQ owners can
  obtain the new v1.1, by calling Conner at 1-800-4Conner (in the US)
  and ask for an upgrade (for a nominal fee for the floppy).  The
  Windows versions should work fine.  Some versions of Colorado's tape
  program for windows, has an off-by-one error in the number of
  segments. ftape also detect and work around that bug.

  Central Point Backup can be used, but it wastes precious tape space
  when it encounters a bad spot on the tape.

  NOTE: If you are running a formatting software under DOS, which is not
  mentioned here, please mail the relevant info to me
  (<khp@pip.dknet.dk>), so I can update the HOWTO.



  4.9.  Mixing ftape and floppies


  Since both the floppy driver and ftape needs the FDC (and IRQ6), they
  cannot run concurrently.  Thus, if you have mounted a floppy and then
  try to access the tape drive, ftape will complain that it cannot grab
  IRQ6 and then die.  This is especially a problem when designing a
  emergency disk for use with ftape.  This solution is to either load
  the boot/root disk into a ramdisk and then unmount the floppy, or have
  two FDC's.





  5.  (Un)supported hardware



  5.1.  Supported tape drives


  All drives that are both QIC-117 compatible and either QIC-40 or
  QIC-80 compatible should work. There are also experimental support of
  QIC-3010 and QIC-3020 drives (QIC-3010/302 can use 8mm tapes. This is
  sometimes refered to as `QIC-WIDE'). Currently, the list of drives
  that are known to work with ftape is:


  o  Alloy Retriever 250

  o  Archive 5580i / XL9250i

  o  Colorado DJ-10 / DJ-20 (aka: Jumbo 120 / Jumbo 250)

  o  Conner C250MQ

  o  Conner TSM420R

  o  Conner TSM850R

  o  Escom / Archive (Hornet) 31250Q

  o  Insight 80Mb

  o  Iomega 250

  o  IOmega Ditto Tape Insider 1700 (other Ditto drives probably work
     too)

  o  Mountain FS8000

  o  Summit SE 150 / SE 250

  o  Tallgrass FS300 (needs a tiny hack to work with AHA1542B)

  o  Memorex tape drive backup system

  o  Wangtek 3080F

  You can always check out the newest list of drives that are recognised
  by ftape, by looking in the file vendors.h in the ftape distribution.

  Although I do not want to endorse one drive type over another, I want
  to mention that the Colorado DJ-20 drive is rather noisy, when
  compared to, say, a Conner C250MQ drive ('tis said that the Colorado
  is 5-10 times as noisy as the Conner drive. I can't tell for sure, but
  I have a Colorado, and it is quite noisy).

  If you have a Tallgrass FS300 and an AHA1542B, you need to increase
  the bus-on / bus-off time of the 1542B.  Antti Virjo
  (<klanvi@uta.fi>), says that changing CMD_BUSON_TIME to 4 and
  CMD_BUSOFF_CMD to 12 in linux/drivers/scsi/aha1542.c will do the
  trick.

  One user has reported that ftape works (partially) the with Conner
  TSM420R drive, which supports both QIC-80 (normal) and `QIC-WIDE'
  tapes.  As of right now, ftape provides only experimental support for
  QIC-WIDE tapes, and you should be aware of this.  Hopefully, the
  TSM420R drive, and other QIC-WIDE drives, will be supported fully
  soon.  If you have a drive that can use QIC-WIDE tapes, are interested
  in getting it to work with ftape, and not afraid of being ALPHA
  tester, drop Bas <bas@vimec.nl> a mail, stating which drive you have.


  NOTE: If you have a drive that works fine, but it is not listed here,
  please send a mail to the HOWTO maintainer (<khp@pip.dknet.dk>).


  5.2.  Supported special controllers


  These dedicated high-speed tape controllers are supported by ftape:


  o  Colorado FC-10

  o  Colorado FC-20

  o  Mountain MACH-2

  o  IOmega Tape Accelerator II

  Support for the FC-10 controller has been merged into the ftape driver
  in version 1.12. See the RELEASE-NOTES and the Makefile files in the
  ftape distribution.  Since of version 2.03 of ftape, the FC-20
  controller will work (but do check the Release notes!).

  The support for the MACH-2 controller was added in ftape-1.14d.

  To use the IOmega Tape Accelerator II, use -DMACH2, and set the right
  settings for I/O base, IRQ and DMA.  This works (by the empirical
  testing of Scott Bailey <sbailey@xcc.mc.xerox.com>), with at least
  ftape-2.02.


  Anti-Colorado message:

  As of lately, Colorado has proved themselves totally unwilling to help
  with FC-10 and FC-20 support.  This is sad, and can only force me to
  say: Don't buy a Colorado high-speed controller, or even a Colorado
  tape drive.  Why support a manufacturer who does not want to support
  his own product?



  5.3.  Un-supported tape drives



  o  All drives that connect to the parallel port (eg: Colorado Trakker)

  o  High-Speed controller's. (eg: Colorado TC-15  & FC-20)

  o  Irwin AX250L / Accutrak 250. (not a QIC-80 drive)

  o  IBM Internal Tape Backup Unit (identical to the Irwin AX250L drive)

  o  COREtape light

  Generally, ALL drives that connect to the parallel port are NOT
  supported.  This is because these drives uses (different) proprietary
  interfaces, that are very much different from the QIC-117 standard.

  The Colorado TC-15 controller (and its like) are not supported
  directly by the ftape driver.  The only `special' controllers that can
  be used with ftape is the Colorado FC-10 and the Mountain MACH-2 (see
  above).

  The Irwin AX250L (and the IBM Internal Tape Backup Unit) does not work
  the ftape.  This is because they only support QIC-117, but not the
  QIC-80 standard (they use Irwin's proprietary servoe (Rhomat) format).
  I know nothing about the Rhomat format, nor where to get any info on
  it.  Sorry.

  The COREtape light, does not accept the initialisation commands, we're
  feeding it. This pretty much leaves the drive unusable.



  5.4.  Using an external tape drive with ftape


  If you have a floppy controller which has a female DB37 connector on
  the bracket (and some means of delivering power to the drive), you can
  use it with ftape.  OK, that sentence was not very obvious. Let's try
  it this way: Some FDC's (the very ancient one's), have a DB37
  connector on the bracket, for connecting to external floppy drives.

  If you make a suitable cable (from a quick glance on an FDC that I've
  got lying around, it seems to be a straight 1-to-1 cable. However,
  your milage may vary) from the DB37 connector (on the FDC) and to your
  external tape drive, you can get ftape to control your tape drive.

  This is because that from a program's view there is no difference
  between the internal and the external connectors. So, from ftape's
  point of view, they are identical.



  5.5.  ftape Getting PCI motherboards to work with


  Unfortunately, some PCI motherboards cause problems when running
  ftape.  Some people have experienced that ftape would not run in a PCI
  based box, but ran flawlessly in a normal ISA based 386DX machine.  To
  quote from the RELEASE-NOTES file in the ftape distribution:






























  More PCI news:
  --------------

  There have been more reports about PCI problems, some of them
  were solved by upgrading the (flash) BIOS.
  Other rumours are that it has to do with the FDC being on the
  PCI bus, but that is not the case with the Intel Premiere boards.

  Here is a list of systems and the BIOS versions known to work:

  board:                          bios revision:

  Intel Premiere PCI (Revenge)    1.00.09.AF2

  Intel Premiere PCI II (Plato)   1.00.08.AX1 (disable GAT in BIOS!)
                                  1.00.10.AX1

  To see if you're having the GAT problem, try making a backup
  under DOS. If it's very slow and often repositions you're
  probably having this problem.

  PCI news:
  ---------
  There have been some problem reports from people using PCI-bus based
  systems getting overrun errors.
  I wasn't able to reproduce these until I ran ftape on a Intel Plato
  (Premiere PCI II) motherboard with bios version 1.00.08AX1.
  It turned out that if GAT (Guaranteed Access Timing) is enabled (?)
  ftape gets a lot of overrun errors.
  The problem disappears when disabling GAT in the bios.
  Note that Intel removed this setting (permanently disabled) from the
  1.00.10AX1 bios !

  It looks like that if GAT is enabled there are often large periods
  (greater than 120 us !??) on the ISA bus that the DMA controller cannot
  service the floppy disk controller.
  I cannot imagine this being acceptable in a decent PCI implementation.
  Maybe this is a `feature' of the chipset. I can only speculate why
  Intel choose to remove the option from the latest Bios...

  The lesson of this all is that there may be other motherboard
  implementations having the same of similar problems.
  If you experience a lot of overrun errors during a backup to tape,
  see if there is some setting in the Bios that may influence the
  bus timing.








  6.  Backing up and restoring data


  This section describes some simple uses of tar and mt.



  6.1.  Writing an archive to a tape


  You can use `tar', `dd', `cpio', and `afio'. You will need to use `mt'
  to get the full potential of your tapes and the ftape driver.  For a
  start I'd recommend using `tar', as it can archive lots of directories
  and let you pick out seperate files from an archive.  I have been told
  that cpio creates smaller archives and is more flexible than tar, but
  I haven't tried it myself.  `afio' creates backups where each file is
  compressed individually and then concatenated.  This will allow you to
  access the files ``after'' the point of the error.  If you use gzipped
  tar files, all data after the point of the error is lost! (to me, this
  is a pretty good reason for NOT using compression on backups).

  To make a backup of your kernel source tree using tar, do this
  (assuming you have the sources in /usr/src/linux):



               cd /usr/src
               tar cf /dev/ftape linux




  This will not compress the files, but gives you a smoother tape run.
  If you want the compression (and you've got tar 1.11.2), you just
  include the -z flag(*), eg: `tar czf /dev/ftape linux'

  For further instructions on how to use tar, dd and mt look at the man
  pages and the texinfo files that comes with the respective
  distributions.

  (*) tar assumes that the first argument is options, so the `-' is not
  necessary, i.e. these two commands are the same: `tar xzf /dev/ftape'
  and `tar -xzf /dev/ftape'



  6.2.  Restoring an archive


  OK, let us restore the backup of the kernel source you made in section
  ``Writing an archive to a tape'' above.  To do this you simply say



               tar xf /dev/ftape




  If you used compression, you will have to say



               tar xzf /dev/ftape




  When you use compression, gzip will complain about trailing garbage
  after the very end of the archive (and this will lead to a `broken
  pipe' message).  This can be safely ignored.

  For the other utilities, please read the man page.






  6.3.  Testing the archive


  tar has an option (-d) for detecting differences between two archives.
  To test your backup of the kernel source say



               tar df /dev/ftape




  If you do not have the man page for tar, you are not lost (yet); tar
  has a builtin option list: try `tar --help 2>&1 | more'



  6.4.  Putting more than one tar file on a tape


  To put more than one tar file on a tape you must have the mt utility.
  You will probably have it already, if you got one of the mainline
  distributions, e.g.  Slackware or Debian.

  tar generates a single Tape ARchive (that's why it is called `tar')
  and knows nothing about multiple files or positioning of a tape, it
  just reads or writes from/to a device. mt knows everyting about moving
  the tape back and forth, but nothing about reading the data off the
  tape.  As you might have guessed, tar and mt in conjunction, does the
  trick.

  By using the nrft[0-3] (nftape) device, you can use `mt' to position
  the tape the correct place (`mt -f /dev/nftape fsf 2' means step over
  two ``file marks'', i.e.  tar files) and then use tar to read or write
  the relevant data.



  6.5.  Appending files to an archive


  ``Is there a way to extend an archive -- put a file on the tape, then
  later, add more to the tape?''

  No. The tar documentation will tell you to use `tar -Ar', but it does
  not work.  This is a limitation of the current ftape driver.



  6.6.  Mount/unmounting tapes


  Since a tape does not have a ``filesystem'' on it, you do not mount /
  unmount the tape.  To backup, you just insert the tape and run your
  `tar' command (or whatever you use to access the tape with).










  7.  Creating an emergency boot floppy for ftape


  This section was written by Claus Toendering <ct@login.dknet.dk>.

  Once you are the happy owner of a tape drive and several tapes full of
  backups, you will probably ask yourself this question: ``If everything
  goes wrong, and I completely lose my hard disk, how do I restore my
  files from tape?''

  What you need is an emergency floppy disk that contains enough files
  to enable you to boot Linux and restore your hard disk from tape.

  The first thing you should do is to read ``The Linux Bootdisk HOWTO''
  written by Graham Chapman <grahamc@zeta.org.au>.  That document tells
  you almost everything you need to know about making an emergency
  floppy boot kit.  The paragraphs below contain a few extra pieces of
  information that will make your life a bit easier when you follow
  Graham Chapman's procedures:


  o  You don't really need /etc/init, /etc/inittab, /etc/getty, and
     /etc/rc.d/* on your floppy disk.  If Linux doesn't find /etc/init,
     it will start /bin/sh on your console, which is fine for restoring
     your system.  Deleting these files gives you extra space on your
     floppy, which you will probably need.

  o  Find a small version of /bin/sh.  They are frequently available on
     the boot floppies that come with a Linux distribution.  This again
     will give you extra space.

  o  The /etc/fstab you include on your floppy disk should look like
     this:


               /dev/fd0        /               minix   defaults
               none            /proc           proc    defaults





  Once you have booted from your floppy, give the command:


               mount -av





  o  Make sure your floppy drive is not mounted when you access the
     streamer tape!  Otherwise you may get the following error message:


               Unable to grab IRQ6 for ftape driver





  This implies that you MUST load the floppy into a RAMDISK.

  This has the unfortunate consequence that the programs needed to
  restore the files from the tape must not be located on a separate
  floppy disk.  You have two options here:
     1. You place tar (or cpio or afio or whatever other backup program
        you use) on your root floppy disk.  (This is where you'll need
        all the extra space created in the steps above.)

     2. Before you start restoring from tape, copy tar (or cpio or afio
        or whatever) to your hard disk and load it from there.

  o  Apart from your backup program, you will probably need mt on your
     root floppy as well.

  o  Make sure your ftape device (typically /dev/nrft0) is present on
     your boot floppy.

  o  Finally: TRY IT! Of course, I don't recommend that you destroy your
     hard disk contents to see if you are able to restore everything.
     What I do recommend, however, is that you try booting from your
     emergency disks and make sure that you can at least make a file
     listing of the contents of your backup tape.





  8.  Frequently Asked Questions


  This is a collection of questions I get asked once in a while, which
  could fall into the category of FAQ's.  If you feel that there is some
  question that ought to be added to the list, please feel free to mail
  me (but do include an answer, thanks!).



  8.1.  Can I exchange tapes with someone using DOS?


  No.  The DOS software conforms to the QIC-80 specs about the layout of
  the DOS filesystem, and it should(?)  be a small problem to write a
  program that can read/write the DOS format.  In fact, I'd bet that
  creating a nice user interface would be a bigger problem.



  8.2.  How do I `....' with tar?


  These are really tar questions: Please read the man page and the info
  page.  If you have not got it either, try `tar --help 2>&1 | more'.

  If your version of tar is v1.11.1 or earlier, consider upgrading to
  v1.11.2 - This version can call GNU zip directly (i.e.: it supports
  the -z option) and has an elaborate help included.  Also, it compiles
  right out of the box on Linux.



  8.3.  ftape DMA transfers gives ECC errors


  Sadly to say there are some SVGA cards and ethernet cards that do not
  decode their addresses correct.  This typically happens when the ftape
  buffers are in the range 0x1a0000 to 0x1c0000.  Somehow, the DMA write
  cycles get clobbered and every other byte written gets a bad value
  (0xff).  These problems are reported to happen with both SVGA and
  ethernet cards.  We know of at least one (bad?) ATI 16bit VGA card
  that caused this.
  The easiest solution is to put the card in an 8bit slot (it is often
  not enough to reconfigure the card to 8bit transfers).  Moving the
  ftape buffer away from the VGA range is only a partial solution; All
  DMA buffers used in Linux can have this problem!  Let us make this one
  clear: This has nothing to do with the ftape software.



  8.4.  insmod says the kernel version is wrong


  The insmod program checks the kernel version against the version
  recorded in the ftape driver.  This is a string in kernel-version.h,
  (e.g.: #define KERNEL_VERSION "1.1.72";) which is extracted from the
  kernel you are running when you run `make dep'.  If you got the error
  when you tried to insert the ftape driver, remove the file `kernel-
  version.h', type `make dep; make' again and the kernel-version.h file
  should be updated.  Remember that you will have to do this every time
  you change to another kernel version.

  Newer versions of insmod allows you to ``force'' insertion of a module
  into the kernel, even though the version string is incorrect.


  8.5.  format''' ftape complains that ``This tape has no 'Linux raw


  You get this complaint, if you haven't erased your freshly formatted
  tape.  This is because ftape wants a ``magic header'' on the tape, to
  be able that it is allowed to interpret the header segment in it's own
  way (eg: file marks).  To remove the problem, say `mt -f /dev/nftape
  erase'



  8.6.  binaries/sources/manpages?  Where can I find the tar/mt/cpio/dd


  All of these tools have been developed by the GNU project, and the
  source (and man page) can be fetched from just-about any ftp site in
  the world (including ftp.funet.fi, tsx-11.mit.edu, and
  sunsite.unc.edu).  In any case they can be fetched from the official
  GNU home site: prep.ai.mit.edu [18.71.0.38]:/pub/gnu.  The latest
  versions (by 26. march 94) are:



               cpio:   2.3 (cpio-2.3.tar.gz)
               dd:     3.9 (fileutils-3.9.tar.gz)
               mt:     2.3 (cpio-2.3.tar.gz)
               tar:    1.11.2 (tar-1.11.2.tar.gz)
               gzip:   1.2.4 (gzip-1.2.4.tar.gz)




  They all compile out of the box on Linux v1.0.4 / libc v4.5.19 / gcc
  v2.5.8 (The rmt program does not compile out of the box, but it is not
  needed as it is only used for accessing the tape drive remotely).
  There is a patch for mt included in the ftape distribution, which
  makes the mt status command spew out usable information for ftape
  drives.




  8.7.  Where can I obtain the QIC standards?


  If you wish to help developing ftape, or add some utility (e.g. a tape
  formatting program), you will need that appropriate QIC standards.
  The standard(s) to get is: QIC-80 and perhaps QIC-117.  QIC-117
  describes how commands are sent to the tape drive (including timing
  etc), so you would probably never need it.  QIC-80 describes the tape
  layout, ECC code, standard filesystem and all such ``higher-level''
  stuff.  You can get the QIC standards from the following address:



       Quarter Inch Cartridge Drive Standards, Inc.
       311 East Carrillo Street
       Santa Barbara, California 93101
       Phone: (805) 963-3853
       Fax:   (805) 962-1541




  Note: They are registered as `Freeman Associates, Inc' in the phone
  book.


  8.8.  What block-size to use with tar


  When using compression, and in all general, it can be a benefit to
  specify to tar, that it should block the output into chunks.  Since
  ftape cuts things into 29Kbyte blocks, saying `-b58' should be
  optimum.

  ``Why 29Kbyte?'', I hear you cry.  Well, the QIC-80 standard specifies
  that all data should be protected by an Error Correcting Code (ECC)
  code.  The code specified in the QIC-80 standard is known as a Reed-
  Solomon (R-S) code.  The R-S code takes 29 data bytes and generates 3
  parity bytes.  To increase the performance of the ECC code, the parity
  bytes are generated across 29 1Kbyte sectors.  Thus, ftape takes
  29Kbytes of data, adds 3Kbytes of ECC parity, and writes 32Kbytes to
  the tape at a time.  For this reason, ftape will always read and write
  32K byte blocks to be able to detect (and correct) data errors.

  If you are curious, and wish to know more, look in the ecc.c and ecc.h
  files, for an explanation of the code and a reference to a textbook on
  Reed-Solomon codes.



  8.9.  ftape detects more bad sectors than DOS on QIC-3020 tapes


  If you look at the difference, you will notice that ftape always
  detects 2784 sectors more than DOS.


  The number that ftape reports is correct (of course :-). Each
  correctly formatted QIC-3020 tape has 2784 sectors at fixed positions
  that are marked in the bad sector map. To quote from the specs:

  "Tracks 5,7,9,11,13,15,17,19,21,23,25 and 27 within 4 segments of
  either EOT or BOT are prone to increased error rates due to hole
  imprints.  Therefore, these regions shall be mapped as bad at format
  time and entered in the bad sector map by indicating that all sectors
  within the identified segments are bad."
  This gives 12 tracks * 2 * 4 segments * 29 sectors == 2784 sectors.

  So ftape choose to report the real number of sectors that cannot be
  used on the tape, while dos gives a more optimistic number giving a
  better indication of tape quality.  (ftape's behaviour might change in
  the future to detect correct formatting and display the separate
  numbers. It has rather low priority though)

  QIC-3010 are alike QIC-3020 tapes regarding this.







  9.  Debugging the ftape driver




  9.1.  bug?  The kernel/ftape crashes on me when I do `...' - is that a


  No, that is a feature ;-)

  Seriously, reliable software do not crash.  Especially kernels do not
  or rather should not crash.  If the kernel crashes upon you when you
  are running ftape, and you can show that it is ftape that is messing
  things up, regard it as a Bug That Should Be Fixed.  Mail the details
  to Bas (<bas@vimec.nl>) and to the tape channel.



  9.2.  OK, it's a bug ...ehhh... feature - How do I submit a report?


  First, make sure you can reproduce the problem.  Spurious errors are a
  pain in the ass, since they are just about impossible to hunt down :-/
  This is a quick check list:


  o  Kernel version, and patches applied

  o  ftape version

  o  tape drive model / manufacturer

  o  Expansion bus type (EISA, ISA, PCI, or VL-bus)

  o  What you did to expose the problem

  o  What went wrong on your system.

  o  Do not delete the kernel and the ftape.o file. We may want you run
     try some patches out or run a different test on your system.

  Increase the tracing level to 7 (just below maximum tracing) and run
  the offending command again.  Get the tracing data from the kernel log
  or /proc/kmsg, depending on where you harvest your error messages.
  Try to look at what ftape spews out at you.  It may look in-
  comprehensible to you at first, but you can get valuable information
  from the logfile.  Most messages have a function name prepended, to
  make it easier to locate the problem.  Look through the source, don't
  just cry ``WOLF!'', without giving it a try.  If your version of the
  kernel (or ftape for that matter), is ``old'', when compared to the
  newest version of the kernel, try to get a newer (or even the newest)
  kernel and see if the problem goes away under the new kernel.  When
  you post your problem report, include the information about ftape
  version, kernel version, expansion bus type (ISA, VL-bus, PCI or
  EISA), bus speed, floppy controller, and tape drive.  State exactly
  what you did, and what happened on your system.  Some people have
  experienced that ftape would not run in a PCI based box, but ran
  flawlessly in a normal ISA based 386DX machine (see section ``Getting
  PCI motherboards to work with <tt>ftape</tt>'' on PCI machines above)

  Also, please think of the poor souls who actually pay the their
  Internet access (like me): avoid posting a (huge) log from the ftape
  run, without reason.  Instead, you could describe the problem, and
  offer to send the log to the interested parties.

  Send your bug report to <linux-tape@vger.rutgers.edu>. You might also
  want to mail the bug to <bas@vimec.nl>.


  9.3.  How do I change the trace-level?


  You can do this two ways: either change the default trace-level (the
  var `tracing' in file `ftape-rw.c') and recompile or say



               mt -f /dev/ftape fsr <tracing-level>




  The use of the fsr command in mt is a hack, and will probably
  disappear or change with time.


  9.4.  ftape keep saying `... new tape', what do I do?


  [You cannot do this anymore; I do not know a way of fixing it]

  To get rid of this, do this (blindfold): login as root and say `rmmod
  ftape'.  ftape should choke a few times, give three segmentation
  violations (or so), and give up life.

  Check the activity LED on your floppy drive (you do have one, don't
  you?).  If it is constantly lit, you have turned the floppy cable
  upside down somewhere.  Check your cable between controller, tape
  drive and floppy drive.  Usually, one (or more) of the connectors have
  been turned upside down, such that pin 1 in one end connects to pin 34
  in the other end.  (All the even-numbered pins are grounded, so you
  wont be able to use your floppy either).  Don't worry; this cannot
  damage your hardware.
