tar and ignite

Go to solution
Regular Advisor

tar and ignite

Hi people, I want to explain the scenario first. I just hooked up a tape library with a rp 7472. The ioscan for the tape looks like this.

# ioscan -fnkC tape
Class I H/W Path Driver S/W State H/W Type
tape 0 1/0/2/1/0.2.0 stape CLAIMED DEVICE H
P C5683A
tape 1 1/0/2/1/1.1.0 stape CLAIMED DEVICE H
P Ultrium 2-SCSI

I used the ultrium to take backups. First time I use /dev/rmt/1m to take a backup using tar, then I used /dev/rmt/1mb again for backup using tar. After that I used ignite /make_tape_recovery command specifying /dev/rmt/1mn. Now, what I wanted to ask was that what is the difference between using /dev/rmt/1m, /dev/rmt/1mb and /dev/rmt/1mn. I mean they are all part of the same tape. And I only inserted one litrium tape so whats happening here.???
And the other question Is that how do u clean what is on a particular tape, like lets say if I want to format every thing out of the litrium tape I used to take an ignite image and backups what should I do…..???
James A. Donovan
Honored Contributor

Re: tar and ignite

You can look at the section 7 man page for mt to get a description on the differences in the behaviours of each device.

# man 7 mt

mt(7) mt(7)

mt - magnetic tape interface and controls for stape and tape2

This entry describes the behavior of HP magnetic tape interfaces and
controls, including reel-to-reel, DDS, QIC, 8mm, and 3480 tape drives.
The files /dev/rmt/* refer to specific raw tape drives, and the
behavior of each given unit is specified in the major and minor
numbers of the device special file.

You don't need to reformat your tapes to put new information on them, just use the mt command to rewind them. Tehn use Ignite to rewrite them.
Remember, wherever you go, there you are...
Bill Hassell
Honored Contributor

Re: tar and ignite

The names of the device files are arbitrary but are created based on the characteristics of the device file's minor number. The command insf creates these device filenames, so here's a simple breakdown of the simplest filenames:

0 (or 1 or 2, etc) refers to the instance or order in which the device files were created. The first tape drive is 0 (zero), the next drive is 1, and so on.

m = the default and is (likely) short for magtape

So the very first tape is 0m. The rest of the characters refer to handling features:

b = Berkeley tape handling (without b, the tape is handled with AT&T rules)

n = no rewind at close of the device, subject to AT&T rules.

To get more details on a device file, you can decode the devicefile name using the lssf command as in:

lssf /dev/rmt/*

Don't ask me why there are several files with duplicate characteristics...that's just the way insf works.

Now when you write (tar) to 1m, the tape starts moving from whereever it was left. When the tar is complete, the tape is automatically rewound. When you then write to 0mn, the tar starts writing, then when finished, the tape has a tape mark written and then is left at that position. (I'll cover AT&T and Berkeley later).

Now Ignite/UX is smart enough to realize that a tape that is recorded with a boot image somewhere in the middle tape is useless, so Ignite/UX issues a rewind, then starts recording. NOTE: tar, cpio, even simple commands like cp do not issue rewind commands. So in your case, the first tar (probably) started at the beginning of the tape, then rewound. The second tar overwrote (and destroyed)) the previous tar backup and left the tape positioned at the end of the tar backup.

The Ignite/UX process rewound the tape and destroyed the tar you just finished. The device files do NOT represent separate parts of the tape...they only affect close and compression options. Note that fbackup is also a program that presumes nothing about the tape position and rewinds the tape before recording.

The default compression setting for the simple device files is on (called BEST in other device filenames). The AT&T and Berkeley handling are confusing at best. Suffice it to say that Berkely is the 'sane' method of handling the close of a file. To see the details, use the command:

man 7 mt

Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: tar and ignite

Almost forgot, how to clean off old data. For modern tape drives (DDS, DLT, Ultrium, AIT, etc), if you rewind the tape, then write anything on it (cat /etc/profile > /dev/rmt/0m), the old data is no longer available. What happens is that at the end of the write, a special end-of-data markere is written which the hardware cannot be made to skip over. So although there is data after this marker, you would have to hire a data recovery company (very expensive) to get to the old data.

Bill Hassell, sysadmin