home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / ftape-ho < prev    next >
Encoding:
Text File  |  1996-07-11  |  42.1 KB  |  1,051 lines

  1.   Linux Ftape HOWTO
  2.   Kai Harrekilde-Petersen, <khp@dolphinics.no>
  3.   v1.8, 22 May 1996 for ftape-2.08
  4.  
  5.   This HOWTO discuss the essentials of the do's and dont's for the ftape
  6.   driver under Linux.  The ftape driver interfaces to QIC-40, QIC-80,
  7.   QIC-3010 and QIC-3020 compatible drives only. The QIC-3010 and
  8.   QIC-3020 standards are also known as `Travan' (TR-2 and TR-3).  These
  9.   drives connects via the floppy disk controller (FDC).  It does not
  10.   cover SCSI or QIC-02 tape drives.  DAT tape drives usually (always?)
  11.   connect to a SCSI controller.  This is but one of the Linux HOWTO doc¡
  12.   uments.  You can get an index of the HOWTOs from the Linux HOWTO index
  13.   <http://sunsite.unc.edu/mdw/HOWTO>, while the real HOWTO's can be
  14.   fetched (using ftp) from sunsite.unc.edu:pub/Linux/doc/HOWTO (this is
  15.   the ``official'' place) or via the World Wide Web from the Linux Docu¡
  16.   mentation Project home page <http://sunsite.unc.edu/mdw/linux.html>.
  17.  
  18.   1.  Legalese
  19.  
  20.   Linux ftape-HOWTO may be reproduced and distributed in whole or in
  21.   part, subject to the following conditions:
  22.  
  23.        Copyright (c) 1993-1996 by Kai Harrekilde-Petersen
  24.        Peder Holters vei 13
  25.        1168 Oslo
  26.        Norway
  27.        <khp@dolphinics.no>
  28.  
  29.   Linux ftape-HOWTO is a free document; you may reproduce and/or modify
  30.   it under the terms of version 2 (or, at your option, any later
  31.   version) of the GNU General Public License as published by the Free
  32.   Software Foundation.
  33.  
  34.   This howto is distributed in the hope that it will be useful, but
  35.   WITHOUT ANY WARRANTY; without even the implied warranty of
  36.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  37.   General Public License for more details.
  38.  
  39.   The author encourages wide distribution of this document for personal
  40.   or commercial use, provided that the above copyright notice remains
  41.   entact and the provisions of the GNU General Public License are
  42.   adhered to.  The summary is that you may copy and distribute this
  43.   document free of charge, or for a profit.  No explicit permission is
  44.   required from the author for reproduction of this document in any
  45.   medium, physical or electronic.
  46.  
  47.   Note that derivative works and translations of this document must be
  48.   placed under the GNU General Public License, and the original
  49.   copyright notice must remain entact.  If you have contributed new
  50.   material to this document, you must make the source code (e.g., SGML
  51.   source) available for your revisions.  Please make revisions and
  52.   updates available directly to the author: Contact khp@dolphinics.no
  53.   via Internet e-mail.  This will allow the author to merge updates and
  54.   provide consistent revisions to the Linux community.
  55.  
  56.   The author encourages distributors of Linux software in any medium to
  57.   use the howto as an installation and user guide.  Given the copyright
  58.   above, you are free to print and distribute copies of this document
  59.   with your software.  If doing so, you may wish to include a short
  60.   ``installation supplement'' for your release, or modify the relevant
  61.   sections of this book to reflect your product.
  62.  
  63.   The author would like to know of any plans to publish and distribute
  64.   this howto commercially.  In this way, we can ensure that you are kept
  65.   up-to-date with new revisions.  And, should a new version be right
  66.   around the corner, you might wish to delay your publication of the
  67.   howto until it is available.
  68.  
  69.   If you are distributing this howto commercially, donations, royalties,
  70.   and/or printed copies are greatly appreciated by the author.
  71.   Contributing in this way shows your support for free software and the
  72.   Linux Documentation Project.
  73.  
  74.   If you have questions or comments, please contact the author at
  75.   khp@dolphinics.no or at the address listed above.
  76.  
  77.   2.  News flash
  78.  
  79.   This isn't exactly news, but anyway: The ascii and HTML versions have
  80.   some of the section headers permuted.  This is a feature of the SGML
  81.   system that the LDP project uses. I can't help it.  It even seems that
  82.   the HTML version like to repeat some of my section headers once in a
  83.   while - luckily, the contents should be the same.  In the GNU info
  84.   version, you cannot select the section ``(Un)supported drives'',
  85.   because info thinks that ``(un)'' refers to a file.
  86.  
  87.      version 1.8 (May 22, 1996)
  88.  
  89.      ╖  Copyright policy changed to GNU GPL v2
  90.  
  91.      ╖  The maintainer's email address has changed.
  92.  
  93.      ╖  Updated to ftape-2.08
  94.  
  95.      ╖  ftape is now a part of the kernel distribution.
  96.  
  97.      version 1.7.1 (February 13, 1996)
  98.  
  99.      ╖  Updated to ftape-2.06b
  100.  
  101.      version 1.7 (January 28, 1996)
  102.  
  103.      ╖  Updated to ftape-2.06 and modules-1.3.57
  104.  
  105.      version 1.6.2 (January 23, 1996)
  106.  
  107.      ╖  Connor TST3200R drive added
  108.  
  109.      ╖  Updated 2Mbps fdc information.
  110.  
  111.      version 1.6.1 (January 16, 1996)
  112.  
  113.      ╖  minor corrections
  114.  
  115.      version 1.6 (January 10, 1996)
  116.  
  117.      ╖  New maintainer of ftape
  118.  
  119.      ╖  updated to v2.05
  120.  
  121.      ╖  added new drives
  122.  
  123.   It has been quite some months since I last updated the HOWTO.  This is
  124.   due to several reasons, but mostly because I have moved from Denmark
  125.   to Norway due to a job change (this meant that my Linux box was stored
  126.   away for nearly two months. ugh).  Please note the new email address:
  127.   khp@dolphinics.no.  Until June 1st, I will still get the mail sent to
  128.   my old address, but after that day, email to the old account will no
  129.   longer reach me.
  130.  
  131.   3.  The preliminaries
  132.  
  133.   Note that I (the howto-maintainer) no longer use ftape myself, so I
  134.   cannot give much up-to-date advice on what hardware to buy.  If you
  135.   have a problem, try posting on comp.os.linux.help, or to the tape
  136.   discussion group linux.dev.tape.  This is a Usenet group that mirrors
  137.   the traffic on the mailing list linux-tape@vger.rutger.edu (see
  138.   ``Following the ftape development'' below).  I encourage reading and
  139.   posting on the newsgroup, since the vger machine is overburdened with
  140.   the load of the Linux mailing lists.
  141.  
  142.   You should try to post a summary of your problems and its solution(s),
  143.   after you've got it working, even if you only got it partially
  144.   working. Please also send me (<khp@dolphinics.no>) a copy of your
  145.   solution so that I can add it to the HOWTO.
  146.  
  147.   I read my mail daily, I try to respond to everyone, but I cannot
  148.   guarantee that I will respond immediately.  I usually read the
  149.   newsgroups (linux.dev.tape and the .kernel list), but this is subject
  150.   to the workload at my for-pay job.
  151.  
  152.   If you recieve this as part of a printed distribution or on a CD-ROM,
  153.   please check out the Linux Documentation home page
  154.   <http://sunsite.unc.edu/mdw/linux.html> or ftp to
  155.   <ftp://sunsite.unc.edu:/pub/Linux/doc/HOWTO> to see if there exists a
  156.   more recent version.  This could potentially save you a lot of
  157.   trouble.
  158.  
  159.   3.1.  What is ftape
  160.  
  161.   ftape is a driver program that controls various low-cost tape drives
  162.   that connect to the floppy controller.
  163.  
  164.   ftape is not a backup program as such; it is a device driver, which
  165.   allows you to use the tape drive (just like the SoundBlaster 16 driver
  166.   let you use your sound card) through the device files
  167.   /dev/[n]rft[0-3].
  168.  
  169.   ftape is written by Bas Laarhoven <bas@vimec.nl>, with ``a little help
  170.   from his friends'' to sort out the ECC (Error Correcting Code) stuff.
  171.   ftape is copyrighted by Bas under the GNU General Public License,
  172.   which basically says: ``go ahead and share this with the world, just
  173.   don't disallow other people from copying it further''.
  174.  
  175.   ftape is quite stable, and has been that for some time now.  Most
  176.   changes is to support the new QIC-3010 and QIC-3020 (aka Tranvan) tape
  177.   formats and new tape drives.  It is reliable enough for critical
  178.   backups (but always remember to check your backups, so you won't get a
  179.   nasty surprise some day).
  180.   ftape supports drives that conform to the QIC-117 and one of the
  181.   QIC-80, QIC-40, QIC-3010, and QIC-3020 standards.
  182.  
  183.   ftape support neither QIC-02, IDE (ATAPI), nor SCSI tape drives.  SCSI
  184.   drives are accessed as /dev/[n]st[0-7] and are supported by the kernel
  185.   through the SCSI drivers.  If you look for help on SCSI tape drives,
  186.   you should read the SCSI-howto.  ATAPI tape drives are supported by
  187.   the kernel since 1.3.46.  See section ``Supported drives'' and ``Un-
  188.   supported drives'' for a list of supported and unsupported drives.
  189.  
  190.   4.  Getting and installing ftape
  191.  
  192.   4.1.  Getting ftape
  193.  
  194.   You can get ftape from many ftp sites in the world.  The two main
  195.   sites are:
  196.  
  197.   ╖  ftp://ftp.mcc.ac.uk/pub/linux/misc/ftape/
  198.  
  199.   ╖  ftp://sunsite.unc.edu/pub/Linux/kernel/tapes/
  200.  
  201.   sunsite is the official place to look for ftape.
  202.  
  203.   Dr. Owen LeBlanc has been kind enough to provide me with access to
  204.   Manchester's public ftp server, so I can drop ftape code directly into
  205.   the
  206.  
  207.   Due to my job and email change, the ftp area I have on
  208.   www.pip.dknet.dk will go away my June 1st, 1996.  I will not upload
  209.   new versions to pip anymore for that reason.
  210.  
  211.   I will eventually include an installation guide in this section.  For
  212.   the moment being, you'll have to do with the document that is included
  213.   in the ftape distribution.
  214.  
  215.   4.2.  What you need to install ftape
  216.  
  217.   There are three source distributions that you must have to get ftape
  218.   running:
  219.  
  220.   ╖  ftape v2.08
  221.  
  222.   ╖  modules v1.3.57 or later
  223.  
  224.   ╖  Linux kernel v1.2.13 or v1.3.x (preferably 1.3.74 or later)
  225.  
  226.   Even if you have a v1.2 kernel, you should use the modules-1.3.57
  227.   package, not the modules-1.2.8 package (Bj°rn Ekwall, maintainer of
  228.   the modules package, encourages this).
  229.  
  230.   4.2.1.  The modules utilities
  231.  
  232.   The modules packages can be found on tsx-11.mit.edu and
  233.   sunsite.unc.edu.  You must compile and install it before you compile
  234.   the kernel.
  235.  
  236.   4.2.1.1.  What's new in modules-1.3.57?
  237.  
  238.   As of kernel version 1.3.57, ``kernel daemon'' (kerneld) support is
  239.   included in the standard kernel.  kerneld can automatically insert and
  240.   remove the neccessary modules to your kernel, at runtime.  To be able
  241.   to utilize this, you must have the modules-1.3.57 package, which
  242.   contains the kerneld daemon.
  243.  
  244.   WARNING! If you use ftape's non-rewinding devices (/dev/nrft[0-3]) you
  245.   should never ever use kerneld to automatically insert/remove ftape.
  246.   Failing to observe this may cause you to loose the data on the tape.
  247.  
  248.   4.2.1.2.  Installing the modules utilitles
  249.  
  250.   Extract the files somewhere convienient.  Then, go into the
  251.   modules-1.3.57 (or -1.3.69) directory and say make all; make install.
  252.   Remember that you must be root to be able to install the files and man
  253.   pages.
  254.  
  255.   If you wish to enable certain users (e.g. yourself, as non-root) to
  256.   insert/remove modules without having to log in as root, you can create
  257.   a new group (I call it trust), change the group of insmod to trust and
  258.   the permisions to 4710 (i.e: suid root, the group have execute rights,
  259.   but `other' have no rights).  This is, ofcourse, a security, since any
  260.   user who is member of the trust group will be able to insert anything
  261.   into the kernel and by careful coding give herself root rights (you
  262.   have been warned).  However, if you do trust the peploe in the trust
  263.   group, this is a convenience.  I have just myself in the trust group,
  264.   and uses this trick because I prefer working as a normal user, but
  265.   need to insert/remove the ftape.o module while working on it.
  266.  
  267.   4.2.2.  The Linux kernel
  268.  
  269.   Since Linux version 1.2 has been out for some time I assume that
  270.   everyone has switched over to it (or v1.3.x for that matter).  If you
  271.   have not already switched over, I assume you have a very good reason
  272.   for not doing so, and that you can cope with the differences in
  273.   installation etc, that it will make for you.  If you wish to know what
  274.   version the latest kernel is, simply try finger @linux.cs.helsinki.fi.
  275.  
  276.   The kernel can be fetched from a large number of sites all over the
  277.   world, including these:
  278.  
  279.            sunsite.unc.edu    [152.2.22.81]:    /pub/Linux/kernel/tapes/
  280.            tsx-11.mit.edu     [18.172.1.2]:     /pub/linux/sources/system/
  281.            ftp.funet.fi       [128.214.248.6]:  /pub/OS/Linux/PEOPLE/Linus/
  282.            ftp.cs.helsinki.fi [128.214.48.123]: /pub/Software/Linux/Kernel/
  283.  
  284.   You will find a number of subdirectories, including two named v1.2 and
  285.   v1.3.  These contain (you guessed it!) v1.2 and v1.3 of the kernel.
  286.  
  287.   The v1.3 is the development kernel branch, while the v1.2 series are
  288.   updated rather seldomly, and only after some serious bug has been
  289.   found in it, and a field-tested fix has been provided.
  290.  
  291.   For a minimum-hazzle kernel, you should go for the v1.2 series, but if
  292.   you are more adventerous (or the v1.2 kernels lack your favorite CDROM
  293.   driver), you can get a v1.3 kernel.
  294.  
  295.   Be warned, though, that the v1.3 kernels are of unknown stability, and
  296.   you should be well fared in patching, configuring, and compiling the
  297.   kernel.
  298.  
  299.   4.2.2.1.  Quick guide to compiling the kernel
  300.  
  301.   The `standard' (recommended) place to install the kernel source is
  302.   /usr/src/linux.
  303.  
  304.   Go to /usr/src and type tar xzf linux-1.2.13.tar.gz (or whatever
  305.   kernel version you intend to compile).  This will create the linux
  306.   directory (and a lot of subdirectories), which holds the kernel source
  307.   code.
  308.  
  309.                # cd /usr/src
  310.                # tar xzf linux-1.2.13.tar.gz
  311.  
  312.   Go into the linux directory and configure the kernel.
  313.  
  314.                # cd linux
  315.                # make config
  316.  
  317.   The configuration script will ask you about which drivers you wish to
  318.   include, and what functionality (networking, filesystems, etc) that
  319.   you want.  If you use a kernel version later than v1.3.34, there will
  320.   be NO ftape option.  This is because ftape has been taught to allocate
  321.   its dma buffers at insmod time.  Hence, the need for `kernel support'
  322.   vanished.  If you have a pre-2.04 ftape distribution, you can get a
  323.   patch from ftp.mcc.ac.uk which will implement the dynamic buffers.
  324.  
  325.   Note that you can safely insert a ftape module into a kernel which is
  326.   configured for `ftape support'.  The only drawback is that you will
  327.   lose around 112Kbyte of precious dma'able memory.
  328.  
  329.   If you use a v1.2 kernel, you must make a short detour around the
  330.   kernel directory, to apply a patch to the kernel/ksyms.c file at this
  331.   point.  The patch can be found as ftape-2.08/linux-1.2/ksyms.patch.
  332.   Change to the directory and apply the patch.
  333.  
  334.                # cd kernel
  335.                # patch < ../../ftape-2.08/linux-1.2/ksyms.patch
  336.                # cd ..
  337.  
  338.   (this assumes that you have the ftape source lying in
  339.   /usr/src/ftape-2.08).
  340.  
  341.   After you have configured the kernel, you must generate the dependency
  342.   files and then compile the kernel.
  343.  
  344.                # make dep
  345.                # make zImage
  346.  
  347.   If everything goes well, you should find the compiled kernel in
  348.   arch/i386/boot/zImage.  If you have selected any drivers to be
  349.   compiled as modules, you must also do a `make modules'.
  350.  
  351.   Now, you can compile ftape for you new kernel (there is no need to
  352.   reboot your first).
  353.  
  354.                # cd /usr/src/ftape-2.08
  355.  
  356.   There are a few options that you can tinker with in the Makefile.
  357.   Most importantly, if you still use gcc v2.4.5 you must add
  358.   `-DGCC_2_4_5_BUG' to the `FTAPE_OPT' variable.  Also, if you have one
  359.   of Colorado's FC-10 or FC-20 controllers you must tell ftape this.
  360.  
  361.   4.3.  Following the development of the ftape driver
  362.  
  363.   If you want to follow the development of the ftape driver, you should
  364.   read the Usenet newsgroup linux.dev.tape.  This is really gatewayed
  365.   from the mailing list linux-tape@vger.rutgers.edu, but since vger is
  366.   brought to it's knees due to the load of the various Linux mailing
  367.   lists, I recommend everyone to read the newsgroup instead.
  368.  
  369.   If you are unable to read news, you can subscribe to the TAPE mailing
  370.   list by sending a mail saying `subscribe linux-tape' (in the body) to
  371.   majordomo@vger.rutgers.edu.  When you subscribe, you will be sent a
  372.   greeting mail, which will tell you how to submit real mails and how to
  373.   get off the list again.
  374.  
  375.   Please note that I do not, repeat DO NOT, have any special powers with
  376.   regard this mailing list.  If you're stuck on the list, don't bother
  377.   to tell me that.  I can only shrug and send you my sympathy (but that
  378.   won't get you off the list).
  379.  
  380.   4.4.  Can I format my tapes under Linux?
  381.  
  382.   No!  Ian Burrell has offered to work on this and has teamed up with
  383.   Steven Sorbom to work on this.  This is probably not just ``around the
  384.   corner'', so please be patient.
  385.  
  386.   Until formatting becomes available under Linux, you'll have to use
  387.   MessyDOS (arghhh!)  instead or buy preformatted tapes.  However, some
  388.   of the preformatted tapes are not checked for bad sectors!.  If the
  389.   ftape driver encounters a tape with no bad blocks, it will issue a
  390.   warning.  If ftape barfs at your preformatted tapes, try out your DOS
  391.   software.  If both the DOS software and ftape barfs on your tapes, a
  392.   reformat will very probably cure the problem.
  393.  
  394.   Note that to be able to use your newly formatted tapes under ftape,
  395.   you must erase the tape first:
  396.  
  397.                mt -f /dev/nftape erase
  398.  
  399.   4.5.  Which formatting programs can I use under DOS?
  400.  
  401.   These are known to work:
  402.  
  403.   ╖  Colorado Memory System's software (tape.exe)
  404.  
  405.   ╖  Conner Backup Basics v1.1 and all Windows versions
  406.  
  407.   ╖  Norton Backup
  408.  
  409.   ╖  QICstream version 2
  410.  
  411.   ╖  Tallgrass FileSecure v1.52
  412.  
  413.   ╖  Escom Powerstream 3.0 (qs3.exe -- QICstream v3?)
  414.  
  415.   These programs are known to be more or less buggy:
  416.  
  417.   ╖  Conner Backup Basics 1.0
  418.  
  419.   ╖  Colorado Windows tape program
  420.  
  421.   ╖  CP Backup (wastes tape space, but is OK apart from that)
  422.  
  423.   In fact, most software under DOS should work.  The Conner Backup
  424.   Basics v1.0 has a parameter off by one (someone could not read the
  425.   QIC-80 specs right!), which is corrected in version 1.1.  However,
  426.   ftape detects this, and will work around it.  Dennis T. Flaherty
  427.   (<dennisf@denix.elk.miles.com>) report that Conner C250MQ owners can
  428.   obtain the new v1.1, by calling Conner at 1-800-4Conner (in the US)
  429.   and ask for an upgrade (for a nominal fee for the floppy).  The
  430.   Windows versions should work fine.  Some versions of Colorado's tape
  431.   program for windows, has an off-by-one error in the number of
  432.   segments. ftape also detect and work around that bug.
  433.  
  434.   Central Point Backup can be used, but it wastes precious tape space
  435.   when it encounters a bad spot on the tape.
  436.   NOTE: If you are running a formatting software under DOS, which is not
  437.   mentioned here, please mail the relevant info to me
  438.   (<khp@dolphinics.no>), so I can update the list.
  439.  
  440.   4.6.  Mixing ftape and floppies
  441.  
  442.   Since both the floppy driver and ftape needs the FDC (and IRQ6), they
  443.   cannot run concurrently.  Thus, if you have mounted a floppy and then
  444.   try to access the tape drive, ftape will complain that it cannot grab
  445.   IRQ6 and then die.  This is especially a problem when designing a
  446.   emergency disk for use with ftape.  This solution is to either load
  447.   the boot/root disk into a ramdisk and then unmount the floppy, or have
  448.   two FDC's.
  449.  
  450.   5.  Hardware support
  451.  
  452.   5.1.  Supported tape drives
  453.  
  454.   All drives that are both QIC-117 compatible and one of the QIC-40, 80,
  455.   3010, and 3020 standards should work.  QIC-WIDE and Travan drives are
  456.   also supported (TR-1 is just QIC-80 with 8mm tapes, while TR-2 and
  457.   TR-3 is a.k.a QIC-3010 and 3020 respectively).
  458.  
  459.   Currently, the list of drives that are known to work with ftape is:
  460.  
  461.   ╖  Alloy Retriever 250
  462.  
  463.   ╖  Archive 5580i / XL9250i
  464.  
  465.   ╖  Colorado DJ-10 / DJ-20 (aka: Jumbo 120 / Jumbo 250)
  466.  
  467.   ╖  Colorado 1400
  468.  
  469.   ╖  HP Colorado T1000
  470.  
  471.   ╖  Conner C250MQ(T), TSM420R, TSM850R, TST800R, TST3200R
  472.  
  473.   ╖  Escom / Archive (Hornet) 31250Q
  474.  
  475.   ╖  Irwin 80SX / Insight 80Mb
  476.  
  477.   ╖  Iomega 250
  478.  
  479.   ╖  Iomega Ditto Tape Insider 420, 1700, 3200
  480.  
  481.   ╖  Mountain FS8000
  482.  
  483.   ╖  Reveal TB1400
  484.  
  485.   ╖  Summit SE 150 / SE 250
  486.  
  487.   ╖  Tallgrass FS300 (needs a tiny hack to work with AHA1542B)
  488.  
  489.   ╖  Memorex tape drive backup system
  490.  
  491.   ╖  Wangtek 3040F, 3080F
  492.  
  493.   You can always check out the newest list of drives that are recognised
  494.   by ftape, by looking in the file vendors.h in the ftape distribution.
  495.  
  496.   Although I do not want to endorse one drive type over another, I want
  497.   to mention that the Colorado DJ-20 drive is rather noisy, when
  498.   compared to, say, a Conner C250MQ drive ('tis said that the Colorado
  499.   is 5-10 times as noisy as the Conner drive. I can't tell for sure, but
  500.   I have a Colorado, and it is quite noisy).
  501.  
  502.   If you have a Tallgrass FS300 and an AHA1542B, you need to increase
  503.   the bus-on / bus-off time of the 1542B.  Antti Virjo
  504.   (<klanvi@uta.fi>), says that changing CMD_BUSON_TIME to 4 and
  505.   CMD_BUSOFF_CMD to 12 in linux/drivers/scsi/aha1542.c will do the
  506.   trick.
  507.  
  508.   NOTE: If you have a drive that works fine, but it is not listed here,
  509.   please send a mail to the HOWTO maintainer (<khp@dolphinics.no>).
  510.  
  511.   5.2.  Supported special controllers
  512.  
  513.   These dedicated high-speed tape controllers are supported by ftape:
  514.  
  515.   ╖  Colorado FC-10, FC-20
  516.  
  517.   ╖  Mountain MACH-2
  518.  
  519.   ╖  Iomega Tape Accelerator II
  520.  
  521.   ╖  2Mbps controllers (using the i82078-1 fdc)
  522.  
  523.   Support for the FC-10 controller has been merged into the ftape driver
  524.   in version 1.12. See the RELEASE-NOTES and the Makefile files in the
  525.   ftape distribution.  Since of version 2.03 of ftape, the FC-20
  526.   controller will work (but do check the Release notes!).
  527.  
  528.   The support for the MACH-2 controller was added in ftape-1.14d.
  529.  
  530.   To use the IOmega Tape Accelerator II, use -DMACH2, and set the right
  531.   settings for I/O base, IRQ and DMA.  This works (by the empirical
  532.   testing of Scott Bailey <sbailey@xcc.mc.xerox.com>), with at least
  533.   ftape-2.02.
  534.  
  535.   5.2.1.  Iomega Ditto Dash and other 2Mbps controllers
  536.  
  537.   The Iomega Ditto Dash, and all other known 2Mbps controllers, use the
  538.   Intel 82078-1 chip, which can run at 2Mbps.  Support for the 82078-1
  539.   is currently under development.  It is hoped that the support will be
  540.   completed during january or february.
  541.  
  542.   Current status is that it will work at 1Mbps, with 2Mbps support
  543.   coming soon (i hope!).
  544.  
  545.   5.3.  Un-supported tape drives
  546.  
  547.   ╖  All drives that connect to the parallel port (eg: Colorado Trakker)
  548.  
  549.   ╖  Irwin AX250L / Accutrak 250. (not a QIC-80 drive)
  550.  
  551.   ╖  IBM Internal Tape Backup Unit (identical to the Irwin AX250L drive)
  552.  
  553.   ╖  COREtape light
  554.  
  555.   Generally, ALL drives that connect to the parallel port are NOT
  556.   supported.  This is because these drives uses (different) proprietary
  557.   interfaces, that are very much different from the QIC-117 standard.
  558.  
  559.   The Irwin AX250L (and the IBM Internal Tape Backup Unit) does not work
  560.   the ftape.  This is because they only support QIC-117, but not the
  561.   QIC-80 standard (they use Irwin's proprietary ``servoe (Rhomat)''
  562.   format).  I know nothing about the Rhomat format, nor where to get any
  563.   info on it.  Sorry.
  564.  
  565.   The COREtape light does not accept the initialisation commands, we're
  566.   feeding it. This pretty much leaves the drive unusable.
  567.  
  568.   5.4.  Using an external tape drive with ftape
  569.  
  570.   If you have a floppy controller which has a female DB37 connector on
  571.   the bracket (and some means of delivering power to the drive), you can
  572.   use it with ftape.  OK, that sentence was not very obvious. Let's try
  573.   it this way: Some FDC's (the very ancient one's), have a DB37
  574.   connector on the bracket, for connecting to external floppy drives.
  575.  
  576.   If you make a suitable cable (from a quick glance on an FDC that I've
  577.   got lying around, it seems to be a straight 1-to-1 cable. However,
  578.   your milage may vary) from the DB37 connector (on the FDC) and to your
  579.   external tape drive, you can get ftape to control your tape drive.
  580.  
  581.   This is because that from a program's view there is no difference
  582.   between the internal and the external connectors. So, from ftape's
  583.   point of view, they are identical.
  584.  
  585.   ╖  Pins 20-37: GROUND
  586.  
  587.   ╖  1: +12 Volt (POWER)
  588.  
  589.   ╖  2: +12 Volt return (GROUND)
  590.  
  591.   ╖  3: +5 Volt return (GROUND)
  592.  
  593.   ╖  4: +5 Volt (POWER)
  594.  
  595.   ╖  5: 2
  596.  
  597.   ╖  6: 8
  598.  
  599.   ╖  7: 10
  600.  
  601.   ╖  8: 12
  602.  
  603.   ╖  9: 14
  604.  
  605.   ╖  10: 16
  606.  
  607.   ╖  11: 18
  608.  
  609.   ╖  12: 20
  610.  
  611.   ╖  13: 22
  612.  
  613.   ╖  14: 24
  614.  
  615.   ╖  15: 26
  616.  
  617.   ╖  16: 28
  618.  
  619.   ╖  17: 30
  620.  
  621.   ╖  18: 32
  622.  
  623.   ╖  19: 34
  624.  
  625.   The power connector is of the "mini" type, sitting on 3.5" floppy
  626.   drives.  As far as I can see on the board, the idea is that you plug
  627.   one of the power connectors from the PSU to this connector on the
  628.   board.  If you want to use just a single cable, I'd suggest that you
  629.   get a 50 wire cable, and use multiple wires for the power lines (and
  630.   ground, for that matter).
  631.  
  632.   5.5.  PCI motherboards and ftape
  633.  
  634.   Unfortunately, some PCI motherboards cause problems when running
  635.   ftape.  Some people have experienced that ftape would not run in a PCI
  636.   based box, but ran flawlessly in a normal ISA based 386DX machine.  If
  637.   you have such a problem, please read the README.PCI file in the ftape
  638.   distribution.
  639.  
  640.   6.  Backing up and restoring data
  641.  
  642.   This section describes some simple uses of tar and mt.
  643.  
  644.   6.1.  Writing an archive to a tape
  645.  
  646.   You can use `tar', `dd', `cpio', and `afio'. You will need to use `mt'
  647.   to get the full potential of your tapes and the ftape driver.  For a
  648.   start I'd recommend using `tar', as it can archive lots of directories
  649.   and let you pick out seperate files from an archive.  I have been told
  650.   that cpio creates smaller archives and is more flexible than tar, but
  651.   I haven't tried it myself.  `afio' creates backups where each file is
  652.   compressed individually and then concatenated.  This will allow you to
  653.   access the files ``after'' the point of the error.  If you use gzipped
  654.   tar files, all data after the point of the error is lost! (to me, this
  655.   is a pretty good reason for NOT using compression on backups).
  656.  
  657.   To make a backup of your kernel source tree using tar, do this
  658.   (assuming you have the sources in /usr/src/linux):
  659.  
  660.                cd /usr/src
  661.                tar cf /dev/ftape linux
  662.  
  663.   This will not compress the files, but gives you a smoother tape run.
  664.   If you want the compression (and you've got tar 1.11.2), you just
  665.   include the -z flag(*), eg: `tar czf /dev/ftape linux'
  666.  
  667.   For further instructions on how to use tar, dd and mt look at the man
  668.   pages and the texinfo files that comes with the respective
  669.   distributions.
  670.  
  671.   (*) tar assumes that the first argument is options, so the `-' is not
  672.   necessary, i.e. these two commands are the same: `tar xzf /dev/ftape'
  673.   and `tar -xzf /dev/ftape'
  674.  
  675.   6.2.  Restoring an archive
  676.  
  677.   OK, let us restore the backup of the kernel source you made in section
  678.   ``Writing an archive to a tape'' above.  To do this you simply say
  679.  
  680.                tar xf /dev/ftape
  681.  
  682.   If you used compression, you will have to say
  683.  
  684.                tar xzf /dev/ftape
  685.  
  686.   When you use compression, gzip will complain about trailing garbage
  687.   after the very end of the archive (and this will lead to a `broken
  688.   pipe' message).  This can be safely ignored.
  689.  
  690.   For the other utilities, please read the man page.
  691.  
  692.   6.3.  Testing the archive
  693.  
  694.   tar has an option (-d) for detecting differences between two archives.
  695.   To test your backup of the kernel source say
  696.  
  697.                tar df /dev/ftape
  698.  
  699.   If you do not have the man page for tar, you are not lost (yet); tar
  700.   has a builtin option list: try `tar --help 2>&1 | more'
  701.  
  702.   6.4.  Putting more than one tar file on a tape
  703.  
  704.   To put more than one tar file on a tape you must have the mt utility.
  705.   You will probably have it already, if you got one of the mainline
  706.   distributions, e.g.  Slackware or Debian.
  707.  
  708.   tar generates a single Tape ARchive (that's why it is called `tar')
  709.   and knows nothing about multiple files or positioning of a tape, it
  710.   just reads or writes from/to a device. mt knows everyting about moving
  711.   the tape back and forth, but nothing about reading the data off the
  712.   tape.  As you might have guessed, tar and mt in conjunction, does the
  713.   trick.
  714.  
  715.   By using the nrft[0-3] (nftape) device, you can use `mt' to position
  716.   the tape the correct place (`mt -f /dev/nftape fsf 2' means step over
  717.   two ``file marks'', i.e.  tar files) and then use tar to read or write
  718.   the relevant data.
  719.  
  720.   6.5.  Appending files to an archive
  721.  
  722.   ``Is there a way to extend an archive -- put a file on the tape, then
  723.   later, add more to the tape?''
  724.  
  725.   No. The tar documentation will tell you to use `tar -Ar', but it does
  726.   not work.  This is a limitation of the current ftape driver.
  727.  
  728.   6.6.  Mount/unmounting tapes
  729.  
  730.   Since a tape does not have a ``filesystem'' on it, you do not mount /
  731.   unmount the tape.  To backup, you just insert the tape and run your
  732.   `tar' command (or whatever you use to access the tape with).
  733.  
  734.   7.  Creating an emergency boot floppy for ftape
  735.  
  736.   This section was written by Claus T°ndering <ct@login.dknet.dk>.
  737.  
  738.   Once you are the happy owner of a tape drive and several tapes full of
  739.   backups, you will probably ask yourself this question: ``If everything
  740.   goes wrong, and I completely lose my hard disk, how do I restore my
  741.   files from tape?''
  742.  
  743.   What you need is an emergency floppy disk that contains enough files
  744.   to enable you to boot Linux and restore your hard disk from tape.
  745.  
  746.   The first thing you should do is to read ``The Linux Bootdisk HOWTO''
  747.   written by Graham Chapman <grahamc@zeta.org.au>.  That document tells
  748.   you almost everything you need to know about making an emergency
  749.   floppy boot kit.  The paragraphs below contain a few extra pieces of
  750.   information that will make your life a bit easier when you follow
  751.   Graham Chapman's procedures:
  752.  
  753.   ╖  You don't really need /etc/init, /etc/inittab, /etc/getty, and
  754.      /etc/rc.d/* on your floppy disk.  If Linux doesn't find /etc/init,
  755.      it will start /bin/sh on your console, which is fine for restoring
  756.      your system.  Deleting these files gives you extra space on your
  757.      floppy, which you will probably need.
  758.  
  759.   ╖  Find a small version of /bin/sh.  They are frequently available on
  760.      the boot floppies that come with a Linux distribution.  This again
  761.      will give you extra space.  I'd suggest ash, which is extremely
  762.      small (approx 62Kbytes), and yet very bash compatible.
  763.  
  764.   ╖  The /etc/fstab you include on your floppy disk should look
  765.      something like this:
  766.  
  767.                /dev/fd0        /               minix   defaults
  768.                none            /proc           proc    defaults
  769.                /dev/hda        /mnt            ext2    defaults
  770.  
  771.   Once you have booted from your floppy, give the command:
  772.  
  773.                mount -av
  774.  
  775.   ╖  Make sure your floppy drive is not mounted when you access the
  776.      streamer tape!  Otherwise you may get the following error message:
  777.  
  778.                Unable to grab IRQ6 for ftape driver
  779.  
  780.   This means that you MUST load the floppy into a RAMDISK.
  781.  
  782.   This has the unfortunate consequence that the programs needed to
  783.   restore the files from the tape can not be located on a separate
  784.   floppy disk.  You have two options here:
  785.  
  786.      1. You place tar (or cpio or afio or whatever other backup program
  787.         you use) on your root floppy disk.  (This is where you'll need
  788.         all the extra space created in the steps above.)
  789.  
  790.      2. Before you start restoring from tape, copy tar (or cpio or afio
  791.         or whatever) to your hard disk and load it from there.
  792.  
  793.   ╖  Apart from your backup program, you will probably need mt on your
  794.      root floppy as well.
  795.  
  796.   ╖  Make sure your ftape device (typically /dev/nrft0) is present on
  797.      your boot floppy.
  798.  
  799.   ╖  Finally: TRY IT OUT! Of course, I don't recommend that you destroy
  800.      your hard disk contents to see if you are able to restore
  801.      everything.  What I do recommend, however, is that you try booting
  802.      from your emergency disks and make sure that you can at least make
  803.      a file listing of the contents of your backup tape.
  804.   8.  Frequently Asked Questions
  805.  
  806.   This is a collection of questions I get asked once in a while, which
  807.   could fall into the category of FAQ's.  If you feel that there is some
  808.   question that ought to be added to the list, please feel free to mail
  809.   me (but do include an answer, thanks!).
  810.  
  811.   8.1.  How fast is ftape?
  812.  
  813.   You can achieve quite respectable backup and restore speeds with
  814.   ftape: I have a Colorado DJ-20 and an Adaptec 1542CF controller, and
  815.   have measured a 4.25Mbyte/min sustained data transfer rate (no
  816.   compression) across a 70Mbyte tar archive, while comparing the archive
  817.   on the tape with data on my IDE disk.  The speed of ftape is mostly
  818.   dependent on the data transfer rate of your FDC: The AHA1542CF has a
  819.   ``post-1991 82077'' FDC, and it will push 1Mbit/sec at the tape drive.
  820.   If you have an FDC which can only deliver 500Kbit/sec data rates, you
  821.   will see half the transfer rate (well, roughly).
  822.  
  823.   8.2.  How do I change the trace-level?
  824.  
  825.   You can do this two ways: either change the default trace-level (the
  826.   var `tracing' in file `ftape-rw.c') and recompile or say
  827.  
  828.                mt -f /dev/ftape fsr <tracing-level>
  829.  
  830.   The use of the fsr command in mt is a hack, and will probably
  831.   disappear or change with time.
  832.  
  833.   8.3.  Can I exchange tapes with someone using DOS?
  834.  
  835.   No.  The DOS software conforms to the QIC-80 specs about the layout of
  836.   the DOS filesystem, and it should(?)  be a small problem to write a
  837.   program that can read/write the DOS format.  In fact, I'd bet that
  838.   creating a nice user interface would be a bigger problem.
  839.  
  840.   8.4.  How do I `....' with tar?
  841.  
  842.   These are really tar questions: Please read the man page and the info
  843.   page.  If you have not got it either, try `tar --help 2>&1 | more'.
  844.  
  845.   If your version of tar is v1.11.1 or earlier, consider upgrading to
  846.   v1.11.2 - This version can call GNU zip directly (i.e.: it supports
  847.   the -z option) and has an elaborate help included.  Also, it compiles
  848.   right out of the box on Linux.
  849.  
  850.   8.5.  ftape DMA transfers gives ECC errors
  851.  
  852.   Sadly to say there are some SVGA cards and ethernet cards that do not
  853.   decode their addresses correct.  This typically happens when the ftape
  854.   buffers are in the range 0x1a0000 to 0x1c0000.  Somehow, the DMA write
  855.   cycles get clobbered and every other byte written gets a bad value
  856.   (0xff).  These problems are reported to happen with both SVGA and
  857.   ethernet cards.  We know of at least one (bad?) ATI 16bit VGA card
  858.   that caused this.
  859.  
  860.   The easiest solution is to put the card in an 8bit slot (it is often
  861.   not enough to reconfigure the card to 8bit transfers).  Moving the
  862.   ftape buffer away from the VGA range is only a partial solution; All
  863.   DMA buffers used in Linux can have this problem!  Let us make this one
  864.   clear: This has nothing to do with the ftape software.
  865.  
  866.   8.6.  insmod says the kernel version is wrong
  867.  
  868.   The insmod program can check the kernel version against the version
  869.   that ftape was compiled for in two ways: It can directly compare the
  870.   kernel version number recorded in the ftape module against the version
  871.   of the running kernel, or, if both the kernel and ftape is compiled
  872.   with versioned symbols, compare the version of the used kernel
  873.   symbols.
  874.  
  875.   If you have upgraded your version of GCC to v2.7.0 or later, you must
  876.   recompile the modules utilities with gcc v2.7.x.
  877.  
  878.   Newer versions of insmod allows you to ``force'' insertion of a module
  879.   into the kernel, even though the version string is incorrect.
  880.  
  881.   8.7.  What is this versioned symbols stuff anyway?
  882.  
  883.   When you say `yes' to CONFIG_MODVERSIONS during `make config', all the
  884.   symbols exported by the kernel, i.e: the symbols that the loadable
  885.   modules can ``see'', are augmented to include a checksum across the
  886.   types of the call/return parameters.  This allows insmod to detect
  887.   whether the definition of a variable or function in the kernel has
  888.   changed since the time when ftape was compiled.
  889.  
  890.   This ensures a high degree of safety, such that you do not crash the
  891.   kernel because you used an outdated module with your kernel.
  892.  
  893.   8.8.  insmod says that kernel 1.2.0 and 1.2.0 differ
  894.  
  895.   Did you remember to aply the ksyms.c patch to the kernel?  If not, see
  896.   ``Quick guide to compiling the kernel'' above.
  897.  
  898.   8.9.  ftape says ``This tape has no 'Linux raw format'''
  899.  
  900.   You get this complaint if you haven't erased your freshly formatted
  901.   tape.  This is because ftape expect a ``magic header'' on the tape, to
  902.   be able that it is allowed to interpret the header segment in its own
  903.   way (eg: file marks).  To remove the problem, say `mt -f /dev/nftape
  904.   erase'
  905.  
  906.   8.10.  Where can I find the tar/mt/cpio/dd binaries/sources/manpages?
  907.  
  908.   All of these tools have been developed by the GNU project, and the
  909.   source (and man page) can be fetched from just-about any ftp site in
  910.   the world (including ftp.funet.fi, tsx-11.mit.edu, and
  911.   sunsite.unc.edu).  In any case they can be fetched from the official
  912.   GNU home site: prep.ai.mit.edu [18.71.0.38]:/pub/gnu.  The latest
  913.   versions (by 10. january 96) are:
  914.  
  915.                cpio:   2.4.1 (cpio-2.4.1.tar.gz)
  916.                dd:     3.12 (fileutils-3.12.tar.gz)
  917.                mt:     2.4.1 (cpio-2.4.1.tar.gz)
  918.                tar:    1.11.8 (tar-1.11.8.tar.gz)
  919.                gzip:   1.2.4 (gzip-1.2.4.tar.gz)
  920.  
  921.   They all compile out of the box on Linux v1.0.4 / libc v4.5.19 / gcc
  922.   v2.5.8.  There is a patch for mt included in the ftape distribution,
  923.   which makes the mt status command spew out usable information for
  924.   ftape drives.
  925.  
  926.   8.11.  Where can I obtain the QIC standards?
  927.  
  928.   If you wish to help developing ftape, or add some utility (e.g. a tape
  929.   formatting program), you will need that appropriate QIC standards.
  930.   The standard(s) to get is: QIC-80, -117, -3010, and 3020.  QIC-117
  931.   describes how commands are sent to the tape drive (including timing
  932.   etc), so you would probably never need it.  QIC-80/3010/3020 describes
  933.   higher level part, such as tape layout, ECC code, standard filesystem.
  934.   You can get the QIC standards from the following address:
  935.  
  936.        Quarter Inch Cartridge Drive Standards, Inc.
  937.        311 East Carrillo Street
  938.        Santa Barbara, California 93101
  939.        Phone: (805) 963-3853
  940.        Fax:   (805) 962-1541
  941.  
  942.   Note: They are registered as `Freeman Associates, Inc' in the phone
  943.   book.
  944.  
  945.   8.12.  What block-size should I use with tar
  946.  
  947.   When using compression, and in all general, it can be a benefit to
  948.   specify to tar, that it should block the output into chunks.  Since
  949.   ftape cuts things into 29Kbyte blocks, saying `-b58' should be
  950.   optimum.
  951.  
  952.   ``Why 29Kbyte?'', I hear you cry.  Well, the QIC-80 standard specifies
  953.   that all data should be protected by an Error Correcting Code (ECC)
  954.   code.  The code specified in the QIC-80 standard is known as a Reed-
  955.   Solomon (R-S) code.  The R-S code takes 29 data bytes and generates 3
  956.   parity bytes.  To increase the performance of the ECC code, the parity
  957.   bytes are generated across 29 1Kbyte sectors.  Thus, ftape takes
  958.   29Kbytes of data, adds 3Kbytes of ECC parity, and writes 32Kbytes to
  959.   the tape at a time.  For this reason, ftape will always read and write
  960.   32K byte blocks to be able to detect (and correct) data errors.
  961.  
  962.   If you are curious, and wish to know more, look in the ecc.c and ecc.h
  963.   files, for an explanation of the code and a reference to a textbook on
  964.   Reed-Solomon codes.
  965.  
  966.   8.13.  ftape detects more bad sectors than DOS on QIC-3020 tapes
  967.  
  968.   If you look at the difference, you will notice that ftape always
  969.   detects 2784 sectors more than DOS.
  970.  
  971.   The number that ftape reports is correct (of course :-). Each
  972.   correctly formatted QIC-3020 tape has 2784 sectors at fixed positions
  973.   that are marked in the bad sector map. To quote from the specs:
  974.  
  975.   ``Tracks 5,7,9,11,13,15,17,19,21,23,25 and 27 within 4 segments of
  976.   either EOT or BOT are prone to increased error rates due to hole
  977.   imprints.  Therefore, these regions shall be mapped as bad at format
  978.   time and entered in the bad sector map by indicating that all sectors
  979.   within the identified segments are bad.''
  980.  
  981.   This gives 12 tracks * 2 * 4 segments * 29 sectors == 2784 sectors.
  982.  
  983.   So ftape choose to report the real number of sectors that cannot be
  984.   used on the tape, while DOS gives a more optimistic number giving a
  985.   better indication of tape quality.  (ftape's behaviour might change in
  986.   the future to detect correct formatting and display the separate
  987.   numbers. It has rather low priority though).
  988.  
  989.   QIC-3010 are alike QIC-3020 tapes regarding this.
  990.  
  991.   9.  Debugging the ftape driver
  992.  
  993.   9.1.  The kernel/ftape crashes on me when I do `...' - is that a bug?
  994.  
  995.   No, that is a feature ;-)
  996.  
  997.   Seriously, reliable software do not crash.  Especially kernels do not
  998.   or rather should not crash.  If the kernel crashes upon you when you
  999.   are running ftape, and you can show that it is ftape that is messing
  1000.   things up, regard it as a Bug That Should Be Fixed.  Mail the details
  1001.   to the maintainer (<khp@dolphinics.no>) and to the tape list.
  1002.  
  1003.   9.2.  OK, it's a bug ...ehhh... feature - How do I submit a report?
  1004.  
  1005.   First, make sure you can reproduce the problem.  Spurious errors are a
  1006.   pain in the ass, since they are just about impossible to hunt down :-/
  1007.   This is a quick check list:
  1008.  
  1009.   ╖  Kernel version, and patches applied
  1010.  
  1011.   ╖  ftape version
  1012.  
  1013.   ╖  tape drive model / manufacturer
  1014.  
  1015.   ╖  Expansion bus type (EISA, ISA, PCI, or VL-bus)
  1016.  
  1017.   ╖  What you did to expose the problem
  1018.  
  1019.   ╖  What went wrong on your system.
  1020.  
  1021.   ╖  Do not delete the kernel and the ftape.o file. I might want you run
  1022.      try some patches out or run a different test on your system.
  1023.  
  1024.   Increase the tracing level to 7 (just below maximum tracing) and run
  1025.   the offending command again.  Get the tracing data from the kernel log
  1026.   or /proc/kmsg, depending on where you harvest your error messages.
  1027.   Try to look at what ftape spews out at you.  It may look in-
  1028.   comprehensible to you at first, but you can get valuable information
  1029.   from the logfile.  Most messages have a function name prepended, to
  1030.   make it easier to locate the problem.  Look through the source, don't
  1031.   just cry ``WOLF!'', without giving it a try.  If your version of the
  1032.   kernel (or ftape for that matter), is ``old'', when compared to the
  1033.   newest version of the kernel, try to get a newer (or even the newest)
  1034.   kernel and see if the problem goes away under the new kernel.  When
  1035.   you post your problem report, include the information about ftape
  1036.   version, kernel version, expansion bus type (ISA, VL-bus, PCI or
  1037.   EISA), bus speed, floppy controller, and tape drive.  State exactly
  1038.   what you did, and what happened on your system.  Some people have
  1039.   experienced that ftape would not run in a PCI based box, but ran
  1040.   flawlessly in a normal ISA based 386DX machine (see section ``Getting
  1041.   PCI motherboards to work with <tt>ftape</tt>'' on PCI machines above)
  1042.  
  1043.   Also, please think of the poor souls who actually pay the their
  1044.   Internet access (like me): avoid posting a (huge) log from the ftape
  1045.   run, without reason.  Instead, you could describe the problem, and
  1046.   offer to send the log to the interested parties.
  1047.  
  1048.   Send your bug report to <linux-tape@vger.rutgers.edu>. You might also
  1049.   want to mail the bug to <khp@dolphinics.no>.
  1050.  
  1051.