Restoring Files from a XenData Tape Cartridge Using Native Linux

 XenData Technical Note XTN903

July 10, 2009

Copyright 2007-2009 XenData Limited. All rights reserved.

Overview

XenData Archive Series software archives to data tape using the POSIX tar format. The name 'tar' is derived from 'tape archive' and it is the dominant industry standard for archiving files to data tape.  It has been used in the IT industry for decades and was developed in the early days of UNIX. Most UNIX and Linux operating systems are able to natively restore files that are written in the POSIX tar format. This means that files written to tape using a XenData archive system may be restored using a wide range of operating systems without need for any XenData software.

This technical note describes the steps involved when using Red Hat Linux to restore files from an LTO-4 tape cartridge, written using XenData Archive Series software.

Example Linux System Configuration Used for File Restores

The system configuration that was used to restore files written using XenData Archive Series software is illustrated below.

In our tests we used the following:

  • Server hardware: IBM x3655 server with LSI SAS3801X SAS host bus adapter

  • Server Operating System: Linux Red Hat v 5.3 64 bit with the mt-st-0.9b-2.2.2.x86_64.rpm package installed. The MT-ST package is required for tape drive access and control.

  • Tape drive: Dell LTO-4 external SAS (manufactured for Dell by IBM)

  • Tape cartridge: LTO-4 tape written on a Windows server using XenData Archive Series software

We checked to ensure that the tape drive was recognized by the Linux OS using the following command:

#cat /proc/scsi/scsi

We obtained the following output which confirmed that the tape drive was recognized:

Host:  scsi7  Channel:  00 Id:  00  Lun:  00

Vendor:  IBM       Model:  ULTRIUM-HH4      Rev:  8191

Type:       Sequential-Access                             ANSI SCSI revision:  03

We then checked the status of the drive using the following command;

#mt -f /dev/nst0 status

This resulted in the following output:

SCSI 2 tape drive:

File number=0, block number=0, partition=0

Tape block size 0 bytes.  Density code 0x46 (no translation).

Soft error count since last status=0

General status bits on (41010000):

BOT ONLINE IM_REP_EN

Example File Restore Procedure

We first created a directory for file restores and moved to that directory, as follows:

#mkdir  /tape

#cd /tape

We then calculated the blocking factor. This is the block size used to write to the tape in bytes divided by 512. In our case, a 64 KB block size had been used by the XenData software which meant that the blocking factor was 128.

The LTO-4 tape that we had inserted in the drive had a barcode X0002AL4. We created a file called 'X0002AL4.txt' that contained a list of the contents of the tape using the following command:

#tar --blocking-factor=128 -tf /dev/nst0 > X0002AL4.txt

Note if the blocking factor is incorrect, you will obtain an error message: 'Cannot read:  Cannot allocate memory'.

After the tape contents had been read, we rewound the tape:

#mt -f /dev/nst0 rewind

We viewed the contents file (X0002AL4.txt in our case) using gedit, as shown below:

The XenData software appends characters to the file name using the following convention.

-f-g-v

where

f is the file fragment number. (This is always 0 for non-fragmented files)

g is the generation number. (This is 0 for files unless a file of the same name and path has previously been deleted.)

v is the version number. (This is always 1 for the first version of a file.)

We then selected and restored a file (the first generation and first version of 0390.dat in the \archive\Repack testing\3000 3MB\ folder) using the following command:

#tar --blocking-factor=128 -xvf /dev/nst0 “0/archive/Repack testing/3000 3MB/0002/0390.dat-0-0-1”

The quotes must be used if the folder names contain spaces.  As this command will scan the whole tape looking for all files with this combination of folder and file name, a Ctl-C can be used to stop the process after the file has been restored.

We then restored all files on the tape using the following command:

#tar --blocking-factor=128 -xvf /dev/nst0

Concluding Comments

This technical note describes the steps that should be employed using the Red Hat Linux OS to restore files from a tape  written using XenData software. Of course, the restore process is not as convenient and straight forward as using XenData software. However, variants of Linux and UNIX capable of restoring POSIX tar files are likely to be available for decades to come, ensuring that tapes written using XenData Archive Series software may be restored using third party software for many years in the future.