Problem
How to use the UNIX "dd" command to confirm a corrupt NetBackup media header
Error Message
cannot read media header, may not be NetBackup media or is corrupted
Solution
The very first time a NetBackup tape is used 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.
Here is an example of using dd to extract a media header from a 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