Identifying an Unknown Tape Format


Contents

About this document
    Related documentation
Labeling
mksysb tapes
Block size determination
Sysback 6000 tapes
Standard archive tapes

About this document

This document describes how to examine a tape archive in an attempt to determine its archive type. Information in this document is valid for AIX 3.2.5 through 4.3.0.

Because there are many archive commands, each platform specific, and many syntaxes for each command, it is difficult to read an unlabeled tape. This document provides assistance in examining and determining if the archive tape is a "common" archive type and if the data is extractable.

NOTE: This document only addresses archives created and restored on an AIX machine using AIX commands. All other platforms, cross-platforms, or other command issues are not addressed in this document. For assistance, contact your AIX support center.

Related documentation

The product documentation library is also available:

http://www.rs6000.ibm.com/resource/


Labeling

Be sure to label the tapes with information about how they were created in order to restore them later. Some helpful things to include on the tape label are:


mksysb tapes

In AIX, one method of archiving the system volume group is to create a mksysb. The tape can be examined for the mksysb signature by doing the following:

  1. Change the device block size to 512. Enter:
        chdev -l rmt# -a block_size=512 
    
  2. Obtain information from the third image. Enter:
        tctl -f /dev/rmt#.1 fsf 2 
        dd if=/dev/rmt# bs=512 count=1 
    
  3. The following output should be displayed:
        DUMMY TAPE TOC 
    

    NOTE: If the above stated output is not displayed or if the tctl fails, this is NOT a mksysb tape.


Block size determination

To find the tape block size, complete the following steps:

  1. Configure the device for variable block size data:
        chdev -l rmt# -a block_size=0 
    
  2. Read a single block from the device and write the block to disk. This will show exactly how large the block is and what data is contained on the tape. Enter:
        dd if=/dev/rmt# of=/tmp/block bs=128k count=1 
    

    NOTE: Use bs=32k when using 1/4" tape drive. If it is still too big, use bs=16k.

  3. The data from the tape block is in the /tmp/block file. Determine the block size by looking at the byte count. Enter:
        wc -c /tmp/block 
    

    The size in bytes is the size of the physical blocks on the tape, assuming the tape was written with a single physical block size.

    This size can be used in the chdev command, chdev -l rmt# -a block_size=0 to configure the tape drive for the loaded tape.

  4. To determine the block size of the archive and avoid creating the temporary file, enter:
        dd if=/dv/rmt# bs=128k count=1 | wc -c 
    

Sysback 6000 tapes

In AIX, one method of archiving the system volume group and other volume groups is by using an add-on product called SYSBACK 6000. To examine the tape for the sysback signature, complete the steps outlined above for MKSYSB tapes, but instead of checking the output for:

    DUMMY TAPE TOC 

It should look like the following:

    DUMMY SYSBACK TOC 

NOTE: If the stated output is not displayed or if the tctl fails, this is NOT a SYSBACK 6000 tape.


Standard archive tapes

The following assumes the tape was created on an AIX system, using standard AIX archive commands, with only one image on the tape. For assistance with multiple images or archive types, contact your AIX support center.

  1. Update the magic file

    Each archive format contains a "signature". A listing of known AIX signatures has been compiled into the /etc/magic file. The following strings are the latest for all known AIX archive commands.

    NOTE: There are other signatures located in the /etc/magic file other than known AIX archive commands. Do not delete them; they will be used for other system purposes.

        257   string   ustar        tar archive 
        0     short    070707       BIN cpio archive 
        0     string   070707       ASCII cpio archive 
        0     long     0x09006bea   backbyname/restore format 
        2     long     0x0001332c   backbyinode/rdump/restore format 
        0     short    0x1f9d       compressed data 
        >2    byte     &0x80>0      block compressed 
    
  2. To extract a block of data, enter:
        chdev -l rmt# -a block_size=0 
        dd if=/dev/rmt# of=/tmp/block bs=128k count=1 
    
  3. To determine the block size of the block of data, enter:
        wc -c /tmp/block 
    
  4. To determine the format of the block of data, enter:
        file /tmp/block 
    

    NOTE: When this is run it returns an archive command. If the file command cannot determine the archive type, it displays the following:

        data or International Language text 
    
  5. Table of Contents

    Once it is determined what archive command was used to create the tape, an attempt to obtain a table of contents, or listing, of the archive can be made.

    WARNING: Do not immediately extract the data unless you are VERY certain of how it will be restored. Without obtaining a table of contents the existing data may be overwritten.

    1. Change the block size of the tape device to that listed on the tape by entering:
          chdev -l rmt# -a block_size=<bs from step in the previous section 3> 
      
    2. Using the archive command as obtained from step 4 in the section "Standard Archive Tapes", run the syntax for obtaining a table of contents.

      NOTE: For assistance with the correct syntax for the specific archive, contact your AIX support center.

    3. Some archive command table of content examples follow. Since it is not necessary to see the whole listing, the dd command will be used to limit the output to only 10 blocks.

      NOTE: Because of the 10 block limit, some error messages may be seen. The error messages may be ignored. If they are of concern, do NOT use the dd syntax.

      tar

          dd if=/dev/rmt# bs=<bs> count=10  | tar -tvf- 
      

      cpio (ASCII format)

          dd if=/dev/rmt# bs=<bs> count=10 | cpio -itcv 
      

      cpio (binary format)

          dd if=/dev/rmt# bs=<bs> count=10 | cpio -itv 
      

      backbyname

          dd if=/dev/rmt# bs=<bs> count=10 | restore -Tvqf- 
      

      backbyinode

          dd if=/dev/rmt# bs=<bs> count=10 | restore -tvqf- 
      

      rdump

          dd if=/dev/rmt# bs=<bs> count=10 | restore -tvqf 
      



[ Doc Ref: 90605225214684     Publish Date: Oct. 02, 2000     4FAX Ref: 8177 ]