# 2-6-12 kernel and SCSI Tape Drive

## pounch

Hello,

I would like to use a DDS4 Tape Drive on my gentoo box but it appears to be not recognized!

I emerged mtx tools but it still doesn't work.

When I do lspci, the tape drive appears. When I do dmesg, the tape drive is also present (I think).

Here are the results of these commands:

```
backup root # lspci

0000:00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 02)

0000:00:02.0 VGA compatible controller: Intel Corporation 82815 CGC [Chipset Graphics Controller] (rev 02)

0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 01)

0000:00:1f.0 ISA bridge: Intel Corporation 82801BA ISA Bridge (LPC) (rev 01)

0000:00:1f.1 IDE interface: Intel Corporation 82801BA IDE U100 (rev 01)

0000:00:1f.4 USB Controller: Intel Corporation 82801BA/BAM USB (Hub #2) (rev 01)

0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801BA/BAM AC'97 Audio (rev 01)

0000:02:08.0 Ethernet controller: Intel Corporation 82801BA/BAM/CA/CAM Ethernet Controller (rev 01)

0000:02:09.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev c1)

backup root # dmesg

...

osst :I: Tape driver with OnStream support version 0.99.3

osst :I: $Id: osst.c,v 1.73 2005/01/01 21:13:34 wriede Exp $

st: Version 20050312, fixed bufsize 32768, s/g segs 256

```

So what's wrong? The SCSI card is a LSI LOGIC Ultra320 and the tape drive is a HP DDS4!

I compiled the kernel with all the options for the SCSI drivers ... maybe I forgot something?

Could you help me please?

Thanks

----------

## nE0

What does tapeinfo tell you/us  :Wink: 

----------

## pounch

```
backup root # tapeinfo -f /dev/st0

cannot open SCSI device '/dev/st0' - No such device or address

```

... this makes me perplex!

How can I know which device is attached to the scsi controller? ... normally it would be st0!?

----------

## m_sqrd

What dose dmesg |grep -i scsi ouput?

----------

## pounch

```
backup root # dmesg |grep -i scsi

SCSI subsystem initialized
```

Hummmm ... I guess there's something that doesn't work very well!  or I did a mistake?

----------

## m_sqrd

Are you sure you have the drive for you card in the kernel or as a module

grep -i scsi /usr/src/linux/.config 

I don't know what driver you need or I'd have you look for that.

----------

## pounch

Here is the response for grep -i scsi /usr/src/linux/.config

```
CONFIG_CISS_SCSI_TAPE=y

# CONFIG_BLK_DEV_IDESCSI is not set

# SCSI device support

CONFIG_SCSI=y

CONFIG_SCSI_PROC_FS=y

# SCSI support type (disk, tape, CD-ROM)

# Some SCSI devices (e.g. CD jukebox) support multiple LUNs

CONFIG_SCSI_MULTI_LUN=y

# CONFIG_SCSI_CONSTANTS is not set

# CONFIG_SCSI_LOGGING is not set

# SCSI Transport Attributes

CONFIG_SCSI_SPI_ATTRS=y

CONFIG_SCSI_FC_ATTRS=m

CONFIG_SCSI_ISCSI_ATTRS=m

# SCSI low-level drivers

CONFIG_SCSI_3W_9XXX=m

CONFIG_SCSI_7000FASST=m

CONFIG_SCSI_ACARD=m

CONFIG_SCSI_AHA152X=m

CONFIG_SCSI_AHA1542=m

CONFIG_SCSI_AHA1740=m

CONFIG_SCSI_AACRAID=m

CONFIG_SCSI_AIC7XXX=m

CONFIG_SCSI_AIC7XXX_OLD=m

CONFIG_SCSI_AIC79XX=m

CONFIG_SCSI_DPT_I2O=m

CONFIG_SCSI_IN2000=m

# CONFIG_SCSI_SATA is not set

CONFIG_SCSI_BUSLOGIC=m

# CONFIG_SCSI_OMIT_FLASHPOINT is not set

CONFIG_SCSI_DMX3191D=m

CONFIG_SCSI_DTC3280=m

CONFIG_SCSI_EATA=m

CONFIG_SCSI_EATA_TAGGED_QUEUE=y

CONFIG_SCSI_EATA_LINKED_COMMANDS=y

CONFIG_SCSI_EATA_MAX_TAGS=16

CONFIG_SCSI_FUTURE_DOMAIN=m

CONFIG_SCSI_GDTH=m

CONFIG_SCSI_GENERIC_NCR5380=m

CONFIG_SCSI_GENERIC_NCR5380_MMIO=m

# CONFIG_SCSI_GENERIC_NCR53C400 is not set

CONFIG_SCSI_IPS=m

CONFIG_SCSI_INITIO=m

CONFIG_SCSI_INIA100=m

CONFIG_SCSI_PPA=m

CONFIG_SCSI_IMM=m

# CONFIG_SCSI_IZIP_EPP16 is not set

# CONFIG_SCSI_IZIP_SLOW_CTR is not set

CONFIG_SCSI_NCR53C406A=m

CONFIG_SCSI_SYM53C8XX_2=m

CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1

CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16

CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64

# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set

CONFIG_SCSI_IPR=m

# CONFIG_SCSI_IPR_TRACE is not set

# CONFIG_SCSI_IPR_DUMP is not set

CONFIG_SCSI_PAS16=m

CONFIG_SCSI_PSI240I=m

CONFIG_SCSI_QLOGIC_FAS=m

CONFIG_SCSI_QLOGIC_FC=m

# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set

CONFIG_SCSI_QLOGIC_1280=m

# CONFIG_SCSI_QLOGIC_1280_1040 is not set

CONFIG_SCSI_QLA2XXX=y

CONFIG_SCSI_QLA21XX=m

CONFIG_SCSI_QLA22XX=m

CONFIG_SCSI_QLA2300=m

CONFIG_SCSI_QLA2322=m

CONFIG_SCSI_QLA6312=m

CONFIG_SCSI_LPFC=m

CONFIG_SCSI_SIM710=m

CONFIG_SCSI_SYM53C416=m

CONFIG_SCSI_DC395x=m

CONFIG_SCSI_DC390T=m

CONFIG_SCSI_T128=m

CONFIG_SCSI_U14_34F=m

# CONFIG_SCSI_U14_34F_TAGGED_QUEUE is not set

# CONFIG_SCSI_U14_34F_LINKED_COMMANDS is not set

CONFIG_SCSI_U14_34F_MAX_TAGS=8

CONFIG_SCSI_ULTRASTOR=m

CONFIG_SCSI_NSP32=m

CONFIG_SCSI_DEBUG=m

# Old CD-ROM drivers (not SCSI, not IDE)

# CONFIG_CD_NO_IDESCSI is not set

CONFIG_I2O_SCSI=m

# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information

```

... I don't know what it means but I think it's not right!?

By the way, the scsi tape drive is a HP StorageWorks DAT 40

----------

## m_sqrd

Ok I had to look that one up.

 This driver supports the whole NCR53C8XX/SYM53C8XX family of 

 PCI-SCSI controllers.  It also supports the subset of LSI53C10XX 

 Ultra-160 controllers that are based on the SYM53C8XX SCRIPTS  

 language.  It does not support LSI53C10XX Ultra-320 PCI-X SCSI  

 controllers; you need to use the Fusion MPT driver for that.  

 Please read <file:Documentation/scsi/sym53c8xx_2.txt> for more 

  information.

```

  Device Drivers --->Fusion MPT device support  --->

  

  FUSION=

```

----------

## pounch

So do I have to unload the other SCSI modules?

or can I let them loaded?

And which modules do I have to load with modprobe?

----------

## m_sqrd

I think  all you need is 

Linux Kernel Configuration

Device Drivers --->Fusion MPT device support  ---> <*> Fusion MPT (base + ScsiHost) drivers  <--- This

and

Device Drivers --->SCSI device support  --->

<*> SCSI device support  <--- This

<*>   SCSI tape support <--- This

<*>   SCSI generic support  <--- This

----------

## pounch

It works  :Smile:   :Smile:   :Smile: 

Thanks a lot:wink: 

here is the answer for cat /proc/scsi/scsi

```
backup root # cat /proc/scsi/scsi

Attached devices:

Host: scsi0 Channel: 00 Id: 03 Lun: 00

  Vendor: HP       Model: C5683A           Rev: C305

  Type:   Sequential-Access                ANSI SCSI revision: 03
```

Now I will try to solve this problem

```

backup root # tapeinfo -f /dev/st0

mtx: Request Sense: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00

INQUIRY Command Failed

backup root # mtx -f /dev/st0 status

mtx: Request Sense: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00

INQUIRY command Failed
```

----------

## m_sqrd

I'd check that you have the bus terminated at both ends and that the cable is good. then try

your mt -f /dev/st0 status again

----------

## pounch

Yes the cable is well terminated at both ends and the cable seems good!

The hardware was tested under windows and works ... and all is new!

How can I emerge mt? I can't use it, only mtx or sg ...  When I emerge mt, it's not found!

All the commands I try (mts load, status ...) give me the same error message (like the one posted above) ... 

the tapes contain some data (says the test under windows) so I don't understand why it doesn't work!?

Any idea?

----------

## pounch

How can I load mptscsih ?

```
backup root # modprobe mptscsih

FATAL: Module mptscsih not found.

backup root # find / -name *mptscsi*

/usr/src/linux-2.6.12-gentoo-r6/drivers/message/fusion/mptscsih.c

/usr/src/linux-2.6.12-gentoo-r6/drivers/message/fusion/mptscsih.h

/proc/scsi/mptscsih

backup root # cat /proc/scsi/mptscsih/0

ioc0: LSI53C1030, FwRev=01032500h, Ports=1, MaxQ=222

```

Normally I could load this module? Although the kernel is compiled with the mpt options!

----------

## m_sqrd

mt is under app-arch/mt-st

try that then post again and we'll see where to go from there.

----------

## pounch

Ok I emerged mt successfully! Here is what it sais:

```
backup root # mt -f /dev/st0 status

SCSI 2 tape drive:

File number=0, block number=0, partition=0.

Tape block size 0 bytes. Density code 0x26 (DDS-4 or QIC-4GB).

Soft error count since last status=0

General status bits on (41010000):

 BOT ONLINE IM_REP_EN

backup root # mt -f /dev/st0 tell

At block 0.

backup root # mt -f /dev/st0 seek 1

/dev/st0: Input/output error

```

I guess there is no file on the tape ... but when we read it under windows, there is at least one file ... on gentoo, there would be no file? What's the matter?

```
backup root # sg_ses /dev/st0

  HP        C5683A            C305

    tape device (not an enclosure)

Receive diagnostic error, pcv=1, page_code=0 : SCSI status: Check Condition

 Fixed format, current;  Sense key: Illegal Request

 Additional sense: Invalid field in cdb

  Sense Key Specific: Error in Command byte 1 bit 7

 Raw sense data (in hex):

        70 00 05 00 00 00 00 0e  00 00 00 00 24 00 00 cf

        00 01 00 00 00 00

plus...: Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]

Attempt to fetch status diagnostic page failed

```

----------

## pounch

I try to read the files backuped on the tape:

```
backup test # tar -tvf /dev/st0

tar: /dev/st0: Cannot read: Input/output error

tar: At beginning of tape, quitting now

tar: Error is not recoverable: exiting now

```

This method has been found on http://vertigo.hsrl.rutgers.edu/ug/tape.html

So when I try to access the tape, I hear the drive working normally ... but it seems not reading correctly!

What's up?

----------

## pounch

So I can access data on the tapes!!!

In fact, I had to set up an environnement variable "TAPE"

```
export TAPE="/dev/st0"
```

And now I use the mt commands like this

```
mt status

mt rewind

...
```

Also to read the data on a tape, I have to use the tar command

```
read data: tar t

write data: tar c /path/to/backup

```

 this will read or write directly to the tape.

Thanks to this site http://vertigo.hsrl.rutgers.edu/ug/tape.html

And thanks to all the people (espacially m_sqrd) who have answered my question   :Very Happy: 

----------

