Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Section - 1.200: Some info about tape backups

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]

Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: News Headers
Next Document: 1.201: How do I do remote backup?
See reader questions & answers on this topic! - Help others by sharing your knowledge

The following supplements the information on rmt devices in
InfoExplorer. It is based on my own personal experience with IBM tape
drives running on AIX 3.1. No warranty is expressed or implied.

    BLOCK size (0=variable length)		(ALL)
	Sets the tape block size.  When reading, the block size must be
	set to the block size set when the tape was written.  When
	using some commands, tapes written with ANY block size can be
	read if the block size is set to 0 (variable length) (see
	"BLOCK SIZES" below).

    Use DEVICE BUFFERS during writes		(ALL)
	Set to yes, the device will buffer data internally on writes.
	This greatly improves performance, but under certain cases may
	be undesirable since the data is not written to tape before
	returning a good indication.

    Use EXTENDED file marks			(8mm only)
	Extended file marks take up much more space than short (or
	non-extended) file marks.  But extended file marks can be
	overwritten, allowing data not at the beginning of tape to be
	overwritten (see "FILE MARKS" below).

    RETENSION on tape change or reset		(1/4" only)
	If set to "no" then the tape will not be retentioned
	automatically when the tape is inserted.  Note that this will
	take effect only after the device is used.

     Tape devices support multiple tape files.  Tape files are the
     result of a backup/cpio/tar/dd type command, where the device is
     opened, written to, and closed.  Because tapes allow large
     quantities of data to be written on a single tape, several backups
     (that is, tape files), may be combined on one physical tape.
     Between each tape file is a "tape file mark" or simply "file
     mark".  These file marks are used by the device driver to indicate
     where one tape file ends and another begins.

                              B       E
                   <-------   O       O   ------->
                              T       T
              __ ___________________________ ______________
     physical | \            |       |      \             |physical
     beginning|  \           | tape  |       \            | end
       of     |   \          | file  |        \           |  of
      tape    |    \         | mark  |         \          | tape
     Note that there is a distinction between the beginning of tape
     (BOT) side of a file mark and the end of tape (EOT) side of a file
     mark.  If the head is on the BOT side of a file- mark, "tctl fsf
     1" command will move only to the EOT side of the same file mark.

     With the 1/4" tape drive, writing can only take place
     sequentially, or after blank tape has been detected.  You cannot
     write over data on the tape (except at BOT).  If you wish to add
     data to a tape which has been written and then rewound you should
     space forward file mark until an error occurs.  Only then can
     you start writing again.

     With an 8mm tape drive, writing can only take place before blank
     tape, an EXTENDED file mark, or at BOT.  Thus if several backups
     have been made on one tape and you wish to overwrite one of the
     backups, position the tape to the place you wish to start writing
     and issue the following commands:
	tctl bsf 1
	tctl eof 1
     The first command skips back to the BOT side of the same file
     mark.  The second command rewrites the file mark (writing is
     allowed before extended file marks).  The erase head will erase
     data ahead of the write head, so that after writing the file mark
     the head will be positioned before blank tape.  Only after this
     may you start writing over data in the middle of the tape.  (All
     data beyond where you are currently writing will be lost).  Note
     that you cannot write over short file marks.  In order for this to
     work, the tape must have been written with extended file marks
     (use smit to change this).

     With the 9-track drive writing can take place anywhere on the
     tape although overwriting single blocks of data is not supported.

     On the 8mm drive extended filemarks use 2.2 megabytes of tape and
     can take up to 8.5 seconds to write.  Short filemarks use 184K
     and take up to 1.5 seconds to write.

     When data is written to tape it is written in blocks.  The blocks
     on a tape are separated by inter-record gaps.  It is important to
     understand the structure of the written tape in order to
     understand the problems which can occur with changing block

     In fixed block size mode all blocks on the tape are the same
     size.  They are the size of the block size set in the device
     configuration.  All read()s and write()s to the tape drive must be
     a multiple of the fixed block size.

     In fixed block mode a read() will return as many blocks as needed
     to satisfy the read() request.  If a file mark is encountered
     while reading the tape only the data up until the file mark will
     be returned.

     It is not possible for the tape drive to read a tape whose block
     size is not the same as the block size in the device
     configuration.  (Unless the device configuration is in variable
     size blocks.)

     In variable block size (0) mode, the blocks written on the tape
     are the size of the read() and write() requests to the device
     driver.  In this case, the actual block sizes on the tape can be
     changed using the options to the backup commands (tar -C, cpio -C,
     backup -C).

     In variable mode, read() requests greater than size of the block
     on the tape will return only the data from the next block on the
     tape.  It is this feature that allows tapes written in any block
     size (fixed or variable) to read with the dd command (the output
     from the dd command may be piped to restore, tar, or cpio for
     example.)  Note that backup, tar, and cpio cannot read all tapes
     by using a large block size because they assume there is an error
     if they get a short read().
		dd ibs=128k obs=16k if=/dev/rmt0 | ...

     The tape head is always positioned at an inter-record gap, file
     mark, or blank tape after reading or writing.

     With the 8mm tape drive, using a fixed block size which is not a
     multiple of 1K is inefficient.  The 8mm tape drive always writes
     internally in 1K blocks.  It simulates the effect of variable
     block sizes, but, for example, using a fixed block size of 512
     bytes (or using variable block size and write()ing 512 bytes at a
     time) wastes one half of the tape capacity and gives only one half
     the maximum transfer rate.

     To figure out a tape's actual block size try:

     1). Set the tape to variable block size.
     2). "dd if=<tape> of=/tmp/dummy bs=128k count=1"
     3). "ls -l /tmp/dummy"
     4). The number of bytes in "/tmp/dummy" is the physical block size.

     Many tape drives support both variable and fixed block sizes.

     Variable block mode writes block sizes the size of the write
     command issued (tar and backup specify this with the -b option). 
     In fixed mode, block sizes are fixed and all writes must be a
     multiple of the fixed block size.

     Unix often internally chops larger reads and writes up into
     manageable pieces (often 65535, 65534, or 65532 bytes) before
     doing the actual reads and writes.  This means reads and writes of
     64K bytes are often broken up into a 65535 byte record and a 1
     byte record (In fixed mode the write will fail).  Block sizes >=
     64K (-C128 and greater) should be avoided for this reason.  AIX
     does not break up read and write requests, but be aware of the
     situation on other machines.

     If the tape is written in an unknown block size then set the
     device configuration in smit to use variable size blocks, use the
     "dd" command with a large input block size, and pipe it to the
     restore command.  For example:
	  chdev -l rmt0 -a block_size=0
	  dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-

User Contributions:

Comment about this article, ask questions, or add new information about this topic:


Top Document: comp.unix.aix Frequently Asked Questions (Part 2 of 5)
Previous Document: News Headers
Next Document: 1.201: How do I do remote backup?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer: (Jose Pina Coelho)

Last Update March 27 2014 @ 02:11 PM