home *** CD-ROM | disk | FTP | other *** search
- This section of the BTN documentation describes the basic techniques
- for using your tape drive with BTN.
-
- **** BTNtape: an AmigaDOS handler for SCSI tape drives
- **** Version 3.0 3/14/94
- **** Freeware by Bob Rethemeyer (drBob@cup.portal.com)
- **** (c) Copyright 1990, 1994 Robert Rethemeyer.
-
- CONTENTS
- Tape file names
- How to access tape data
- Using TAR for backups and restores
- Helpful hints
- Fine tuning
-
-
- TAPE FILE NAMES
-
- BTN is compatible with AmigaDOS because you can use the name "TAPE:"
- (or whatever) in most instances where a file or path name is required.
- You CANNOT refer to files on the tape as "TAPE:filename", because
- BTN does not support a file system. But BTN does use some
- characters to the right of the colon to determine access modes.
-
- Refer to the tape with one of the following file name forms:
-
- TAPE:R Rewinds and opens the tape at the first available block.
-
- TAPE:NR Opens the tape at the current position, without rewinding.
- TAPE:* Same as TAPE:NR (but doesn't work with some shells or commands)
-
- TAPE: Same as TAPE:R or TAPE:NR, depending on NR startup parameter.
-
- TAPE:APP Opens the tape after the end of the last-written file, to
- allow you to append a file to a tape with existing files.
- This mode is allowed only for writes (but not on 3M MCD-40 drives).
- Some drives do not support this function; in that case, BTN
- will resort to a slower method which searches for a blank spot.
-
- TAPE:END Same as TAPE:APP, for use with the file number tracking feature.
- Unfortunately, this append mode may be slower than TAPE:APP.
- See "FILE NUMBER TRACKING" section in features.doc.
-
- TAPE:num Opens the tape at the position specified by the number.
- For sequential drives, the number indicates the file position,
- and may be used only for reading data from the tape (no writes).
- TAPE:0 is the first file on the tape, TAPE:1 is the second file,
- etc. You can only read files that have been previously written.
- Files are separated by one or more filemarks (automatically written
- at the end of a write). For direct access (3M) drives, the number
- specifies an absolute SCSI block number on the tape. You should
- remember (write down) the first and last block number of each
- file on the tape, as reported by TAPEMON.
-
- TAPE:POS A special mode for reading the file number of the
- current tape position, not for accessing the tape medium.
- Returns a short string containing a decimal number.
- See "FILE NUMBER TRACKING" in features.doc.
-
- TAPE:RAWCMD A special mode for issuing a raw SCSI command, not for
- accessing the tape medium. See "RAW COMMAND INTERFACE" in features.doc.
-
- TAPE:MODESEL A special mode for writing mode-select data, not for
- accessing the tape medium. See "USER-SPECIFIED MODE SELECT"
- in features.doc.
-
-
- HOW TO ACCESS TAPE DATA
-
- Now that the handler is installed, how do you talk to it?
- You can use TAR, or your own application program, including ARexx.
- You can write data to the tape and later read it back in a manner
- similar to other files, using DOS calls to Open, Read, Write, Seek,
- and Close, or C library functions fopen, fread, fwrite, etc.
- You may even copy single files to and from the tape using a
- CLI COPY command: "COPY filename TAPE:" and "COPY TAPE: filename"
-
- The handler makes the tape data look like a sequential AmigaDOS file.
- There is no file system on the tape, but you may place multiple files
- on a tape by appending new files after the last-written file.
- The handler does not support mixed reads and writes. That is, you may
- do only Reads or only Writes, but not both.
-
- BTN now supports Seek() (thanks to Dennis J. Brueni),
- with the following restrictions:
- * Must be in fixed block mode (VB-0)
- * Must be opened for Read()s
- * Seeks relative to end-of-file are not allowed
- * Seeks relative to current-position or beginning-of-file are
- allowed provided that the net position change is:
- - forward from the current position
- - backward to the exact beginning of the file only,
- except if opened as TAPE:NR
-
- Tape data is written in quantities of "NB*BS" bytes. If a tape file
- ends before filling a block, the remainder of the block is filled with
- zeroes. Therefore, any program reading the tape must know when to
- stop reading data, otherwise it will read extraneous zeroes past the
- true end of the file. This is especially true of the CLI "COPY" command.
- TAR works because it essentially writes and interprets the tape data
- as its own little file system that includes the length of each file.
-
- When a tape file is closed in write mode, one or more filemarks
- (as determined by "FM") are written at the end of the file to
- delineate the file from subsequent files. (Sequential drives only).
-
-
- USING TAR FOR BACKUPS AND RESTORES
-
- For backups, I recommend the version of TAR ported by Jonathan Hue.
- It is available on Fish Disk 445 or various online sources.
- It is 33860 bytes long. Each TAR archive is written to the tape
- as a single file, terminated by a file mark (on sequential drives).
- NOTE: other versions of TAR, or other archiving programs may or may
- not work with BTNtape- I just haven't tried them.
-
- TAR will backup all directories, files, and subdirectories in the
- directory you specify, including the date, protection, and filenote
- attributes. The easiest way to do a backup is to CD to the desired
- directory or partition (e.g. "cd DH0:"), then...
-
- To make a backup archive with TAR : tar -cvf tape: .
- To add another at current position : tar -cvf tape:nr .
- To add another after last archive : tar -cvf tape:app .
- To restore files from archive : tar -xvf tape: *
- To restore a specific file : tar -xvf tape: path/filename
- To restore from archive at file 6 : tar -xvf tape:6 *
- To list the archive on the tape : tar -tvf tape:
- (this also tests archive integrity)
- To make an archive log : tar >logfile -tvf tape:
- To look at raw tape data : type tape: opt h
-
- TAR can also make backups using a list of files from another file.
- When you restore an individual file from an archive, provide the
- exact path and file name; these names are case sensitive.
- Refer to the TAR documentation for more information.
-
- You can also use BTN to read TAR tapes written on a Unix system.
- Even if the tape was written in variable block mode (on a drive which
- supports that mode), you can still read it using BTN, which (currently)
- only does fixed block mode. The trick is to set the block size (BS)
- to the same number of bytes per block as were written on the Unix side.
- This number is N*512, where N is the value of the TAR -b option,
- which is usually 20, so the typical BS value is 10240.
-
-
- HELPFUL HINTS:
-
- Label your tapes. Include the file number or block number
- of each file on a multi-file tape.
-
- After doing a backup, flip the write-protect tab on the cartridge.
- This helps prevent accidental erasures (like using TAR -c when you
- really wanted to do TAR -x). The AO and RO feature flags of BTN
- may also be useful.
-
- Try backing up and restoring a floppy before doing the
- same with your hard drive, to make sure the process works for you.
- For the same reason, make a HD backup to floppies first. Then
- if the tape restore fails, you have something to fall back on.
-
- This is obvious, right? Make sure you have a copy of the handler and
- TAR on an easily-accessible floppy. If the only copy you have is
- on your hard drive, you might find it difficult to restore
- from a tape backup after a disk wipe-out.
-
-
- FINE TUNING
-
- There are a few factors you can tweak to get good performance
- on your particular system. Good performance means the tape tends
- to run continuously for long periods of time and seldom has
- to stop and back up to get a running start at the next block.
- (On some drives, poor performance also results in a reduction of
- the amount of data you can write on the tape.)
- The tape may have to stop while TAR gets more data from the
- hard disk, but you can minimize it.
-
- The handler's NB parameter can be increased from 1 to
- some larger number as your memory allows. With more handler
- blocks, a larger quantity of data is available to dump to the tape.
- But beyond a certain number of blocks, there is no further advantage.
-
- The TAR program also has a block parameter. It controls how much
- DOS data TAR collects before sending it to the handler. If you
- use many TAR blocks, it makes no sense to also use many handler
- blocks, since the data has to go through both buffers anyway.
-
- Other activities going on in other tasks may slow down the tape.
- Shut down non-essential programs that take CPU time or make
- lots of disk accesses.
-
- Using the TAPEMON program may slow down the handler slightly
- when it prints messages, but it's not really a problem.
- If you absolutely need maximum throughput, shut down TAPEMON.
-
-