SUMMARY: Working with HP's DAT on SUN/Solaris2.3

From: shaul frenkel (shaul@orbotech.co.il)
Date: Mon Nov 28 1994 - 05:58:12 CST


Hello World,

Thanks to Kevin Jones who send me the following release, and everyone
who answered my question.

Here is a solution for the DAT performance on Solaris 2.3 (and other
platforms) :

CONFIGURING HP DDS DRIVES

Contents
--------

Introduction

MRS - Media Recognition System

SUN Workstations

DEC Workstations

HP Workstations

IBM RS6000 Workstations

Banyan Vines Networks

Other Computer Systems

PC Applications

Appendix A - Switch Settings

Appendix B - SGI OS Application Note

Appendix C - Optimising SUN Systems for the HP354XXA

1. Introduction
---------------

Hewlett Packard's HP35470/80A DDS tape drives have been designed
to meet the needs of our customers who sell mass storage
products into the various parts of the computer market place. We
have achieved this by making our products such that they can be
configured to work in the most common computer platforms in use
today; PC's and Unix workstations, including SUN, DEC, and HP.
This application note is intended to help our customer's
Application Engineers (AE's) to properly configure our products
for use in these arenas.

What Does 'Configurability' Mean?

Hewlett Packard's HP35470/80A DDS tape drives are designed to
meet specific requirements of SUN, DEC, and HP Unix
Workstations, while remaining compatible with industry standard
software packages for the PC environment, such as those listed
in the 'PC Application Section'. In addition, these HP DDS
products can be tailored to improve backup/restore performance
or to improve System performance during backup/restore
operations. Different configurations are achieved via switch
settings on the bottom of the drives. A configuration matrix is
shown in appendix A

2. MRS - Media Recognition System
---------------------------------

The Media Recognition System (MRS) was developed to ensure both
DDS drive manufacturers and DDS end users of having media that
meets the specifications necessary for data quality and
reliability. Any media using the MRS system will have passed
tests in the following hierarchy of media requirements:

Mechanical - Cartridge and Media Physical Construction

Electromagnetic - Basic Read/Write Signal Parameters

Environmental - Operating and Storage

Performance

Only the first 2 are met by audio grade media but all four are
necessary for data grade media to protect the user from data
loss. MRS media has a striped area on the tape leader allowing
the drive to recognise it as DDS grade media.

When MRS is Enabled on a DAT drive the drive will only write
data to media which has this striped area on the tape leader.
Any other media will act as if it is write protected. This is
important to note because if a user has older DDS media it is
still possible to read those tapes even if MRS is enabled.

3. SUN Workstations
--------------------

Hewlett Packard's HP35470/80A DDS drives are easy to configure
for use in the SUN Unix workstation environment. The simple
switch settings defined in the table below allow HP's drives to
'plug and play' with Sun's workstation products that have
internal SCSI support.

In this mode, the drive ignores the Mode Select command that
turns off the drive's buffer when using the default driver
(invoked because the drive is not listed in the Sun O/S lookup
table), and performance is not impacted. This will work in all
Sun 4.X O/S Workstations.

The following table lists the switch settings required to
operate the HP 35470/80A in the Sun environment. Note that the
position of switches 1 and 2 are only valid for the HP35480A,
control the compression capabilities of the drive only, and do
not affect the configuration of the drive with respect to the
Sun or any other workstations.

  MRS Disabled

Switch Settings System Changes Req'd Comments

6,7,8=0 1,2,3,4,5=1 None Ignores Mode Select and Non-Immed FM

  MRS Enabled

Switch Settings System Changes Req'd Comments

6,7=0 1,2,3,4,5,8=1 None Ignores Mode Select and Non-Immed FM

Other Hints for SUN

SUN requires that the SCSI address of Tape devices be either 4
or 5. If the address is set to 4, the 'rst0' or 'nrst0' drivers
are used. If the address is 5, 'rst1' or 'nrst1' is used.

When using the 'cpio' command, be sure to set the tape size
option (-B) so that you use the block size of 5120 or greater.
This will improve performance significantly.

When using the 'dump' command, set the tape size (-s) to 15000 and
density (-d) parameter to 15000. This will allow you to fill a
90m tape. The defaults for the 'dump' command are setup for QIC
drives, and will result in storing only about 600 Mbytes.

For DDS2 drives, tape size should be set to 30000.

4. DEC Workstations
-------------------

The SCSI command set used on DEC workstations differ from that
of SUN in one major area. This is the Space command. Where Sun
complies to the requirements of SCSI-2 here, DEC chose to stay
with a SCSI-1 implementation of this command. This slight
difference is a major impact if a DEC user wants to boot from
tape.

As a result, we provided the drives with this functionality. By
setting Switch 8 to 0 or OFF, the drive automatically switches
to the functionality required by DEC workstations. This will
allow the user to plug and play on all DEC 3100 or 5000 Series
Workstations running Ultrix or VMS. No other changes are
required.

Additionally, in DEC latest release of VMS (5.5) new firmware is
required in the HP DDS drive. Version 9 firmware, released in
September of 1992, makes the drives fully compatible with VMS
5.5 or later operating systems. Also, in order to make the drive
pass the DEC SCSI test during an 'Auto-boot' sequence, special
code is required that reduces the number of bytes passed from
the drive to the host from 43 to 40. This code is available from
your technical representative.

Also, if top performance is a requirement, the drive can be
configured to operate in the 'Performance' mode by setting
switches 8 and 6 to 0 or OFF. This will increase the drives
performance by reducing the time it takes to write filemarks,
because all filemark commands will be treated as immediate
commands. The drawback here is that if power fails, the host may
not be able to figure out where data is, because a filemark that
was supposedly on tape, has now been lost in the buffer. this is
however the way the competitors drives operate all the time.

    MRS Disabled

Switch Settings System Changes Req'd Comments

8=0 1,2,3,4,5,6,7=1 None DEC 3100, 5000 Ultrix/VMS

6,8=0 1,2,3,4,5,7=1 None Ignores Non-Immed Filemarks

    MRS Enabled

Switch Settings System Changes Req'd Comments

3,8=0 1,2,4,5,6,7=1 None DEC 3100, 5000 Ultrix/VMS

3,6,8=0 1,2,4,5,7=1 None Ignores Non-Immed Filemarks

5. HP Workstations
------------------

Hewlett Packard uses its own version of SCSI in it's Unix
Workstation products. This is referred to as 'HP Common SCSI'.
As a result, our HP35470/80A DDS drives are configurable to
operate in this environment as well. To setup the drives for use
in HP systems, the switches should be set in the default, or all
ON position. As with DEC and SUN, there is also a configuration
available to provide users with a slight performance advantage.
By setting Switch 6 to 0 or OFF, with all other switches set to
1 or ON, the drive switches to the performance mode, ignoring
all non-immediate filemark commands. Valid configurations for
using the HP35470/80ADDS drives in HP Workstations follows.

       MRS Disabled

Switch Settings System Changes Req'd Comments

1,2,3,4,5,6,7,8=1 None HP 9000/300,400,700,800

6=0, 1,2,3,4,5,7,8=1 None Ignores Non-Immed Filemarks

       MRS Enabled

Switch Settings System Changes Req'd Comments

3=0 1,2,4,5,6,7,8=1 None HP 9000/300,400,700,800

3,6=0 1,2,4,5,7,8=1 None Ignores Non-Immed Filemarks

Other Hints for HP Systems. To use DAT drives on HP Systems, the
user must create device files with the HP-UX 'mknod' function,
to properly configure the device driver in the HP-UX kernel. The
following steps are required;

For HP series 300/400 Workstations (HP-UX 8.0 or greater):

        $> mknod /dev/rmt/0mn c 54 0xSS0I02 - Rewind on close

        $> mknod /dev/rmt/0mn c 54 0xSS0I03 - No Rewind on close

                where : SS=SCSI card select code, I=SCSI ID,

For HP Series 700 Workstations (HP-UX 8.07 or greater):

        A device driver that supports non-compressed drives is resident
        in the directory /dev/rmt.

        This driver assumes the drive is at SCSI ID of 3. If your drive
        is a compressed drive, or not at ID 3, create a device file by
        using one of the following commands where I is the SCSI ID of
        the drive.

        $> mknod /dev/rmt/0mn c 54 0x201I02 - Rewind on close,Uncompressed

        $> mknod /dev/rmt/0mn c 54 0x201IC2 - Rewind on close,Compressed

        $> mknod /dev/rmt/0mn c 54 0x201I03 - No Rewind on close,Uncompressed

        $> mknod /dev/rmt/0mn c 54 0x201IC3 - No Rewind on close,Compressed

For HP Series 8x7 Workstations (HP-UX 8.02 or greater):

        Device files are created automatically during the autoconfigure
        routines during the boot cycle.

In most cases the Select Code of the SCSI Interface card in the
workstation is set to 14 (default). Users can also refer to the
'Peripherals Installation Guide' that is part of the HP-UX
manual set included with their workstation.

6. IBM RS6000 Workstations
--------------------------

With the release of version 9 firmware for the HP35470/80A and
the release of Version 3.2 or later of IBM's AIX operating
system, the HP DDS drive now plug and play on the RS6000 without
special firmware. Just plug in an HP DAT with version 9
firmware, and then use the IBM 'SMIT' program to configure your
system. The HP DAT drives are compatible with the 'Other SCSI
Devices' driver in SMIT.

In order to make the HP35470/80A DDS tape dives operate with the
IBM RS6000 family of workstations running old 3.1.X versions of
the AIX operating system, HP provides 'special' firmware that
emulated IBM's QIC drives. This allows the user to simply plug
the HP35470/80A drive to the RS6000 workstation, and start
backing up and restoring data, with no changes to the AIX
operating systems files. This 'special' firmware is 'RS6K QIC
Emulation Code', and must be downloaded into the drive prior to
operation with the RS6000.

The following table lists the switch settings required to
operate the HP35470/80A in the IBM RS6000 environment. Note that
the position of switches 1 and 2 are only valid for the
HP35480A, control the compression capabilities of the drive
only, and do not affect the configuration of the drive with
respect to the IBM or any other workstations.

    MRS Disabled

Switch Settings System Changes Req'd Comments

3,6,7,8=0 1,2,4,5=1 None Performance & No Data Phase Discon's

   MRS Enabled

Switch Settings System Changes Req'd Comments

3,6,7=0 1,2,4,5,8=1 None Performance & No Data Phase Discon's

Note: If using AIX 3.1.X operating system the drive must first
be loaded with 'RS6K QIC' code , via a download tape.

 The HP35470/80A will work with the 'tar', 'cpio', 'dd'. The
drive is also boot capable, provided a boot tape is generated.
For those customers who want to use the AIX 'backup' and
'restore' utilities, the drive's default condition must be
'fixed mode' and therefore Switch 5 needs to be set to 'OFF ' in
this case.

7. Banyan Vines Networks
------------------------

To use the HP35470/80A on Banyan Vines networks, a simple
configuration change is all that is required. Use the following
switch settings and an Adaptec host bus adapter card;

      MRS Disabled

Switch Settings System Changes Req'd Comments

3,5,6,7,8=0 1,2,4=1 None Plug and Play with Adaptec HBA

      MRS Enabled

Switch Settings System Changes Req'd Comments

3,5,6,7=0 1,2,4,8=1 None Plug and Play with Adaptec HBA

8. Other Computer Systems
-------------------------

The HP35470/80A DDS tape drives can be configured for plug and
play compatibility on MIPS and Silicon Graphics (SG) computer
systems.

For MIPS, use the 'SUN' configuration with 'no data-phase
disconnect' settings, outlined in Appendix A. For example,
setting Switches 3,7 and 8 to 0 or OFF is the standard way to
make the HP35470/80A work with MIPS computers. Other variations
with 'No Data Phase Disconnect' in the 'SUN' configuration would
also apply.

For SG machines, parity must be OFF. Any 'SUN' configuration
with Parity OFF would work for SG systems. For example, the
standard configuration would be Switches 4,6,7 and 8 Off.
Additionally, use Appendix B to edit the /tpsc files to support
HP DAT drives.

9. PC Applications
------------------

Hewlett Packard has spent a significant amount of time with
third party software and hardware vendors to get support for the
HP35470/80A DDS drives on today's popular PC based platforms.
The drive should be configured in the default (ALL switches ON),
and will work in the following environments with the following
"referenced" applications;

PC Environment Host Adapter Application

DOS Adaptec Bustek DPT Cheyenne Arcsolo, Rev 2.1 or later

DOS Adaptec Bustek DPT Novastor Novaback for DOS

O/S-2 Adaptec IBM Sytos Plus, Rev 1.35

O/S-2 Adaptec Novaback Novastor for O/S-2

Lan Manager Adaptec Sytos Plus, Rev 1.35

Novell Adaptec IBM Cheyenne ArcServe 3.0A or later

Novell Future Domain Palindrome Network Archivist 2.0D

Novell Adaptec Bustek Novastor Novaback-NLM

Apple Mac Resident Dantz Retrospect 1.3 or later

Apple Mac Resident Optima Technology DeskTape Rev 1.4 or
                                        later

10. Appendix A - Switch Settings
----------------------------------

Switch 1 : DC Enable - When set to one, drive defaults mode
is to write compressed data. If set to zero, default is
uncompressed. (Not used on HP35470A)

Switch 2 : DC Control - When set, host can control DC
functions via Mode Select command, DC Characteristics page. If
set to zero, host can not control nor change DC settings and
changes the SCSI Inquiry data to call out model number HP35470A
instead of HP35480A. (Not used on HP35470A)

NOTE : The HP35480A will always decompress data when reading a
compressed tape regardless of switch setting 1 and 2. The data
decompression functionality can only be disabled by host control.

Data Compression Inquiry Host Control Switch Switch
Default String Of DC 1 2

Compression On HP35480A Enabled 1 1

Compression On HP35470A Disabled 0 1

Compression Off HP35480A Enabled 1 0

Compression Off HP35470A Disabled 0 0

11. Appendix B - SGI OS Application Note
------------------------------------------

To make the HP35470/80A DDS drives compatible with Silicon
Graphics workstations, the following modifications to the
operating system are recommended;

1. In the file /usr/sysgen/master.d/tpsc, add the following
paragraph after the Archive DAT entry;

{DATTAPE, TPDAT,7,6,"ARCHIVE","PYTHON",0,0,{0,0,0,0},
MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV|
MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ|
MTCAN_SILI|MTCAN_AUDIO|MTCAN_SEEK|MTCAN|CMTYPEANY,
/*minimum delay to i/o is 4 minutes, because when a retry is
 *performed, the drive retries a number of times, and then
 *rewinds to BOT, repositions, and tries again. */
 40,4*60,4*60,5*60,512,512*512},

(New paragraph starts here)

{DATTAPE, TPDAT,2,8,"HP","HP354xxA",0,0,{0,0,0,0},
MTCAN_BSF|MTCAN_BSR|MTCAN_APPEND|MTCAN_SETMK|MTCAN_PART|MTCAN_PREV|
MTCAN_SYNC|MTCAN_SPEOD|MTCAN_CHKRDY|MTCAN_VAR|MTCAN_SETSZ|
MTCAN_SILI|MTCAN_AUDIO|MTCAN_SEEK|MTCAN|CMTYPEANY,
/*minimum delay to i/o is 4 minutes, because when a retry is
 *performed, the drive retries a number of times, and then
 *rewinds to BOT, repositions, and tries again. */
 40,4*60,4*60,5*60,512,512*512},

2. Recompile your kernel and then you are ready to start backing
up files to the HP drive.

To read SGI written tar tapes on an HP system:
dd if=/dev/rmt/0m ibs=20k obs=512 bs=512k | tar xvf -

12. Appendix C - Optimising SUN Systems (SUNOS 4.1.X)
----------------------------------------------------------

It is now possible to modify the device definition files in the
SUN workstations to optimise the performance of the HP35470/80A
in Plug and Play applications.

The following changes should be made to the files listed below;

1. In file /user/sys/scsi/targets/stdef.h add the following line
after the entry defining an Exabyte device;

#define ST_TYPE_EXABYTE 0x28 /* Exabyte */ (existing line)

#define ST_TYPE _HP1 0x29 /* HP */ (added new line)

2. In the file /user/sys/scsi/targets/st_conf.c add the
following paragraph after the Exabyte entry;

/* Exabyte 8mm cartridge */
{
  "Exabyte 8mm Helical Scan", 7, "EXABYTE", ST_TYPE_EXABYTE, 1024,
  (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE |ST_AUTODEN_OVERRIDE),
  5000, 5000,
  { 0x00, 0x00, 0x00, 0x00 },
  { 0, 0, 0, 0 }
}

(New Paragraph Starts Here)

/* HP 4mm Helical Scan */
{
  "HP-354XXA 4mm DAT", 2, "HP", ST_TYPE_HP1, 10240,
  (ST_VARIABLE | ST_BSF | ST_BSR | ST_LONG_ERASE | ST_AUTODEN_OVERRIDE),
  6000, 6000,
  { 0x00, 0x00, 0x00, 0x00 },
  { 0, 0, 0, 0 }
}

3. Recompile your kernel, and then you are ready to start
backing up files to the HP354XXA tape drive. These changes
should result in a transfer rate on the order of 6-11
MBytes/minute, depending on the UNIX command used.
(C15X3 series drive's transfer rates should be 30MByte/min or
 more but are highly dependant on the systems ability to source
 data quickly enough).

13. Appendix D - Optimising SUN Systems (Solaris 2.X x>1)
----------------------------------------------------------
In /kernel/drv/st.conf

tape-config-list =
    "HP C1533A", "HP DDS2 4mm DAT", "HP-data2",
    "HP HP35480A", "HP DDS-DC 4mm DAT", "HP-data1",
    "HP HP35470A", "HP DDS 4mm DAT", "HP-data1",
    "HP C1553A", "HP DDS2 4mm DATloader", "HP-data2";
HP-data1 = 1,0x34,0,0x19,4,0x13,0x13,0x13,0x13,3;
HP-data2 = 1,0x34,0,0x19,4,0x0,0x3,0x3,0x3,3;

and the switch settings are:

        1 2 3 4 5 6 7 8

        ON ON ON ON ON OFF OFF OFF

Halt.
boot -r

14. Controlling compression on SUN (Solaris 2.X x>1)
------------------------------------------------

This ability exists only on drives with firmware dated after Nov 1994.
Don't bother trying this with HP35470 and HP3540 drive's since their
firmware has not had this feature rolled in. Newer C15XX series
drives might support this. Don't bother mailing me or anyone else
in HP about drive firmware revisions since it is up the the
3rd party suppliers to provide at their discretion firmware
upgrades.

You need to set the config switches to:

        1 2 3 4 5 6 7 8

        ON ON OFF OFF ON ON OFF OFF

Make the st_conf.c entries described in section 13.
You should now be able to control compression via device file name:

/dev/rmt/#[lmhc][b][n]

b = Berkley mode
n = No rewind
l = Low density (compression disabled)
m = Medium Density (compression enabled)
h = High Density (compression enabled)
c = Compression (compression enabled)

If you can't open the device then it might well be due to the
drive's firmware being too old. In this case, set the switches
to the values in section 13 and proceed to section 15.

15. Controlling compression via a utility on SUN
---------------------------------------------------

For drives with old firmware, compression cannot be controlled
via device file names (see section 14).
If you have a DC drive and you want explicit compression control
from a host then the only option is to run the following utility
prior to backup. Note that the switch settings should be the
same as those in section 13.

/****************************************************************
*
* SUN_dc_xtrl.c
*
* Hack to control DC in an HP DDS drive from a SUN
*
* Use: SUN_dc_xtrl device-file-name 1 Turns DC on
* SUN_dc_xtrl device-file-name 0 Turns DC off
*
* Note: Switch 2 on the underside of the drive must be ON
* in order for this utility to work.
*
******************************************************************
* Kevin Jones. | Hewlett Packard Ltd,
* | Computer Peripherals Bristol,
* kev%hpcpbla@hplb.hpl.hp.com | Filton Road,
* | Stoke Gifford,
* | Bristol. BS12 6QZ.
* | ENGLAND.
******************************************************************
*
* This code is not official HP code.
* It is provided for informational purposes only.
* It is supplied without warranty of any kind.
*
****************************************************************/

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/scsi/impl/uscsi.h>

int fd;
unsigned char msel_data[] = { 0,0,0x10,0,0xf,0xe,0x40,0x80,0,0,0,0x20,0,0,0,0,0,0,0,0 };

main (argc, argv)
int argc;
char *argv[];

{ struct uscsi_cmd scsi_cmd, *cmd = &scsi_cmd;
  char cmd_cdb[6];

  if (argc != 3)
     printf ("Usage: SUN_dc_xtrl device-file-name [01]\n");

  if ((fd = open(argv[1], O_RDWR | O_NONBLOCK)) < 0)
   { if ((fd = open(argv[1], O_RDWR | O_NONBLOCK)) < 0)
      { printf ("Failed to open device %s\n", argv[1]);
        exit (1);
      }
   }

  if (*(argv[2]) == '1')
     msel_data[6] = 0xC0;

  cmd->uscsi_cdblen = 0x06;
  cmd->uscsi_timeout = 5000;
  cmd->uscsi_flags = USCSI_WRITE;
  cmd->uscsi_bufaddr = msel_data;
  cmd->uscsi_buflen = sizeof (msel_data);
  cmd->uscsi_cdb = cmd_cdb;
  cmd->uscsi_cdb[0] = 0x15;
  cmd->uscsi_cdb[1] = 0x10;
  cmd->uscsi_cdb[2] = 0x0;
  cmd->uscsi_cdb[3] = 0x0;
  cmd->uscsi_cdb[4] = 0x14;
  cmd->uscsi_cdb[5] = 0x0;

  if (ioctl (fd, USCSICMD ,cmd) < 0)
   { printf ("Mode Select command failed :-(\n");
     exit (1);
   }

  exit (0);
}



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:16 CDT