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/mscsiThere should be one line for the tape that looks similar to this:
*ha attach number ID lun bus
*
alad Stp 0 5 0 0If there are multiple entries for the tape, delete all but one of them.
2. /etc/conf/cf.d/sdeviceThere should be one line for Stp that looks like this:
Stp Y 1 0 0 0 0 0 0
03. /etc/conf/sdevice.d/StpThis file should have one line for the tape drive.
Stp Y 1 0 0 0 0 0 0
0If 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.hThis 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.datMake 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 = 86. /etc/conf/node.d/StpMake 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/Sc0s0r7. Finally, make sure that the device nodes for the tapes are still in the /dev and /dev/rmt directories.
/devcrw-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 c0s0rIf 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."