Positioning the Tape or Floppy Disk

This topic discusses commands used to position, rewind and advance the backup medium (physical tape or sectored floppy disk) to specific data blocks or to an EOD (End-Of-Data) or EOF (End-Of-File) mark.

The EOD mark is indicated differently on tape and floppy disk. For 1/4-inch tape, 4mm DAT and 8mm tape, EOD is indicated by a blank section of the tape. For floppy disk, a pair of EOF marks is used; the floppy disk will be positioned after the first of these EOF marks.

There is an important difference between tape drives. 1/4-inch tape drives cannot back up one record or file at a time, 8mm tape drives, DAT, and floppy drives can. When using a 1/4-inch tape, you must rewind the tape to the beginning and then position the tape by moving forward.

When a file is written to tape, an EOF mark is written after the end of the last tape record used by the file. To locate a particular file on tape, you position the tape just after the EOF preceding the specified file.

The T-REW command rewinds a tape to the load point (BOT).

The T-FWD command advances a specified number of tape records or to the End-Of-File mark. The T-FWD command advances a specified number of tape records or to the End-Of-File mark. If an End-Of-File mark is encountered before passing the specified number of records, or if record is not specified, the tape is positioned after the first End-Of-File mark.

T-RDLBL reads the tape and displays on the screen the reel number, block size, time, and date from when the tape was written, and a header text. Using the T-RDLBL command when a labelled tape is mounted sets the block size to the record length specified in the label. T-RDLBL, like T-READ, if not at a label, will rewind the tape.

The T-SPACE Proc spaces a tape forward over a specified number of files, and executes the T-RDLBL and T-FWD commands as many times as number specifies.

The T-EOD command moves a tape forward to the end of the recorded data. At the EOD mark, you can append new data to the tape.

The T-WEOF command writes an End-Of-File mark on the tape at the current position.

The T-BCK command is used to move the tape or floppy disk backward for a specified number of records or to a previous End-Of-File mark. On floppy drives, this operation is possible in RAW-OFF mode.

NOTE

T-BCK is not supported on 1/4-inch tape drives.

The figure below shows a sample layout of data on a cartridge tape. The contents of a file are stored in physical tape records. These records are of fixed length, specified as the block size when the tape is attached. If the contents of a file do not fill up the tape record, the record is padded to fill. If the contents of the file do not fit in a single tape record, then the file will span a second tape record.

See the figure below in relation the following example on how to position a tape head to the desired data. Keep in mind that 1/4-inch tape drives do not support back-up (in other words, they can not back up the tape one file or one record at a time). If the tape head has passed the desired file or record, the only way to position it at the desired place is by rewinding the tape and advancing forward. (On tape drives that support backing up, such as DAT, 8mm, and floppy, the tape can be backed up one file or record at a time.)

First, use T-REW to reposition the tape at the beginning and use the T-RDLBL command to examine the label of the first file on tape:

>T-REW

BLOCK SIZE:  16896

 

>T-RDLBL

BLOCK SIZE:  16896

L 4200 14:43:11  29 MAR 1993 ORDERS                    ~01

 

>

For example, this label identifies the ORDERS file. After executing the T-RDLBL command, the tape is positioned after the label. To be able to read the label of the next file on tape, you must advance the tape to the next EOF mark.

There are two ways to advance the tape:

  1. The T-SPACE command counts EOF marks to advance the tape past a specified number of files.

  2. The T-FWD command counts physical tape records to move forward a specified number of blocks.

Because the first file consists of only a single block of data, and the tape is positioned before the first block, you can use T-FWD to advance to the next EOF mark.

>T-FWD

BLOCK SIZE:  16896

[94]  END OF FILE

 

>T-RDLBL

BLOCK SIZE:  16896

L 4200 15:03:37  29 MAR 1994 CUSTOMERS                   ~01

 

>

T-RDLBL displays the label that identifies the CUSTOMERS file.

The T-FWD command moves ahead to the next tape record. If a file spans several tape records, you can advance the tape a record at a time or for a specified number of records using T-FWD. If a block size smaller than the default is specified, then it is more likely that a file will stored on tape in multiple tape records. If this is the case, you might find it easier to position the tape using the T-SPACE command, which is the same as a sequence of T-FWD commands.

T-SPACE is a Proc that executes T-RDLBL and T-FWD to move ahead by a specified number of files. In the following example, the tape is rewound, then the T-SPACE Proc is used to position the tape at the beginning of the second file.

>T-REW

BLOCK SIZE:  16896

>T-SPACE 1

BLOCK SIZE:  16896

BLOCK SIZE:  16896

L 4200 14:43:11  29 MAR 1994 ORDERS                     ~01

BLOCK SIZE:  16896

 

>

The T-SPACE Proc displays the label of the file that it passes over. The tape is now positioned at the beginning of the CUSTOMERS file. Use T-LOAD to restore items from the tape file.

Before continuing, detach the tape drive from the process and remove the tape cartridge from the drive.

See Also

Using mvBase Tape Units