# IDE Tape hangs after MT command

## r0bbyr0b

Hi,

I am slowly moving over from RedHat to Gentoo, but cannot get my tape drive working - it just hangs the entire system after issuing the first MT command. I used to type:

 *Quote:*   

> mt -f /dev/hto rewind
> 
> mt -f /dev/ht0 retension
> 
> tar -cf /dev/ht0 /home

 

this used to rewind the tape (a Seagate Travan IDE 20Gb Drive), retension it then backup the home directories.

I have emerged MT-ST, and compiled tape support into my kernel (I think).

This is what my dmesg says:

 *Quote:*   

> hda: ST360021A, ATA DISK drive
> 
> hdc: E-IDE CD-ROM CR-856E, ATAPI CD/DVD-ROM drive
> 
> hdd: Seagate STT20000A, ATAPI TAPE drive
> ...

 

I have noticed this post https://forums.gentoo.org/viewtopic.php?t=31212&highlight=tape+backup but would really like to use the MT command to rewind/retension/erase etc. Is there a better way in Gentoo to use a tape drive?

I'm not even sure I have compiled tape support in properly - can someone let me know the correct bits to * or M in the kernel?

Thanks!

----------

## r0bbyr0b

I have also tried the following commands:

 *Quote:*   

> root@holly rob # tar -cvf /dev/nst0 /home
> 
> tar: /dev/nst0: Cannot open: Permission denied
> 
> tar: Error is not recoverable: exiting now
> ...

 

Something tells me I havn't loaded the 'st' module but I do not know where to find it.

----------

## jasonlee9

r00byr0b,

i too get the mt command hanging - very frustrating. i'm using an onstream di-30 ide tape, which is not the seagate tape, but still, it looks similar on boot:

hda: QUANTUM FIREBALLP LM20.4, ATA DISK drive

hdc: SAMSUNG SC-148B, ATAPI CD/DVD-ROM drive

hdd: OnStream DI-30, ATAPI TAPE drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

ide1 at 0x170-0x177,0x376 on irq 15

blk: queue c0182dc4, I/O limit 4095Mb (mask 0xffffffff)

hda: 39876480 sectors (20417 MB) w/1900KiB Cache, CHS=2482/255/63, UDMA(66)

hdc: ATAPI 48X CD-ROM drive, 128kB Cache, DMA

Uniform CD-ROM driver Revision: 3.12

ide-tape: Dumping ATAPI Identify Device tape parameters

ide-tape: Protocol Type: <6>ATAPI

ide-tape: Device Type: 1 - <6>Streaming Tape Device

ide-tape: Removable: Yes

ide-tape: Command Packet DRQ Type: <6>Accelerated DRQ

ide-tape: Command Packet Size: <6>12 bytes

ide-tape: Model: OnStream DI-30

ide-tape: Firmware Revision: 1.08

ide-tape: Serial Number: 

ide-tape: Write buffer size: 159744 bytes

ide-tape: DMA: Yes

ide-tape: LBA: No

ide-tape: IORDY can be disabled: No

ide-tape: IORDY supported: Yes

ide-tape: ATAPI overlap supported: No

ide-tape: PIO Cycle Timing Category: 2

ide-tape: DMA Cycle Timing Category: 0

ide-tape: Single Word DMA supported modes: <6>

ide-tape: Multi Word DMA supported modes: <6>0 <6>1 <6>2 <6>

ide-tape: Enhanced PIO Modes: Mode 3

ide-tape: Minimum Multi-word DMA cycle per word: <6>120 ns

ide-tape: Manufacturer's Recommended Multi-word cycle: <6>120 ns

ide-tape: Minimum PIO cycle without IORDY: <6>120 ns

ide-tape: Minimum PIO cycle with IORDY: <6>120 ns

ide-tape: hdd <-> ht0: OnStream DI-30 rev 1.08

ide-tape: Dumping the results of the MODE SENSE packet command

ide-tape: Mode Parameter Header:

ide-tape: Mode Data Length - 23

ide-tape: Medium Type - 218

ide-tape: Device Specific Parameter - 16

ide-tape: Block Descriptor Length - 0

ide-tape: Capabilities and Mechanical Status Page:

ide-tape: Page code - 42

ide-tape: Page length - 18

ide-tape: Read only - No

ide-tape: Supports reverse space - No

ide-tape: Supports erase initiated formatting - No

ide-tape: Supports QFA two Partition format - No

ide-tape: Supports locking the medium - Yes

ide-tape: The volume is currently locked - No

ide-tape: The device defaults in the prevent state - No

ide-tape: Supports ejecting the medium - Yes

ide-tape: Supports error correction - Yes

ide-tape: Supports data compression - No

ide-tape: Supports 512 bytes block size - No

ide-tape: Supports 1024 bytes block size - No

ide-tape: Supports 32768 bytes block size / Restricted byte count for PIO transfers - Yes

ide-tape: Maximum supported speed in KBps - 1048

ide-tape: Continuous transfer limits in blocks - 1

ide-tape: Current speed in KBps - 990

ide-tape: Buffer size - 2097152

ide-tape: Adjusted block size - 32768

ide-tape: hdd <-> ht0: Tape length 14429MB (19239 frames/track, 24 tracks = 461736 blocks, density: 64Kbpi)

ide-tape: 32KB play back: Yes

ide-tape: 32.5KB play back: No

ide-tape: 32KB record: Yes

ide-tape: 32.5KB record: No

ide-tape: hdd <-> ht0: 990KBps, 64*32kB buffer, 10208kB pipeline, 60ms tDSC, DMA

the above is somewhat similar to your seagate output. in my kernel, i just compile in the things i need and don't even modularize them. these are the options i have compiled in:

ATA/IDE/MFM/RLL support --->

  IDE, ATA and ATAPI Block devices --->

    <*> Include IDE/ATAPI TAPE support

    <  > SCSI emulation support (NOT CHECKED)

that's pretty much it - not too helpful, i know.  i found the following on the onstream site about what they recommended and why they did not recommend ide-tape (this may not really apply to you though):

 *Quote:*   

> We strongly recommend to use the ide-scsi + osst solution instead of the ide-tape driver for IDE drives. Tapes that are written with ide-tape can be read with osst, but the other way around is not possible because ide-tape writes according to the LIN3 logical format while osst uses the LIN4 logical format, an extension to LIN3. The ide-tape driver doesn't recognize this LIN4 format.

 

i think i'm gonna try to recompile my kernel and take out ide-tape support in favor of scsi emulation support. if i can get it to work, i'll post anything i find here.

----------

## jasonlee9

Like I said before, I'm not sure how much this will help with the Seagate IDE tape, but it might.

Kernel:

So in the kernel I made sure these options were un/checked:

```
ATA/IDE/MFM/RLL support --->

  IDE, ATA and ATAPI Block devices --->

    < > Include IDE/ATAPI TAPE support

    <*> SCSI emulation support

SCSI support --->

  <*> SCSI support

  <*> SCSI disk support

  <*> SCSI tape support

  <*> SCSI OnStream SC-x0 tape support (Your mileage may vary here)

```

Then i did a full kernel build. 

Then made sure /boot/grub/grub.conf was updated accordingly. Make sure that hdx=scsi is appended to your kernel command. mine looks like so:

kernel (hd0,0)/bzImage root=/dev/hda3 pci=noacpi hdd=scsi

hdd is my tape slave device on ide interface 2, so adjust yours accordingly.

Then when I did a reboot I got the following info:

SCSI subsystem driver Revision: 1.00

scsi0 : SCSI host adapter emulation for IDE ATAPI devices

  Vendor: OnStream  Model: DI-30             Rev: 1.08

  Type:   Sequential-Access                  ANSI SCSI revision: 02

st: Found incompatible tape at scsi0, channel 0, id 0, lun 0

st: The suggested driver is osst.

osst :I: Tape driver with OnStream support version 0.9.10

osst :I: $Id: osst.c,v 1.65 2001/11/11 20:38:56 riede Exp $

osst :I: Attached OnStream DI-30 tape at scsi0, channel 0, id 0, lun 0 as osst0

After that I logged in an typed:

mt -f /dev/st0 status

and got:

OnStream SC-, DI-, DP-, or USB tape drive:

File number =0, block number =0.

Tape block size 512 bytes. Density code 0x40 (DLT1 40 GB, or Ultrium)

Soft error count since last status=0

General status bits on (41010000):

 BOT ONLINE IM_REP_EN

Then i just did a quick tar backup and it worked no problem.

Again, I know this is pretty Onstream specific, but, maybe it'll help with some of the SCSI and non IDE-TAPE stuff.

Good luck.

----------

## r0bbyr0b

Works perfectly! 

I can backup and restore files from the tape now,

Thanks!

----------

## NickDaFish

Whoooo yeah   :Twisted Evil: 

<pelvic thrust>

<pelvic thrust>

<pelvic thrust>

Boy that's been p'in me off...... nice job jasonlee9! I was ready to drag my drive out and test it's areodynamics... but it works great now!

----------

## Angel666

I have a Seagate 8GB drive, the  Seagate STT8000A ATAPI TAPE drive, and i was unable to mount it at all using the standard ATAPI IDE drivers. 

It turns out that this method, of forcing the kernel to mount it as a SCSI device, made it all work perfectly and now i can access it fine. Even though its not an OnStream tape, it worked flawlessly.

Thanks jasonlee9!    :Very Happy: 

----------

