KB Logo

TOLIS Group Knowledge Base

Browse KB by category:
Go to KB #:
Glossary
Email   Bookmark



How does BRU layout it's archives and catalogs on tape?

Views: 16067
Votes: 5
Posted: 02 Oct, 2007

TOLIS Group's BRU Tape and Catalog Layout

With the release of BRU Server and the retirement of BRU-Pro, all BRU products use the same basic tape layout. Whether you use BRU Server, BRU's XBRU X11 Interface, or BRU LE on Mac OS X , all tapes will be created using the format described below.

As such, with a bit of scripting, you can gain access to a tape created by BRU LE, BRU PE, XBRU, or BRU Server with BRU from the command line making use of the QFA information contained within the catalog sets on the tape.

Additionally, understanding the tape layout will allow BRU users to manually restore data in the event that their BRU Server Server becomes unavailable.

As shown in the figure below, the BRU tape layout is basically 2 elements -

  • The Backup Set for a given job or system
  • The Catalog for that Backup Set
BRU Tape Layout:

BRU Server, BRU LE & BRU PE Tape Layout

Each of these segments is separated by a 'filemark' (FM) - a special block type on tape that allows the drive to move easily and quickly between data segments. A tape drive can search for filemarks without reading the intervening data blocks. This means that a DDS tape that normally moves at 1/2" per second can be sped up to 100" per second to make locating specific data segments 200 times faster than an equivalent read of the intervening data blocks.  The tape drive determines the end of data (EOD) by placing two filemarks just before the null space.

To access a specified segment, use mt to step to its starting point. For example, if you wanted to extract (restore) the data in the second backup set illustrated above, you would step over 2 filemarks with mt as in:


mt -f /dev/nst0 fsf 2
 

or on Mac OS X


tapectl -f ntape0 fsf 2
 

This will move the tape forward to the start of the 3rd data segment on the tape (BACKUP SET 2) leaving the tape positioned ready to read the data in that data segment.

If you are using a library (such as with BRU Server), use mtx or libctl to load the tape that you wish to access. To simplify access, you may choose to symlink the actual device node to /dev/changer:


ln -s /dev/sg1 /dev/changer
 

This will allow you to use mtx without the -f option:


mtx status
 

versus


mtx -f /dev/sg1 status
 

For information on using tapectl on Mac OS X, visit the "Controlling A Tape Library" KB article.

BRU's 10-v Output

If you would like to make use of QFA functionality, you may do this outside of BRU LE, XBRU, or BRU Server through some simple command line processes. When BRU Server, BRU LE, or XBRU tapes are created, BRU is run with level 10 verbosity (-vvvvvvvvvv). This is a special level that modifies the way BRU reports its operations as to be more easily processed by a wrapper program. The output from such a run will look like:


VL:c|d84|1|10|a1ff|0|0|3d4977a8|3d2daebc|3d2daebc|0|57|342||||/etc
 

The fields (separated by the "|" symbol) are defined as follows (all numbers are hexadecimal):

Field Num. From Example Above Description
1 VL:c Verbosity Line, mode is create
2 d84 Offset in KiloBytes within the archive for this file
3 1 Volume (tape) this is on (if multi-tape)
4 10 File Size
5 a1ff File Mode
6 0 UID
7 0 GID
8 3d4977a8 atime (access time)
9 3d2daebc ctime (change time)
10 3d2daebc mtime (modification time)
11 0 device type, or 0 if file
12 57 QFA block address on tape
13 342 Filesystem Device ID
14, 15, 16 null For future expansion
17 /etc File/path name (may contain any character)

BRU's 9-v Output (this is the format used for BRU PE Catalogs)

If you would like to make use of BRU's 9-v (-vvvvvvvvv) QFA functionality, you may do this outside of the BRU GUI using some simple command line processes. Like the 10-v output, this is a special level that modifies the way BRU reports its operations as to be more easily processed by a wrapper program. The output from such a run will look like:


VL:c|1019904|1|106496|3984|/Users/bruman/Agent/lzo.dll
 

The fields (separated by the "|" symbol) are defined as follows (all numbers are in decimal):

Field Num. From Example Above Description
1 VL:c Verbosity Line, mode is create
2 1019904 Offset within the archive for this file
3 1 Volume (tape) this is on (if multi-tape)
4 1016496 File Size (Bytes)
5 3984 QFA Tape Block Number
6 /Users/bruman/Agent/lzop.dll File path and name

Restore Example Using QFA

To set up a scenario, we have a tape with our entire system backed up via XBRU. We need to restore the /etc directory. Here are the steps we'll follow:

BRU Server User Note: Use mtx (Linux) or libctl (OS X) to load and unload the tapes in a library. Also, the path to execute BRU is /usr/local/bru-server/bru.

1. Restore the catalog for our backup set

mt -f /dev/nst0 rewind
mt -f /dev/nst0 fsf 2
bru -xvf /dev/nst0
(this will restore a file in the format of
/usr/tmp/BRUP3d4977f008d8
or /var/lib/brupro/tmp/BRUP3d4977f008d8
)

2. Examine the file to find our block location

Get the first entry:

#grep --binary-files=text \/etc /usr/tmp/BRUP3d4977f008d8 | head -1
VL:c|d84|1|10|a1ff|0|0|3d4977a8|3d2daebc|3d2daebc|0|57|342||||/etc
# examine fields 3 and 12 for the tape and block position
# field 3 (in this case) indicates that the data we are searching for
# is on the current volume (1). Next, change the the HEX value in field 12 to
# decimal for processing with mt and subtract 1 to ensure that we are on the
# BOT side of the data to restore:
printf "%d\n" 0x57
87
# position the tape to the correct block
mt -f /dev/nst0 seek 86 # ( 87 - 1 )

3. Restore the /etc directory

# restore the data
bru -xvf /dev/nst0 -QV /etc
/
/etc
/etc/a2ps.cfg
. . .
# rewind the tape
mt -f /dev/nst0 rewind

If you have any questions about this process, please contact TOLIS Group Technical Support.

Others in this Category
document How can appending multiple backups save tape?
document Information on FireWire Cables
document Big Endian vs. Little Endian. What does this mean?
document What does 'Connection Reset by Peer' mean?
document SAS versus Fibre Channel - Which do I choose?
» More Articles



RSS
Powered by KnowledgebasePublisher
Page Load Time: 0.043088 seconds / 43.088 milliseconds.
Page File Size: 38686 bytes.