Operating System - HP-UX
1837365 Members
3482 Online
110116 Solutions
New Discussion

pax: The archive is empty.

 
Lars Bylander
Frequent Advisor

pax: The archive is empty.

On a 11i machine an Ultrium 448 tape drive is attached. A script writes to the same tape every day. The script basically contains the following commands:
---------------------------------------------
# First rewind tape and then find end of data
mt -f /dev/rmt/0mn rew
mt -f /dev/rmt/0mn eod

# Write to tape
pax -wv -f /dev/rmt/0mn filenames
---------------------------------------------

When listing the tape an empty archive appears in the beginning and between between each daily written archive:
$ mt -f /dev/rmt/0mn rew
$ pax -v -f /dev/rmt/0mn
pax: The archive is empty.

$ pax -v -f /dev/rmt/0mn
tape archive day x being listed...

$ pax -v -f /dev/rmt/0mn
pax: The archive is empty.

$ pax -v -f /dev/rmt/0mn
tape archive day x+1 being listed...

etc...

Is it ok that pax report the space between two archives as an empty archive?

The pax based script is used to backup data from a samba server, is the pax command a good choice for this purpose?

Lars Bylander
8 REPLIES 8
Muthukumar_5
Honored Contributor

Re: pax: The archive is empty.

pax will not support when file size is more than 2GB. May be you can with tar + update patch in largefiles environment.

Can you check with tar also with your steps? is there any difference.

-Muthu
Easy to suggest when don't know about the problem!
Lars Bylander
Frequent Advisor

Re: pax: The archive is empty.

Here is a listing using tar:

$ mt -f /dev/rmt/0mn rew

$ tar -tf /dev/rmt/0mn
Tar: blocksize = 0; broken pipe?

$ tar -tf /dev/rmt/0mn
tape archive day x being listed

$ tar -tf /dev/rmt/0mn
Tar: blocksize = 0; broken pipe?

$ tar -tf /dev/rmt/0mn
tape archive day x+1 being listed

-Lars
Arunvijai_4
Honored Contributor

Re: pax: The archive is empty.

Do you have PHCO_32438 installed on your machine ? It is the latest 11.11 pax(1) cumulative patch.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Lars Bylander
Frequent Advisor

Re: pax: The archive is empty.

Yes Arun, PHCO_32438 is installed./ Lars
Bill Hassell
Honored Contributor

Re: pax: The archive is empty.

This technique (appending to a tape) is a very unstable technique. The EOD option in the mt man page is ambiguous, stating that it seeks to the "end of data". This may mean: seek to the first tapemark (a separator created by closing a data transfer on the tape) or it may seek to the special marker created by the tape drive after writing is complete and the tape rewound or otherwise moved back towards the beginning. The mt command indicates that EOD is for DDS and QIC tape drives only and does not mention DLT or Ultrium.

Now all this is to preface the technique being used to append data. It might work but you'll have to map the appended archives very carefully. DO NOT use this technique for production until you've thoroughly tested the technique. The best way is to save a very short series of files, perhaps 3-4 text files, then append to the backup 3-4 times. Now test what is on the tape by doing a directory list using the no-rewind device. You may see that each backup set is followed by a null data block which is the separator between archives. Thusyou would have to position the tape forward one additional file mark (mt ... fsf).

For several decades, sysadmins have been trying to save tapes by appending backups to long tapes with disasterous results. While it may work for a while, a single mistake (ie, a user accidently writes to the beginning of multi-backup tape) will destroy *everything* on the tape. Modern tape drives (DDS, DLT, Ultrium, etc) write a hardware-generated code at the end of writing, regardless of where the tape is positioned. This is done to prevent despooling (run off the end of the tape) but is has a chilling effect on all backups, especially multiple appends: there is no way to position beyond the hardware marker!!

So the 20 backups appended to the tape are destroyed when someone forgets to position the tape and writes to the beginning. There is no command that will position the tape past this mistake. (actually, data recovery companies have special tape drives and programs to recover data, but they are very expensive services).

So to answer your last question, pax (and tar and cpio) can all be used to backup your data files. As manetioned, there are limits to the maximum filesize that can be saved (2Gb or 8Gb for patched tar). fbackup is the preferred non-commercial tool. fbackup explicitly prevents multiple backups on the same tape by always issuing a rewind from within the program.


Bill Hassell, sysadmin
Lars Bylander
Frequent Advisor

Re: pax: The archive is empty.

Bill, thank you for your valueable comments. I have done some testing by writing 3 short ascii files to the tape. Here is a summary:

Writing to the tape:
$ pax -wv -f /dev/rmt/0mn file1 file2 file3
$ pax -wv -f /dev/rmt/0mn file1 file2 file3
$ mt -f /dev/rmt/0mn rew
$ mt -f /dev/rmt/0mn eod
$ pax -wv -f /dev/rmt/0mn file1 file2 file3

Listing the tape contents:
$ mt -f /dev/rmt/0mn rew
$ pax -v -f /dev/rmt/0mn
file1 file2 file3
$ pax -v -f /dev/rmt/0mn
file1 file2 file3
$ pax -v -f /dev/rmt/0mn
pax: The archive is empty.
$ pax -v -f /dev/rmt/0mn
file1 file2 file3

It seems that it works appending archives to the tape. If the tape has been rewound and mt ... eod is executed before writing to the tape an empty archive will appear before the appended archive (as I previously reported).

I do not fullly understand the hardware written code concept? It must be possible to write over the hardware code to be able to reuse a tape writing more bytes the second time than the first time!

-Lars
Bill Hassell
Honored Contributor

Re: pax: The archive is empty.

The special hardware code is written at the end of the last write operation on the tape. You cannot read past this marker. You can position to the end of the last write and append more data. The reason that this hardware code is of concern is as I mentioned: someone writes something to the beginning of a multi-archive tape, then rewinds the tape. All data past the end of this mistake is now inaccessible. If you desparately needed to skip over the mistake and wanted to read the rest of the archives, it can't be done.

As you demonstrated, you can write an archve, then write another archive without rewinding, thereby appending to the tape. This can be done all at once or over several days. The hardware code only comes into play when you have, say 10 appended archives, a mistake is made and now there is a new archuve at the beginning of the tape. You can't skip past that new archive and see whatever is left of the 10 archives.


Bill Hassell, sysadmin
Lars Bylander
Frequent Advisor

Re: pax: The archive is empty.

Bill,

Thanks for the valueable comments, the hardware code is important to know about. I will have a script running once per day appending data to the tape. By having the script rewind and seek end of data misstakes writing over older archives are hopefully avoided. I will also carefully follow up that data is correctly appended to the tape. Thanks again - Lars