home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / FTAPE / _FTAPE.TAR / usr / doc / ftape / Install-guide next >
Encoding:
Text File  |  1995-02-18  |  15.2 KB  |  425 lines

  1. ---------- Install-guide -- An installation guide ----------
  2.  
  3. Written by Bas Laarhoven (sjl) & Kai Harrekilde-Petersen.
  4. Last update: 30/12/94 by sjl, for ftape v2.00
  5.  
  6.  
  7. WHAT YOU NEED:
  8. ==============
  9.  
  10. 1)  the floppy tape driver distribution file `ftape-1.20.tar.gz'
  11.     (this file is a part of it).
  12.  
  13. 2)  the kernel sources for Linux 0.99pl14t or later. If you know
  14.     what you're doing you can use the driver with older kernel
  15.     versions, but you have to hack the ftape and modules support
  16.     in the kernel yourself!
  17.  
  18. 3)  modules utilities: `modutils-0.99.14.tar.gz' (or later).
  19.     [Note that the old ones still work even if you get a warning
  20.     saying you're using an old insmod and no symbols will be
  21.     inserted !]
  22.  
  23. 4)  tools like `mt' and `tar' to use the driver (these can be
  24.     found in the gnu cpio package).
  25.  
  26. (Of course, you also need a tape drive installed and the appropriate
  27. tools to compile the sources)
  28.  
  29.  
  30. INSTALLATION STEPS:
  31. ===================
  32.  
  33.   If it's the first time you install ftape, you'll want to start
  34. with these steps, otherwise proceed with step D.
  35.  
  36. A)  Compilation of the `modules' utilities.
  37. B)  Creation of the ftape devices.
  38. C)  Installation of syslog[dk] (not necessary, but rather useful).
  39.  
  40.   Installation of the ftape driver consists of two main steps:
  41.  
  42. D)  Reconfiguring the kernel for ftape support.
  43. E)  Compilation of the ftape driver proper.
  44. F)  Loading and testing the driver.
  45.  
  46.  
  47.   IMPORTANT: The version number of the running kernel must match
  48. the version of the sources in /usr/src/linux when ftape is built !
  49. [You may get all kind of weird errors if they aren't the same.]
  50.  
  51.  
  52. Step A) - Compilation of the `modules' utilities:
  53. -------------------------------------------------
  54.  
  55. [You can skip this step if you have a recent set of modutils ready]
  56.  
  57.   The modules utilities are in a separate package (see above) that
  58. contains the following three programs: lsmod, insmod and rmmod.
  59. After unpacking the sources in `/usr/src/modules' build these
  60. utilities:
  61.  
  62.     cd /usr/src/modules ; make
  63.  
  64.   Test the utils by saying (as root) 'insmod drv_hello.o' This results
  65. in a message like this (if you're running X, you wont see these
  66. messages):
  67.  
  68.     module `drv_hello' (1 pages @ 0x01023000) created
  69.     initializing module `drv_hello', 140 (0x8c) bytes
  70.       init entry @ 0x01023034, cleanup entry @ 0x01023074
  71.     drv_hello.c: init_module called
  72.     hello, world
  73.  
  74. Then do a 'lsmod'. This will result in something like:
  75.  
  76.     Module:        #pages:
  77.     drv_hello          1
  78.  
  79.   This means that everything worked out OK.  Now that drv_hello has
  80. served it's purpose, remove it again:
  81.  
  82.     rmmod drv_hello
  83.  
  84.   There seems to be a problem with recent tools. If you get the
  85. message `___moddi3 undefined' when loading the module with insmod I
  86. suggest you skip this excercise. It has relation with ftape.
  87.  
  88.   Install the *mod utilities somewhere handy, eg: in /sbin. [NOTE:
  89. it may NOT be a good idea to install them on a NON-root partition, as
  90. they may be needed in an emergency situation (restore after a system
  91. crash)]
  92.  
  93.     cp *mod /sbin
  94.  
  95.  
  96. Step B) - Creation of the ftape devices:
  97. ----------------------------------------
  98.  
  99. (You can skip this step if you already have these devices)
  100.  
  101. Check that you have the correct ftape devices:
  102.  
  103.     ls -lF /dev/*rft*
  104.  
  105. crw-rw-rw-   1 root      27,   4 Feb 20 13:01 /dev/nrft0
  106. crw-rw-rw-   1 root      27,   5 Feb 20 13:01 /dev/nrft1
  107. crw-rw-rw-   1 root      27,   6 Feb 20 13:01 /dev/nrft2
  108. crw-rw-rw-   1 root      27,   7 Feb 20 13:01 /dev/nrft3
  109. crw-rw-rw-   1 root      27,   0 Feb 20 13:01 /dev/rft0
  110. crw-rw-rw-   1 root      27,   1 Feb 20 13:01 /dev/rft1
  111. crw-rw-rw-   1 root      27,   2 Feb 20 13:01 /dev/rft2
  112. crw-rw-rw-   1 root      27,   3 Feb 20 13:01 /dev/rft3
  113.  
  114. If not, make them thus:
  115.  
  116.     mknod -m 666 /dev/rft0 c 27 0
  117.     mknod -m 666 /dev/rft1 c 27 1
  118.     mknod -m 666 /dev/rft2 c 27 2
  119.     mknod -m 666 /dev/rft3 c 27 3
  120.     mknod -m 666 /dev/nrft0 c 27 4
  121.     mknod -m 666 /dev/nrft1 c 27 5
  122.     mknod -m 666 /dev/nrft2 c 27 6
  123.     mknod -m 666 /dev/nrft3 c 27 7
  124.  
  125.   These are the raw floppy tape devices and non-rewinding raw floppy
  126. tape devices for drive selection methods A:,B:,C: and D:
  127.  
  128.   People used to the old naming convention may want to set up
  129. some symbolic links once the drive select is known:
  130.  
  131. lrwxrwxrwx   1 root            9 Feb 20 13:03 /dev/ftape -> /dev/rft0
  132. lrwxrwxrwx   1 root           10 Feb 20 13:03 /dev/nftape -> /dev/nrft0
  133.  
  134.  
  135. Step C) - Installation of syslog[dk]:
  136. -------------------------------------
  137.  
  138.   (This step is optional. Check first to see if syslogd and syslogk are
  139. already running).
  140.  
  141.   You'll want to capture the messages that ftape issues with syslogk or
  142. syslogd (NET-2 version).  If you don't have a syslog daemon running add
  143. the following to your rc.local file:
  144.  
  145.         if [ -x /etc/syslogk ] ; then
  146.                 syslogk on 2>&1 >>/var/log/kernel &
  147.         fi
  148.  
  149.   This will append the kernel messages to the file `/var/log/kernel'.
  150. (Make sure this file exists - do `touch /var/log/kernel' as root)
  151.  
  152.  
  153. Step D) - Reconfiguring the kernel for ftape support:
  154. -----------------------------------------------------
  155.  
  156.   If you don't have the proper kernel sources installed, do so now.
  157. The ftape driver needs access to some kernel source-files and searches
  158. the /usr/src/linux path. If you're sources are installed somewhere
  159. else you'll have to patch the driver or set up a symbolic link.
  160.  
  161.   Since the both the `modules' and `ftape' support are included with
  162. the standard kernel since 0.99pl14t, there is no longer a need for
  163. patching the kernel.
  164.  
  165.         cd /usr/src/linux ; make config
  166.  
  167.   Be sure to answer yes to 'QIC-117 tape support', and 3 for the
  168. NR_FTAPE_BUFFERS (unless you know what you're doing!). It is *not*
  169. necessary to include QIC-02 support for proper functioning
  170. (contrary to what has been said on the net).
  171.  
  172.     make dep ; make clean ; make
  173.  
  174.   Take a nap, read the newspaper or drink some tea / coffee while the
  175. kernel is being recompiled (this takes about 20 min on a 486DLC/33 box).
  176.  
  177.   Install the new kernel (keep the old one around, in case you can't
  178. boot with the new one) and reboot.
  179.  
  180.  
  181.   Assuming no errors occurred during the compile, we're now ready to
  182. compile the modules utilities.
  183.  
  184.  
  185. Step E) - Compilation of the ftape driver proper:
  186. -------------------------------------------------
  187.  
  188.   [The ftape module (as all modules) will only run with the kernel
  189. version it is compiled for. For ftape this is the kernel version
  190. running when compiling the driver ! This version *must* also match
  191. the sources in the directory /usr/src/linux.]
  192.  
  193.   Unpack the driver sources and enter the directory where they
  194. reside. Look in the Makefile for options with their descriptions.
  195. If you're using gcc 2.4.5 you'll *NEED* to set GCC_2_4_5_BUG, else
  196. the driver will fail !
  197.   Once all the options are set create the driver by:
  198.  
  199.     make clean ; make
  200.  
  201.   If you're using a kernel version 1.1.22 or earlier note that
  202. accessing the floppy drive at the same time as the tape drive will
  203. cause kernel panic. Later versions will prevent this problem: One
  204. cannot access the floppy drive while running ftape and vice versa.
  205.  
  206.  
  207.   There is a patch for the gnu version of mt (cpio-2.3) distributed
  208. with the driver. It makes the `mt status' command display usefull
  209. information. You might want to install this but it is not mandatory.
  210.  
  211.  
  212. Step F) - Loading and testing the driver:
  213. -----------------------------------------
  214.  
  215.   As said before, the `ftape.o' module will only run with the kernel
  216. version it's compiled on, if you get an error message saying that
  217. the kernel_version doesn't match the current kernel, remove the file
  218. kernel-version.h (or do a `make clean') and run `make' again. There
  219. should be *NO* warnings. *ALL* compiler warnings / errors should be
  220. investigated and reported.
  221.  
  222.   You'll need to be root to load the driver with insmod (specify the
  223. full path to insmod if it is not in the standard search path):
  224.  
  225.         su
  226.     insmod ftape.o
  227.  
  228.   This results in a similar message as when you installed the
  229. drv_hello.o module.  You'd probably like to catch the messages that
  230. ftape generates with a syslog daemon. Some other configurations may
  231. display them on the active console. See `Step D)' above for more. If
  232. everything went well you got a couple of lines including a copyright
  233. notice and some timing information.
  234.  
  235.   If you get any messages of the type `multiple definition of symbol
  236. ...' or `undefined symbol ...' something is wrong with either kernel
  237. sources or modules utilities. *** The kernel 1.1.0 is broken: get a
  238. later version ! ***
  239.  
  240.   You have to reload the driver *every* time you boot the system (Just
  241. as with the modules utilities, it's a good idea to have ftape.o on the
  242. root partition. The filesystem standard suggests somewhere under
  243. /boot). Instead of doing it by hand, you could include the following
  244. line in your /etc/rc.local:
  245.  
  246.     /sbin/insmod /boot/xxx/ftape.o
  247.  
  248.   Now put a tape in the drive and wait for the drive to stop making
  249. noise (Most tape drives start calibrating the head when a new tape
  250. is loaded.) Now try if the drive is recognized:
  251.  
  252.     mt -f /dev/rft0 rewind
  253.  
  254.   This will try to open the device. No tape motion will follow if the
  255. tape is already rewound.
  256.   Because initially `tracing' is set to some value greater than zero,
  257. some debugging output (printk) is generated on the console.
  258.  
  259.   The messages generated when opening the device can start with some
  260. "timeout on Acknowledge" lines.  This depends on the trace-level, and
  261. is normal as long as the driver is probing for a tape drive.  If they
  262. keep appearing after the device is opened something is wrong.
  263.  
  264.   If all goes well, messages will appear saying something about
  265. "drive-wakeup method: xxxx" and "tape drive type: yyyy". If not,
  266. "no tape drive found !" says that the driver cannot activate the drive.
  267. In this case you can try the other devices (rft1-rft3). In case they
  268. all fail the driver will not work with your drive.
  269.  
  270.   If some message appears with "unknown vendor id", follow the
  271. instructions in the message so I can include this information with a
  272. new release.  In the meantime the driver will function correctly if
  273. it is compatible with one of the known types.
  274.  
  275.   Now it's time to setup the symbolic link to the appropriate device
  276. or otherwise don't forget to substitute the correct device for the
  277. /dev/ftape used below.
  278.  
  279.   The next test verifies if the drive does respond to some simple
  280. commands:
  281.  
  282.     mt -f /dev/ftape reten
  283.  
  284.   The tape should wind completely to the end once and back to the
  285. beginning again. Depending on the tape used this may take a couple
  286. of minutes. If there are no error messages in the log everything is
  287. going fine.
  288.  
  289.   Now we are going to try to read some data from the tape.
  290. [Make sure a formatted tape is in the drive !]
  291.  
  292.         mt -f /dev/ftape fsf 0
  293.  
  294.   This causes the driver to read the header segment and display some
  295. information on the tape in the drive.
  296. `mt' may fail with an I/O error if the tape contains no file marks or
  297. if the operation failed otherwise. Look in the log messages for errors.
  298. This may indicate that you're using the wrong dma channel with an
  299. FC-10 controller or other special configuration.
  300.  
  301.   Now it's time to try the write operation. Put a formatted tape in
  302. the drive (write protect removed) and initialize the tape for usage
  303. with the ftape driver:
  304.  
  305.         mt -f /dev/ftape erase
  306.  
  307.   This command writes a Linux tape label so you can recognize the
  308. tape when using other operating systems, and it clears all file marks
  309. on the tape (No real erasure takes place, all data is still accessible).
  310. This command must be issued before file marks can be written to tape !
  311.  
  312.   At this point you're ready to use the driver to try a simple backup
  313. of the kernel sources. We'll be using gnu tar to write and verify the
  314. data:
  315.  
  316.         tar clvf /dev/ftape /usr/src/linux
  317.  
  318.   You'll see the file names coming by as the data is written to tape.
  319. If the operation succeeds without errors a verification can be done:
  320.  
  321.         ( cd / ; tar dvf /dev/ftape )
  322.  
  323.   The data on tape will be compared with the files on disk and any
  324. mismatches will be reported.
  325.  
  326.   At this point the driver seems to be cooperating with the tape drive
  327. and you'll have to determine the method you'll use to make the
  328. backups. Unix (and therefor Linux) has a lot of tools to do this and
  329. it is a matter of taste which you want to use.
  330. Some of the options are: cpio, tar, dd and dump/restore.
  331.  
  332.   One final warning: If you are using compression when writing data
  333. to tape (e.g. tar with the `z' option) you may not be able to recover
  334. anything if the tape gets damaged !
  335.  
  336.  
  337. A short introduction to file marks:
  338. ===================================
  339.  
  340.   File marks are written to tape to separate individual files (Note
  341. that one `tar' file may contain many data files!). So several
  342. files can be written to tape and individually retrieved.
  343.   The way ftape implements these file marks allows almost random
  344. access to individual files (instead of sequentially reading the
  345. entire tape until ones finds the right file mark).
  346.  
  347.   Every time the device is closed after writing some data two file
  348. marks are written to tape. If the non-rewinding device is used the
  349. tape is rewound so it is positioned right between these two marks.
  350.   If another file is written to tape the second marks is overwritten
  351. but the first stays causing succeeding files to be separated by
  352. exactly one file mark.
  353.  
  354.   The following should make this clear: After writing one file to the
  355. non-rewinding tape device the tape layout will be:
  356.  
  357.         <file-1> <eof> <eof>
  358.  
  359.   When another file is written the layout will be:
  360.  
  361.         <file 1> <eof> <file 2> <eof> <eof>
  362.  
  363.  
  364.   If we want to add another file to this tape after it has been
  365. rewound, there are to options: First to skip 2 file marks to position
  366. right between the last two marks. In this case we have to know how
  367. many files to skip.
  368.   The other solution is to seek for the double file mark and position
  369. in between. This is done with `mt eom'.
  370.   Remember to use the non-rewinding device when positioning the tape
  371. or it will be rewound when closing !
  372.  
  373.   Appending a file to a tape:
  374.  
  375.         mt -f /dev/nftape eom
  376.         tar cvf /dev/ftape <files>
  377.  
  378.   Reading the first and third files from tape:
  379.  
  380.         mt -f /dev/ftape rewind
  381.         tar xvf /dev/nftape
  382.         mt -f /dev/nftape fsf 2
  383.         tar xvf /dev/nftape
  384.  
  385.   The best way to understand what is happening is to picture the tape
  386. layout and count the file marks that have to be skipped.
  387.  
  388.  
  389. BTW: Keep in mind that file marks aren't written to tape until the
  390.      header segment is updated. For non-rewinding devices this will
  391. not happen automatically: Make sure that either the last write is to
  392. a rewinding device or issue an `mt rewind' or `mt rewoffl' to flush
  393. the buffers. The last command will put the drive offline until you
  394. reload the cartridge (or the driver). While the drive is offline all
  395. commands will fail.
  396.  
  397.  
  398. How to handle Panics or Oops with ftape-2.0 and up:
  399. ===================================================
  400.  
  401. Look in kernel log for 'init_module @ 0xXXXXXXXX' where XXXXXXXX
  402. stands for the address where init_module is loaded.
  403. Now the module offset can be calculated:
  404.  
  405.         nm ftape.o | grep init_module
  406.  
  407. results in something like:
  408.  
  409.         00000110 T _init_module
  410.  
  411. Subtract this value (00000110 or what it really reads) from the
  412. load address XXXXXXXX and you get the load offset.
  413.  
  414. When an oops or panic shows look for the value of the program
  415. counter:
  416.  
  417.         EIP:    0010:YYYYYYYY
  418.  
  419. You have to subtract the load offset from the EIP value
  420.  
  421. If you don't know how to subtract hexadecimal :-) make
  422. sure to mention all the above referenced values.
  423.  
  424. -------------------- end of the Install-guide ----------------------
  425.