ftape-HOWTO
  Kai Harrekilde-Petersen, <khp@pip.dknet.dk>
  v1.3,	February 5th, 1995 for ftape-2.02

  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 the HOWTO's from sunsite.unc.edu:/pub/Linux/doc/HOWTO	(this is
  the ``official'' place) or via the web from the Linux	Documentation
  home page (http://sunsite.unc.edu/mdw/linux.hmtl).  You cannot rely on
  the HOWTO's being posted to comp.os.linux.announce, as some newsfeeds
  have complained about	their size.

  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


  This isn't exactly news, but anyway: the page	numbers	in the Table of
  Contents (which appear at least in the LaTeX'ed versions), are off-by
  one (ie: things appear one page later	than what the table of contents
  thinks.  I can't help	it).


     version 1.3 (Feb 5, 1995)

     o	New section on how to create an	emergency boot disk added
	(written by Claus Tondering, <ct@login.dknet.dk>).

     version 1.2 (Feb 2, 1995)


     o	IOmega Tape Accellerator II controller added.

     version 1.12 (Jan 16, 1995)

     o	Updated	to ftape-2.02.

     o	2.01a patch removed again :-)

     version 1.11 (Jan 15, 1995)

     o	Updated	to ftape-2.01a and included the	2.01a patch.

     version 1.1 (Jan 11, 1995)

     o	Corrected a typo in Antti's email address.

     o	Updated	to ftape-2.01

     o	List of	known drives expanded

     o	Added more about the QIC-3010/3020 (QIC-WIDE) support



  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
  channel (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	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's 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.
  Although it seems reasonable stable and reliable, it still changes
  relatively often. These changes are either because some bug as been
  unearthed, or	(what has happen a few times recently) because the
  modules interface in the Linux kernel	has changed.

  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. a DAT	drive.	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.	The newest version of ftape - and where	to get it


  The newest version of	the ftape driver is ftape-2.02,	which consists
  of ftape-2.02.tar.gz and ftape-lsm.  ftape can be fetched from the
  following sites:



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




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

  Newer	kernels	(from 1.1.85 and on), have improved support for	loadable
  modules (by Bjorn 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.1.87.tar.gz file.	It can be found	on
  tsx-11.mit.edu and sunsite.unc.edu: (on sunsite, it's	still in
  pub/Linux/Incoming).	You must compile and install it	before you
  compile the kernel.
  WARNING: ftape-1.14 does not work. You must upgrade to at least
  ftape-1.14a.

  Note that the	version	number of ftape	jumped from 1.14d directly to
  2.00.


  4.3.1.  Patches to ftape-2.02


  Around 1.1.85	of the Linux kernel, <linux/sched.h> stopped including
  the <linux/mm.h> file, which ftape needs.  Therefore,	you must add it
  to ftape.h by	hand.



       --- ftape.h.orig	       Mon Jan 23 22:44:22 1995
       +++ ftape.h     Mon Jan 23 22:05:48 1995
       @@ -31,6	+31,7 @@
	 */

	#include <linux/sched.h>
       +#include <linux/mm.h>

	#include "tracing.h"






  4.3.2.  Problems with	kernel version 1.1.5x


  During patchlevel 50 to 60, the floppy driver	got changed a few times.
  A some point,	the floppy driver forgot to release the	interrupt line
  (IRQ6).  This	would result in	that you could not use ftape and a
  floppy drive at the same time.  It also resulted in the if you tried
  to make a ``rescue disk'' (a very sensible thing), where you would
  boot from floppy and then restore from your backup tape, you
  experience that when you used	ftape, it would	say `unable to grab IRQ6
  for ftape driver'. No	fun.  The solution is to upgrade the kernel
  (v1.1.59 will	work).



  4.4.	If you have ftape-1.14a, or earlier


  There	have been fixed	some serious bugs in the driver	and you	should
  really consider to upgrade to	at least 1.14d.


  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 channel on Linux-activists.	To
  subscribe, you send a	mail to	<linux-activists-
  request@niksula.hut.fi>, with	the first line (or as a	part of	the
  header) saying `X-Mn-Admin: join TAPE'.  If you send an empty	mail you
  are sent a HOWTO mail.

  To submit a real mail	to the mailing lists, send a mail to <linux-
  activists@niksula.hut.fi>, and remember that the first line (or a
  header line) should read `X-Mn-Key: TAPE'.
  To get off the TAPE channel (:-(), send a mail to <linux-activists-
  request@niksula.hut.fi> with the line	`X-Mn-Admin: leave TAPE'

  There	is also	a TAPE mailing list on vger.rutgers.edu. 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.



  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.	Where to get the kernel	sources


  You can get the kernel sources from the same place as	you got	the
  ftape	sources.  The sources are kept at the following	sites (and many
  mirror-sites)



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




  You will find	a number of subdirectories, including two named	v1.0 and
  v1.1.	 These contain (you guessed it!) v1.0 and v1.1 of the kernel.  I
  suggest that you get version 1.1.<something>.



  4.8.	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. 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.9.	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

  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.10.	 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 (partly)

  o  Escom / Archive (Hornet) 31250Q

  o  Insight 80Mb

  o  Iomega 250

  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 the
  QIC-WIDE tapes, and you should consider it it	sheer luck that	the
  TSM420R works	at all with ftape (or any other	QIC-WIDE drive).
  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  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.

  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 it's 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 Tondering <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.



  8.5.	added The v1.1.0 kernel	wont compile when ftape	support	is


  (Although I haven't heard a lot of complains,	I include it here, just
  to be	sure)

  This was due to a typo (and a	hacker who didn't use ftape himself, so
  he never got around to actually test the code	he wrote).  This is
  corrected by patch1.gz, which	can be found from the usual ftp	sites.



  8.6.	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.7.	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.8.	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 Standars, Inc.
       311 East	Carrillo Street
       Santa Barbara, California 93101
       Phone: (805) 963-3852
       Fax:   (805) 962-1541





  8.9.	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 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, they an explanation of	the code and a reference to a textbook
  on Reed-Solomon codes.





  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-activists@niksula.hut.fi> (remember to
  add a	`X-Mn-Key: TAPE' line in the header).  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.


  9.5.	When I use /dev/nftape,	I get garbage ... why?


  This was a problem in	`the old days',	before version 0.9.10.
  Nowadays, the	non-rewinding devices are working.  If you have	anything
  earlier, I strongly recommend	you to update to (at least) the	1.14d
  version, preferably v2.02