Technical article 110973

What files get out of sync after trying to unsuccessfully add a tape drive?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

When I add a tape drive unsuccessfully, I either can't remove it, or I get errors while the kernel is relinking. What files are modified during a tape drive installation?

Cause

The files in the kernel link kit get multiple invalid entries after unsuccessful tape additions.

Solution

Check the files listed below to make sure the tape has been configured correctly (this assumes that there is only one tape drive on the system):

1. /etc/conf/cf.d/mscsi

There should be one line for the tape that looks similar to this:

*ha     attach  number  ID      lun     bus
*
alad    Stp     0       5       0       0

If there are multiple entries for the tape, delete all but one of them.

2. /etc/conf/cf.d/sdevice

There should be one line for Stp that looks like this:

Stp     Y       1       0       0       0       0       0       0
0
3. /etc/conf/sdevice.d/Stp

This file should have one line for the tape drive.

Stp     Y       1       0       0       0       0       0       0
0

If there are multiple entries for the tape, delete all but one of them.

Note: /etc/conf/cf.d/sdevice gets the information from this file on a kernel relink.

4. /etc/conf/pack.d/Stp/space.h

This file will vary a bit depending on the tape model, but the important thing is that there is only one entry for the tape in the "... SCO_STP ..." sections.

/* BEGIN SCO_STP EXTERNS */
extern int  dat_Stp_route();
/* END SCO_STP EXTERNS */

int (*Stp_route_tbl[])() = { /* BEGIN SCO_STP ROUTERS */ dat_Stp_route, /* END SCO_STP ROUTERS */ };

int     Stp_nroute_els = sizeof( Stp_route_tbl ) / sizeof( int * );
Stp_tape_config_t       Stp_tape_cfg[STP_NDRIVES] = {
/* BEGIN SCO_STP ENHANCEMENTS */
{ 0, 3, -1, -1, dat_Stp_route },
/* END SCO_STP ENHANCEMENTS */
};
5. /etc/conf/pack.d/Stp/device.dat

Make sure that there is only one Stp structure.

FILE_FORMAT:
        version=1
Stp0:
        INDEX=Stp0
        PATH=node0,node1
        node0=D_SUBSYS,SCSI Tape,0,D_TAPE_SUBSYS,,NULL
        node1=D_UNIT,Drive 0,0,0,D_REMOVABLE D_NODE,NULL
        D_USER_MSG=SCSI Tape Drive,8,0,,NULL
        D_REWIND_NODE = 0
        D_CTL_NODE = 128
        D_NOREWIND_NODE = 8
6. /etc/conf/node.d/Stp

Make sure that this file is not corrupted. It should look similar to this:

Stp     rmt/Sc0s0x      c       128     root    root    666
Stp     rmt/Sc0s0       c       0       root    root    666
Stp     rmt/Sc0s0n      c       8       root    root    666
Stp     rmt/Sc0s0r      c       16      root    root    666
Stp     nrStp0  l       rmt/Sc0s0n
Stp     rStp0   l       rmt/Sc0s0
Stp     xStp0   l       rmt/Sc0s0x
Stp     rct0    l       rmt/Sc0s0
Stp     rmt/0b  l       rmt/Sc0s0
Stp     rmt/c0s0        l       rmt/Sc0s0
Stp     nrct0   l       rmt/Sc0s0n
Stp     rmt/0bn l       rmt/Sc0s0n
Stp     rmt/c0s0n       l       rmt/Sc0s0n
Stp     xct0    l       rmt/Sc0s0x
Stp     rmt/c0s0r       l       rmt/Sc0s0r

7. Finally, make sure that the device nodes for the tapes are still in the /dev and /dev/rmt directories.

/dev
crw-rw-rw-   5 root     root      46,  8 Oct  4 09:57 /dev/nrStp0
crw-rw-rw-   5 root     root      46,  8 Oct  4 09:57 /dev/nrct0
crw-rw-rw-   5 root     root      46,  0 Oct  4 09:57 /dev/rStp0
crw-rw-rw-   5 root     root      46,  0 Oct  4 09:57 /dev/rct0
crw-rw-rw-   3 root     root      46,128 Oct  4 09:57 /dev/xStp0
crw-rw-rw-   3 root     root      46,128 Oct  4 09:57 /dev/xct0
/dev/rmt/
crw-rw-rw-   5 root     root      46,  0 Oct  4 09:57 0b
crw-rw-rw-   5 root     root      46,  8 Oct  4 09:57 0bn
crw-rw-rw-   5 root     root      46,  0 Oct  4 09:57 Sc0s0
crw-rw-rw-   5 root     root      46,  8 Oct  4 09:57 Sc0s0n
crw-rw-rw-   2 root     root      46, 16 Oct  4 09:57 Sc0s0r
crw-rw-rw-   3 root     root      46,128 Oct  4 09:57 Sc0s0x
crw-rw-rw-   5 root     root      46,  0 Oct  4 09:57 c0s0
crw-rw-rw-   5 root     root      46,  8 Oct  4 09:57 c0s0n
crw-rw-rw-   2 root     root      46, 16 Oct  4 09:57 c0s0r

If any of the files in the first six steps duplicate lines, edit the files to reflect only one tape drive. Run mkdev tape, and remove the tape drive.

Next, confirm that the tape configuration is deleted from the above mentioned files. In the case of /etc/conf/sdevice.d/Stp, the second field should change to N. This tells the kernel not to link in that device. Relink the kernel and reboot. You should now be able to run mkdev tape again and add the tape drive correctly.

See also

ta109447, "Kernel relink fails with 'too many array initializers' after adding a SCSI tape unit."

From the Xinuos technical article database, record 110973. Reproduced with permission. The original is at www.sco.com/ta/110973, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.