How to use the UNIX "dd" command to confirm a corrupt NetBackup media header

Article:TECH18639  |  Created: 2002-01-26  |  Updated: 2013-12-24  |  Article URL http://www.symantec.com/docs/TECH18639
Article Type
Technical Solution


Environment

Issue



How to use the UNIX "dd" command to confirm a corrupt NetBackup media header


Error



cannot read media header, may not be NetBackup media or is corrupted


Solution



The very first time a NetBackup tape is used (for either a normal backup or a catalog backup), a "media header" is written to the tape. This media header allows the NetBackup software to verify the tape's identity for future operations.
 
In rare circumstances, it is possible for this media header to get overwritten or become corrupt. A NetBackup tape with a corrupt header cannot be imported, although there is a tiny chance of extracting data from such a tape using the tar utility.
 
The UNIX dd command is a useful tool to examine and therefore confirm an overwritten or corrupt media header. Below are examples of using dd to extract a media header from a tape. (Note that there are two different media header formats used by NetBackup, one for normal backup media and one for catalog backup media)
 
In the examples below:
  • the tape NBUDB0 has been used for a NetBackup catalog backup of the NetBackup master server named "NBmaster"
  • the tape ABC123 has been used for a normal NetBackup backup
  • · ·
Examining the media header of a NetBackup catalog tape:
The NBU catalog media header is written in ASCII format, which means it is possible to simply 'cat' the header contents.
 
root@NBmaster# /usr/openv/volmgr/bin/tpreq -ev NBUDB0 -d 8mm -p NetBackup /tmp/tape
root@NBmaster#
root@NBmaster# mt -f /tmp/tape status
Exabyte EXB-8505 8mm Helical Scan tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
root@NBmaster#
root@NBmaster# dd if=/tmp/tape of=/tmp/db-header bs=1024 count=1
1+0 records in
1+0 records out
root@NBmaster#
root@NBmaster# /usr/openv/volmgr/bin/tpunmount /tmp/tape
root@NBmaster#
root@NBmaster# more /tmp/db-header
VERSION 1 UNCOMPRESSED
NBmaster
NBUDB0
02/26/02 01:07:11
32768
3
IMAGE1 = NBmaster:/usr/openv/netbackup/db
IMAGE2 = NBmaster:/usr/openv/volmgr/database
IMAGE3 = NBmaster:/usr/openv/var
 
Examining the media header of a normal NetBackup backup tape:
The NBU media header is written in binary format, which means the "od" command is necessary to read the header contents.
root@NBmaster# /usr/openv/volmgr/bin/tpreq -ev ABC123 -d 8mm -p Test_Pool /tmp/tape
root@NBmaster#
root@NBmaster# mt -f /tmp/tape status
Exabyte EXB-8505 8mm Helical Scan tape drive:
sense key(0x0)= No Additional Sense residual= 0 retries= 0
file no= 0 block no= 0
root@NBmaster#
root@NBmaster# dd if=/tmp/tape of=/tmp/nbu-header bs=1024 count=1
1+0 records in
1+0 records out
root@NBmaster#
root@NBmaster# /usr/openv/volmgr/bin/tpunmount /tmp/tape
root@NBmaster# cat /tmp/nbu-header | od -c
0000000 V O L 1 A B C 1 2 3 \0 \0 \0 \0 \0 \0
0000020 \0 \0 \0 \0 \0 \0 \0 001 \0 \0 \0 \r < t 017 325
0000040 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000060 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 013
0000100 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 004 \0 \0 \0 \0 \0
0000120 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0000160 T h I s I s A B P t A p
0000200 E h E a D e r \0 \0 \0 \0 \0 \0 \0 \0
0000220 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0002000
0002000



Legacy ID



245081


Article URL http://www.symantec.com/docs/TECH18639


Terms of use for this information are found in Legal Notices