Case 7: Overwritten backup tape

This recovery scenario applies only to an overwritten header label. If the damage to the tape is more extensive than an overwritten label, the following recovery procedure will not work. Also, if the tape has been encrypted, there is similarly no way to recover it. If the tape cannot be recovered due to hardware problems related to the drive itself, consider sending it to your tape drive manufacturer for recovery. This scenario applies only to native tape; it will not work for the recovery of data from virtual tape.

If you have a duplex or a tape copy, perform a tape replace. You can reference this procedure in the TAPEREPL command: Replacing cartridge-type tape volumes with their alternate volumes.

In either case, route the recovery assistance through IBM® Support Center. Open a software problem report to diagnose the root cause of the damage, if it is not known.

When you open a problem record, you should be aware of the following information:

  1. Specific failure indications—full message text of any related message issued
  2. Type of drives
  3. Microcode levels for the drive and controller
  4. Reasonably available history for the tape
  5. Pervasiveness of the problem
  6. Attempted recovery actions taken–RECALL, RECYCLE, DELVOL, and so forth.
  7. Customers should gather the following information when the problem arises:
    • List TTOC of the affected volume
    • Library Manager Log for an ATL
    • CTRACE (if already writing to an external writer)
    • SYSLOG
    • DFSMShsm PDA trace
    • A dump on the failure if it can be trapped using a slip (for example, ABEND637).

The main reason for this type of damage is that the wrong tape volume gets mounted to satisfy a mount request for a scratch tape. The problem typically remains undiscovered unless you need the overwritten tape volume to recover a data set.

Use the following recovery procedure to restore access to DFSMShsm data on single-file-format backup tapes that were partially overwritten by user data.

  1. Copy the user data to a safe place.

    (This step is optional.) If the user data that was written over the DFSMShsm data is wanted, you will need to create a copy of that data. The damaged tape volume will be returned to scratch or to DFSMShsm for its later use, and the user data that was written on this volume will be lost at the end of this procedure.

  2. Reinitialize the damaged tape volume.

    Reinitialize the tape volume with the data set name that is used by DFSMShsm for all of its tape volumes. Write a dummy data set with the first file on the volume named as below:

    prefix.BACKTAPE.DATASET

    The prefix is one of the following:
    • The backup prefix as specified on the SETSYS BACKUPPREFIX command
    • The UID if prefixes are not specified with the SETSYS commands

    This step will create a good tape label on the damaged tape. Once the tape label is valid, the volume can be processed by RECYCLE in step 5 of this procedure.

    IEBGENER can be used to perform the reinitialization task.

    The sample JCL that follows can be used for a damaged backup volume. Modify the JCL to fit your needs by doing the following tasks:
    • Change the VOL=SER parameter, as needed.
    • Change the prefix, as needed.
    Included in the example that follows are the various messages that are generated from this job and the appropriate replies.
    //GENR     JOB
    //STEP1    EXEC PGM=IEBGENER
    //SYSUT1   DD DUMMY,LRECL=16384,BLKSIZE=16384,RECFM=F
    //SYSUT2   DD DISP=(NEW,KEEP),DCB=*.SYSUT1,UNIT=?3480,
    //            DSN=prefix.BACKTAPE.DATASET,VOL=SER=?ml2volser
    //SYSPRINT DD SYSOUT=*
    //SYSIN    DD DUMMY
    /*
                          J E S 2  J O B  L O G
    
     JOB09371  $HASP373 HAMMERTA STARTED - INIT 3 - CLASS A - SYS ..
     JOB09371 *IEF233A M 5A8,HAMMRT,,HAMMERTA,STEP1
     JOB09371  IEC512I LBL ERR 5A8,SMFDMP,SL,HAMMRT,SL,HAMMERTA,STEP1
     JOB09371 *IEC507D E 5A8,SMFDMP,HAMMERTA,STEP1,DMP.T241T240.DATA
     JOB09371  IEC507D REPLY 'U'-USE OR 'M'-UNLOAD
     JOB09371  R 78,U
     JOB09371 *IEC534D A 5A8,SMFDMP,SL,HAMMERTA,STEP1
     JOB09371  IEC534D REPLY 'U'-USE OR 'M'-UNLOAD
     JOB09371  R 84,U
     JOB09371 *IEC704A L 5A8,HAMMRT,SL,NOCOMP,HAMMERTA,STEP1
     JOB09371  IEC704A REPLY 'VOLSER,OWNER INFORMATION','M'OR'U'
     JOB09371  R 87,'HAMMRT,DFSMSHSM'
     JOB09371  IEC705I TAPE ON 5A8,HAMMRT,SL,NOCOMP,HAMMERTA,STEP1
     JOB09371  IEF234E K 5A8,HAMMRT,PVT,HAMMERTA,STEP1
     JOB09371  HAMMERTA STEP1  : 00:17:30/ 00:00:00/    53 - R000
     JOB09371  $HASP395 HAMMERTA ENDED
  3. Determine if the first data set on the damaged tape volume spanned from another volume.

    Issue the LIST TTOC(volser) ODS(dsname) command to determine if your damaged tape volume is associated with a previous tape volume. If your damaged tape is associated with a previous tape, it will be listed under the heading “PREV VOL.” When there is a previous tape, it means that the first data set on your damaged tape began on the previous tape.

    To verify whether your damaged tape is associated with a previous tape, issue the LIST TTOC(prev_volser) command and check to see that the last data set name on the previous tape is the same as the first data set name on your damaged tape.

  4. Delete the first data set on your damaged tape volume if it spanned from a previous volume.
    Issue the following command:
    BDELETE dsn VERSIONS(n)
    The original data set name and the backup generation number will be required. To get this information, issue the FIXCDS command to display the MCC record for the backup version. The backup version generation number is a 2-byte field contained in the MCCGEN field at offset X'46' in the FIXCDS display output. For example, issuing the following command:
    HSEND FIXCDS C DFHSM.BACK.T500718.TONY3.AHRENS.I3006
    gives you the following results:
     MCH=  01602400 A6F7B92B F4BBC221 A6DAB593 9C8BBA03
     *     7  4 B                     *
     +000  E3D6D5E8 F34BC1C8 D9C5D5E2 4BC2C3C4 E2404040 40404040 40404040 40404040
     *TONY3.AHRENS.DATA               *
     +020  40404040 40404040 40404040 E7E8E9F9 F0F50003 78048081 18075106 0093006F
     *            XYZ905              *
     +040  00081000 0000001C 000004DD 0121C0E2 0000243C 00003060 0000E3D6
    D5E8F0F5
                              .
                              .
    The following patch command causes DFSMShsm to re-drive the POINT MACRO up to ten times when an I/O error is encountered during recycle in order to recover data from a tape that has been overwritten and contains valid DFSMShsm data beyond the tape marks created by the overwrite.
    HSEND PATCH .MCVT.+267 X'0A' VERIFY(.MCVT.+267 X'00')  
    At the end of the recovery procedures, issue the following patch command to prevent the re-drive of the POINT Macro.
    HSEND PATCH .MCVT.+267 X'00' VERIFY(.MCVT.+267 X'0A')
    Issue the following command to show all versions of the data set if the tape spanned before BDELETE:
    LIST dsn

    The output gives you the original data set name: TONY3.AHRENS.BCDS and the version number: +040 00081000 000000 1C  000004DD

    The deletion would incorporate the information as follows:
    BDELETE DSN(TONY3.AHRENS.DATA) VERSION(28)
    Note: The version number gets converted from 1C to decimal (28).
  5. Depending on the type of error that you are recovering from, it may be necessary to run RECYCLE several times. Issue the following command:
    RECYCLE VOLUME(volser) EXECUTE
    This step should be repeated to ensure that all available data sets are moved without the use of the FORCE parameter of the RECYCLE command.
    Note: Readable, complete, and valid data sets are recycled to a new volume.
  6. Identify data sets that were overwritten.
    Build BACKDS commands for all the backup data sets that were overwritten and that are the most recent backup version. The following DFSORT job can identify and build the BACKDS commands for these data sets. This job only builds the BACKDS commands; it does not process them.
    99//BDSCMDS JOB
    //*******************************************************************
    //*PLEASE CHANGE ALL THE FOLLOWING TO THE APPROPRIATE VALUES:
    //*?USERID -TO YOUR USER ID
    //*?DFSMSHSM -TO THE DFSMSHSM PREFIX FOR YOUR BCDS
    //*?VLSER -TO THE VOLSER OF YOUR DAMAGED BACKUP VOLUME
    //*******************************************************************
    //*THIS STEP USES SORT UTILITY TO FIND ALL
    //*ASSOCIATED MCB AND MCC RECORDS,IDENTIFYING THE MOST RECENT
    //*BACKUP VERSION THAT WAS OVERWRITTEN ON THE DAMAGED BACKUP
    //*VOLUME.IT ALSO GENERATES THE BACKDS COMMANDS TO CREATE A
    //*NEW BACKUP VERSION.
    //*****************************************************************
    //STEP1 EXEC PGM=SORT,REGION=4096K
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DISP=SHR,DSN=?DFSMSHSM.BCDS,AMP='BUFND=50'
    //SORTOUT DD DISP=(NEW,CATLG),DSN=?USERID.BCDSSRT1,
    // UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE),
    // DCB=(LRECL=2048,BLKSIZE=0,RECFM=VB,DSORG=PS)
    //SYSIN DD *
     SORT FIELDS=(COPY)
     INCLUDE COND=(1,4,BI,GE,X'00C1')
    /*
    //STEP2 EXEC PGM=SORT,REGION=4096K
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DISP=SHR,DSN=?USERID.BCDSSRT1
    //SORTOUT DD DISP=(NEW,CATLG),DSN=?USERID.BCDSSRT2,
    // UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE),
    // DCB=(LRECL=2048,BLKSIZE=0,RECFM=VB,DSORG=PS)
    //SYSIN DD *
     SORT FIELDS=(COPY)
     INCLUDE COND=(51,1,BI,EQ,X'20')
     OUTREC FIELDS=(1,4,5,44,X,149,44,X'0001')
    /*
    //STEP3 EXEC PGM=SORT,REGION=4096K
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DISP=SHR,DSN=?USERID.BCDSSRT1
    //SORTOUT DD DISP=(MOD,CATLG),DSN=?USERID.BCDSSRT2
    //SYSIN DD *
     SORT FIELDS=(COPY)
     INCLUDE COND=(51,1,BI,EQ,X'24',AND,113,6,CH,EQ,C'?VLSER')
     OUTREC FIELDS=(1,4,69,44,X,5,44,X'0001')
    /*
    //STEP4 EXEC PGM=SORT,REGION=4096K
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DISP=SHR,DSN=?USERID.BCDSSRT2
    //SORTOUT DD DISP=(NEW,CATLG),DSN=?USERID.MERGED.BCDS.RECORDS,
    // UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE),
    // DCB=(LRECL=255,BLKSIZE=0,RECFM=VB,DSORG=PS)
    //SYSIN DD *
     SORT FIELDS=(50,44,CH,A)
     SUM FIELDS=(94,2,BI)
    /*
    //STEP5 EXEC PGM=SORT,REGION=4096K
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DSN=?USERID.MERGED.BCDS.RECORDS,DISP=SHR
    //BKDSREC DD DSN=?USERID.BKDS.RECORDS,DISP=(NEW,CATLG),
    // DCB=(LRECL=255,BLKSIZE=0,RECFM=FB,DSORG=PS),
    // SPACE=(TRK,(5,1),RLSE),UNIT=SYSDA
    //*BUILD HSEND BACKDS COMMANDS.
    //******************************************************************
    //*THE INCLUDE STATEMENT SELECTS MCB RECORDS THAT CONTAIN
    //*THE VOLSER OF YOUR DAMAGED ML1 VOLUME.
    //*THE OUTREC STATEMENT BUILDS AN HSEND BACKDS COMMAND
    //*FOR EACH DATA SET FOUND.
    //******************************************************************
    //SYSIN DD *
     SORT FIELDS=(COPY)
     OUTFIL FNAMES=BKDSREC,
      INCLUDE=(94,2,BI,EQ,X'0002'),CONVERT,
      OUTREC=(C'HSEND BACKDS ',5,44,255:X)
    /*                                                                              
  7. Issue the DELVOL volser BACKUP(PURGE) command. The DELVOL ... (PURGE) command will perform the same functions as a RECYCLE ... FORCE command against the volume without causing a tape mount. The damaged backup tape volume will be deleted from DFSMShsm inventory and any other control records describing the contents of the volume. DFSMShsm deletes any association with a day in the backup cycle or with a set of spill backup volumes.
  8. Issue the BACKDS commands that were generated in step 6.
    Note: If you are backing up a data set (with the BACKDS command) that resides on an ML2 tape volume, you need to use the RECALL command to recall the data set before issuing the BACKDS command.