Francesco Prelz, May 2, 1997
The easiest way to write tapes in compressed mode is through the Fermilab tape access product, FTT. The only drawback of this approach is that there is no FORTRAN callable programmer's interface for FTT. There is no data compression explicit support in the other Fermilab tape utilities, such as DAFT and RBIO. Here's a prototype example of how to set compression via FTT (FTT will automatically take care of choosing/configuring the correct device driver for a given compression setting):
#include "ftt.h"
ftt_descriptor fd_out;
int tape_dens, tape_cmp, tape_blksize;
fd_out = ftt_open("file_name",FTT_RDWR);
ftt_get_mode(fd_out, &tape_dens, &tape_cmp, &tape_blksize);
/* Set compression ON */
tape_cmp = 1;
ftt_set_mode(fd_out, tape_dens, tape_cmp, tape_blksize);
/* The above MUST be done before the tape is written
or otherwise accessed */
/dev/rmt/tps3d1
/dev/rmt/tps3d1.8200
/dev/rmt/tps3d1.8200c
/dev/rmt/tps3d1.8500
/dev/rmt/tps3d1.8500c
/dev/rmt/tps?d?.8500c device for
writing and write to it.
chdev command. The following command will change
the density code that is used for devices /dev/rmt0,
/dev/rmt0.1,/dev/rmt0.2/dev/rmt0.3:
chdev -l rmt0 -a density_set_1=140
140 is the density code for Exabyte 8500 compressed format. Other density
codes are 144 (8200 compressed format), 20 (8200 normal format), 21 (8500 normal
format). The chdev command usually has its permissions set
so that only the superuser can execute it.
If the Fermilab Tape Tools products (FTT) is installed on the system, the device driver density can also be set with the following command:
ftt_suid -d 140 /dev/rmt Or:
ftt_suid -d 140 /dev/rmt.5
The same density codes that are described above apply.
Again, there are two possible density settings. One affects
all devices from /dev/rmt0 to
/dev/rmt0.3 and the other one affects
all devices from /dev/rmt0.4 to
/dev/rmt0.7.
The tape drive will set the appropriate density mode when the device driver is opened and the tape is at the physical beginning (it has been just inserted or rewound).
/usr/sys/data/cam_data.c. Details are given below.
/dev/nrmt0m can be
used to write data in Exabyte 8200 compressed format, while
/dev/nrmt0a will write in 8500 compressed format.
The appropriate device, once again, needs to be opened when the tape is at the beginning (it has just been inserted or rewound).
WARNING: this procedure is rather complicated, and should be performed by a knowledgeable system administrator. Don't read on if you are not one.
In order to be able to write compressed tapes on an Alpha via
FTT, /usr/sys/data/cam_data.c needs to be
modified so that the device driver "minor" devices are
assigned as follows (This is not the current setup on e*831):
/*
The above fragment has to be inserted just before the "End density structures" comment
in
rmtXl is 2.3 GB format
rmtXh is 5.0 GB format
rmtXa is 2.3 GB format with compression
rmtXm is 5.0 GB format with compression
*/
exb8505_dens = {
{
{ /* Minor 00 or rmtXl */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_54000_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 01 or rmtXh */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_45434_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 02 or rmtXm */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
0x8c, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 03 or rmtXa */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
0x90, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 04 */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_45434_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 05 */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_45434_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 06 */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_45434_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
},
{ /* Minor 07 */
/* Flags */
DENS_VALID | DENS_BUF_VALID ,
/* Density code Compression code Speed setting */
SEQ_45434_BPI, NULL, NULL,
/* Buffered setting Blocking */
1, NULL
}
}
}; /* end of exb8505_dens */
/* End density structures.. Please extend the table
* for your own tape drives.. The table is designed
* to allow for flexibility and customer selections
*/
/usr/sys/data/cam_data.c. Also, the following device description
has to be added to the cam_devdesc_tab array (at the very end of the
/usr/sys/data/cam_data.c file).:
/* EXABYTE EXB-8505 */
{ "EXABYTE EXB-8505", 16, "EXB-8505",
(ALL_DTYPE_SEQUENTIAL << DTYPE_SHFT) | SZ_8MM_CLASS,
(struct pt_info *)ccmn_null_sizes, SZ_NO_BLK, 0x3c000,
&exb8505_dens, &exb8505_mod, SZ_NO_FLAGS,
NO_OPT_CMDS, 240, SZ_NO_QUE, DD_REQSNS_VAL | DD_INQ_VAL,
36, 64
},
This must be inserted just before the { 0 }.
After modifying the /usr/sys/data/cam_data.c as described,
the kernel needs to be rebuilt (doconfig), and
FTT needs to be rebuilt with the OSF1KERNELTABLES flag defined.
This should make the FTT prototype given at the top of this page work.
Comments about this page should be sent to Francesco Prelz