[comp.sys.hp] HP 9000/835, HP-UX 7.0 - unable to use cartridge tape drive

renga@perpetua.cs.uoregon.edu (Renganathan Sundararajan) (01/13/91)

 System: HP 9000/835 running HP-UX 7.0
-----------------------------------------
We have hp9145   32-track cartridge tape drive and I cannot
access the tape drive using any of the sp. files in
/dec/rct  or /dev/ct.

My guess is that when HP-UX 7.0 was installed (by another
person, well-versed in BSD & SUN OS, but not that familiar
with HP-UX), the dev file corresponding to our ct drive
was either not created or the previous one was overwritten
by mistake.


The foll. shell script

 foreach i (/dev/rct/*  /dev/ct/*)
   echo $i
   ls | cpio -o | tcio -oV -S 8 -v $1
   sleep 2
 end

produces error msgs of the form.

	/dev/rct/c0d0s2
	tcio(1004): cannot access tape /dev/rct/c0d0s2%; errno 2

	/dev/rct/c6d0s2
	tcio(1004): cannot access tape /dev/rct/c6d0s2; errno 6

	/dev/rct/c1000d0s2
	tcio(1004): cannot access tape /dev/rct/c1000d0s2; errno 19

I don't have a clue as to what these error numbers mean.

Doesn't HP-UX check at boot time for devices attached to the system
and warn if the corresponding drivers and/or special files 
don't exist? This may be a naive question but bear with me. 

How can I get the tape drive working? There is apparently nothing
wrong with the drive itself. 

Thanks in advance for your help.

Renga
--------------------------------------------------------------------
  Renga Sundararajan	              Department of Computer Science
  University of Oregon	              Eugene, OR 97403-1202
  INTERNET:   renga@cs.uoregon.edu    CSNET:	renga@uoregon.csnet
  USENET:     {decvax, allegra}!tektronix!uoregon!renga
--------------------------------------------------------------------
--
--------------------------------------------------------------------
  Renga Sundararajan	              Department of Computer Science
  University of Oregon	              Eugene, OR 97403-1202
  INTERNET:   renga@cs.uoregon.edu    CSNET:	renga@uoregon.csnet
  USENET:     {decvax, allegra}!tektronix!uoregon!renga
--------------------------------------------------------------------

kk@hpl-opus.hpl.hp.com (Konstantinos Konstantinides) (01/15/91)

this is my /dev/rct/c0
crw-rw-rw-   2 root     other      4 0x070300 Jan 12 02:04 /dev/rct/c0

and my /dev/ct/c0
brw-rw-rw-   1 root     other      0 0x070300 Apr 15  1986 /dev/ct/c0

The HP-IB address of the tape drive is "3".

Be sure also that you included the "tape" driver in your kernel

From my /etc/conf/dfile
...
* Tape drivers
tape             <----------- This one
scsitape
*stape

.....

Another item: if you shutdown your system whith the tape drive on,
              the system may not find the tape drive when it will come up.
              Solution: remove the tape from the drive and put it back
                        again.
I hope this helps
-------------------------------------------------
K. Konstantinides
kk@hpkronos.hpl.hp.com

bobk@hpcuha.cup.hp.com (Bob Kentwortz) (01/16/91)

I can not address directly your error messages or the script you wrote.  I'll
try to find someone who can though.

I can add to the previous response though:

The tape (tape1) driver is not used for the ctd.  Tape1 is used only for
round tape drives such as the 7980.  Disc0 is the driver used for HPIB discs
and ctd's.  I have listed our gen file, devices file, and ll's and lssf's for
/dev/rct/* and /dev/ct/* for the addresses genned into our kernel.  They are
all on a CIO Adapter at module address 8 (instead of 4, as with your 835),
but I think you can get what you need from them.  Also, refer to the mksf
man page; you'll find additional information on special files used for
cartridge tapes (note -u and -c options under DISC0).  The admin manual
should also have information on this.  Also, have you tried using SAM?

Good Luck,
bobk@hpda.hp.com

/etc/conf/gen/S800
------------------
cio_ca0 address 8 {
                hpib0   address 0 {
                        disc0    lu 0 address 0;
                        disc0    lu 1 address 1;
                        disc0    lu 2 address 2;
                        disc0    lu 3 address 3;
                }                             ^
                                              |
HP-IB addresss available for ctd's ___________| 

/etc/devices
------------
cio_ca0                 address 2.8
disc0           lu 0    address 2.8.0.0 b_major 0       c_major 4
disc0           lu 1    address 2.8.0.1 b_major 0       c_major 4
disc0           lu 2    address 2.8.0.2 b_major 0       c_major 4
disc0           lu 3    address 2.8.0.3 b_major 0       c_major 4

ll /dev/rct/*
-------------
crw-rw-rw-   1 bin      bin        4 0x400002 Nov  8 15:00 /dev/rct/c0d0s2
crw-rw-rw-   1 bin      bin        4 0x400022 Dec 31  1989 /dev/rct/c0d1s2
crw-rw-rw-   1 bin      bin        4 0x400102 Dec 31  1989 /dev/rct/c1d0s2
crw-rw-rw-   1 bin      bin        4 0x400122 Dec 31  1989 /dev/rct/c1d1s2
crw-rw-rw-   1 bin      bin        4 0x400202 Dec 31  1989 /dev/rct/c2d0s2
crw-rw-rw-   1 bin      bin        4 0x400222 Dec 31  1989 /dev/rct/c2d1s2
crw-rw-rw-   1 bin      bin        4 0x400302 Dec 31  1989 /dev/rct/c3d0s2
crw-rw-rw-   1 bin      bin        4 0x400322 Dec 31  1989 /dev/rct/c3d1s2

lssf /dev/rct/*
---------------
disc0 lu 0 unit 0 section 2 address 2.8.0.0 ct /dev/rct/c0d0s2
disc0 lu 0 unit 1 section 2 address 2.8.0.0 ct /dev/rct/c0d1s2
disc0 lu 1 unit 0 section 2 address 2.8.0.1 ct /dev/rct/c1d0s2
disc0 lu 1 unit 1 section 2 address 2.8.0.1 ct /dev/rct/c1d1s2
disc0 lu 2 unit 0 section 2 address 2.8.0.2 ct /dev/rct/c2d0s2
disc0 lu 2 unit 1 section 2 address 2.8.0.2 ct /dev/rct/c2d1s2
disc0 lu 3 unit 0 section 2 address 2.8.0.3 ct /dev/rct/c3d0s2
disc0 lu 3 unit 1 section 2 address 2.8.0.3 ct /dev/rct/c3d1s2

ll /dev/ct/*
------------
brw-rw-rw-   1 bin      bin        0 0x400002 Jun 15  1990 /dev/ct/c0d0s2
brw-rw-rw-   1 bin      bin        0 0x400022 Dec 31  1989 /dev/ct/c0d1s2
brw-rw-rw-   1 bin      bin        0 0x400102 Dec 31  1989 /dev/ct/c1d0s2
brw-rw-rw-   1 bin      bin        0 0x400122 Dec 31  1989 /dev/ct/c1d1s2
brw-rw-rw-   1 bin      bin        0 0x400202 Dec 31  1989 /dev/ct/c2d0s2
brw-rw-rw-   1 bin      bin        0 0x400222 Dec 31  1989 /dev/ct/c2d1s2
brw-rw-rw-   1 bin      bin        0 0x400302 Dec 31  1989 /dev/ct/c3d0s2
brw-rw-rw-   1 bin      bin        0 0x400322 Dec 31  1989 /dev/ct/c3d1s2

lssf /dev/ct/*
--------------
disc0 lu 0 unit 0 section 2 address 2.8.0.0 ct /dev/ct/c0d0s2
disc0 lu 0 unit 1 section 2 address 2.8.0.0 ct /dev/ct/c0d1s2
disc0 lu 1 unit 0 section 2 address 2.8.0.1 ct /dev/ct/c1d0s2
disc0 lu 1 unit 1 section 2 address 2.8.0.1 ct /dev/ct/c1d1s2
disc0 lu 2 unit 0 section 2 address 2.8.0.2 ct /dev/ct/c2d0s2
disc0 lu 2 unit 1 section 2 address 2.8.0.2 ct /dev/ct/c2d1s2
disc0 lu 3 unit 0 section 2 address 2.8.0.3 ct /dev/ct/c3d0s2
disc0 lu 3 unit 1 section 2 address 2.8.0.3 ct /dev/ct/c3d1s2

ralfw@hpbbi4.BBN.HP.COM (#Ralf Wiegert) (01/16/91)

>	/dev/rct/c0d0s2
>	tcio(1004): cannot access tape /dev/rct/c0d0s2%; errno 2
>
>	/dev/rct/c6d0s2
>	tcio(1004): cannot access tape /dev/rct/c6d0s2; errno 6
>
>	/dev/rct/c1000d0s2
>	tcio(1004): cannot access tape /dev/rct/c1000d0s2; errno 19
>
>I don't have a clue as to what these error numbers mean.

The error numbers can be found in /usr/include/sys/errno.h, I have
included a script that gives you the error name for a given errno.

#define ENOENT          2       /* No such file or directory    */
#define ENXIO           6       /* No such device or address    */
#define ENODEV          19      /* No such device               */

For the given error names (e.g. ENOENT) you can than have a look in
the errno(2) man page (man 2 errno):

ENOENT         No such file or directory.  This error occurs
               when a file name is specified and the file
               should exist but doesn't, or when one of the
               directories in a path name does not exist.
               It also occurs with msgget, semget, shmget
               when key does not refer to any object and the
               IPC_CREAT flag is not set.
ENXIO          No such device or address.  I/O on a special
               file refers to a subdevice which does not
               exist, or beyond the limits of the device.
               It may also occur when, for example, a tape
               drive is not online or no disk pack is loaded
               on a drive.
ENODEV         No such device.  An attempt was made to apply
               an inappropriate system call to a device;
               e.g., read a write-only device.


This is no official HP answer.

Hope this help, Ralf Wiegert, HP Boeblingen, Germany

#echo "errno	@(#)revision 1.0"
# ======================================================================
# ==================== script documentation ============================
# desc	Full pathname : /usr/gmbh/bin/errno
# desc	This script returns the error description for a given errno
# desc	
#
# ----------------------------------------------------------------------
# hist	1.0	900220                                      Ralf Wiegert
# hist
# ====================== end of documentation ==========================
if [ $# -ne 1 ]
then
	echo "Usage: $0 number" >&2
	exit 1
fi
awk '/^#define/ { if ($3 == '"$1"') print }' /usr/include/sys/errno.h

jsadler@misty.boeing.com (Jim Sadler) (01/18/91)

Another way to get a better description of errno errors is to add the
long description in the manual with the errno number in a file called
/usr/lib/help/errno.  This allows you to to use the help command ex.
as shown below.

Script started on Thu Jan 17 21:10:05 1991


misty.jsadler /users/jsadler$ help errno16

errno16:
	  EBUSY		 Device or resource busy.  An attempt to mount
			 a device that was already mounted or an
			 attempt was made to dismount a device on
			 which there is an active file (open file,
			 current directory, mounted-on file, active
			 text segment).	 It will also occur if an
			 attempt is made to enable accounting when it
			 is already enabled.  The device or resource
			 is currently unavailable, such as when a
			 non-shareable device file is in use.

misty.jsadler /users/jsadler$ 

script done on Thu Jan 17 21:10:16 1991

If you would like a copy of the file let me know and I'll mail you a
copy.  If enough requests come in I'll post it. (it's about 15k)


jim sadler
206-234-9009	email	uunet!bcstec!jsadler | jsadler@misty.boeing.com

This service is brought to you by the computing mafia of Boeing (BCS).
Oh ya
None of the above is an opinion of The Boeing Co.