It is currently Thu, 20 Jan 2022 09:44:58 GMT



 
Author Message
 Linux SCSI HOWTO
Archive-name: linux/howto/scsi
Last-modified: 14 Sep 93

Linux SCSI HOWTO by Drew Eckhardt (d...@cs.colorado.edu)
last updated September 14, 1993

This HOWTO covers the Linux SCSI subsystem, as implemented in Linux
kernel revision .99.12 and alpha code available as of September 13, 1993.

For additional information, you may wish to join the SCSI channel of the
Linux activists list - mail to linux-activists-requ...@joker.cs.hut.fi
with the line

X-MN-Admin: join SCSI

in the header.

Table of contents
Section 1                       Common Problems

Section 2                       Reporting Bugs

Section 3                       Hosts
        Subsection A            Supported and Unsupported Hardware
        Subsection B            Common Problems
        Subsection C            Adaptec 152x (ALPHA)
        Subsection D            Adaptec 154x (Standard)
        Subsection E            Adaptec 174x (Standard))
        Subsection F            Allways IN2000 (ALPHA)
        Subsection G            Future Domain TMC-16xx (Standard)
        Subsection H            Generic NCR5380 (ALPHA)
        Subsection I            Seagate ST0x/Future Domain TMC-8xx (Standard)
        Subsection J            Trantor T128/T128F/T228 (ALPHA)
        Subsection K            Ultrastor 14f, 34f (Standard)
        Subsection L            Ultrastor 14f, 24f, 34f (ALPHA)
        Subsection M            Western Digital 7000 (Standard)

Section 4                       Disks
        Subsection A            Supported and Unsupported Hardware
        Subsection B            Common Problems
        Subsection C            Device Files
        Subsection D            Disk Geometry
        Subsection E            Partitioning

Section 5                       CD ROMs
        Subsection A            Supported and Unsupported Hardware
        Subsection B            Common Problems
        Subsection C            Device Files

Section 6                       Tapes
        Subsection A            Supported and Unsupported Hardware
        Subsection B            Common Problems
        Subsection C            Device Files

Section 1 : Common Problems
1.  A SCSI device shows up at all possible IDs

        If this is the case, you've strapped the device at the same
        address as the controller (typically, 7, although some boards
        use other addresses).  Please change the jumper settings.

2.  You get sense errors when you know the devices are error free

        Sometimes this is caused by bad cables or impropper termination.

        Your SCSI bus must be terminated at both ends (using external
        terminators, or onboard terminators on the host adapter or
        devices) and not in the middle.

Section 2 : Reporting Bugs

The Linux SCSI developers don't necessarily maintain old revisions
of the code due to space constraints.  So, if you are not running the
latest publically released Linux kernel (note that many of the Linux
distributions, such as MCC, SLS, Yggdrasil, etc. often lag one or more
revisions behind this) chances are we will be unable to solve your
problem.  So, before reporting a bug, please check to see if it exists
with the latest publically available kernel.

If after upgrading, and reading this document thoroughly, you still
believe that you have a bug, please mail a bug report to the SCSI channel
of the mailing list where it will be seen by many of the people who've
contributed to the Linux SCSI drivers.

In your bug report, please provide as much information as possible
regarding your hardware configuration, and all of the messages that
Linux prints when it boots.  Your chances of getting the bug fixed increase
exponentially with the amount of information provided.  

The bottom line is that if we can't reproduce your bug, and you can't
point at us what's broken, it won't get fixed.

Section 3 : Hosts

Subsection A : Supported and Unsupported Hardware
Drivers in the distribution kernel :

Adaptec 154x (including clones from Bustek and DTC - DTC models that
work are the 3290 and 3292), Adaptec 174x, Future Domain 850, 885, 950,
and other boards in that series (but not the 880 board unless you make
the appropriate patch), Future Domain 16x0,  Seagate ST0x, Ultrastor 14F
and 34F,  and Western Digital 7000

Alpha drivers :
Adaptec 1520 - ftp tsx-11.mit.edu:/pub/linux/ALPHA/scsi/aha1522
        bootable kernel not available.
Allways IN2000 - ftp tsx-11.mit.edu:/pub/linux/ALPHA/scsi/in2000
        driver is in2000.tar.z, bootable kernel zImage
Generic (port mapped) NCR5380
Trantor T128/T128F/T228 - email d...@cs.colorado.edu
        bootable kernel not available
Ultrastor 14F,24F, and 34F - ftp
        tsx-11.mit.edu:/pub/linux/ALPHA/scsi/u24f-driver.tar.z,
        boot kernel available, Image.Ultrastor in the same directory.

SCSI Hosts that would work with a little work :
AIC6260 motherboard controller and Adaptec 1510, using the
        Adaptec 1520 ALPHA driver (same chip)
PAS-16 SCSI port, using the generic NCR5380 ALPHA driver (same chip)
Trantor T130 - using the NCR5380 driver (different chip, 5380
        ASIC cell used)

SCSI Hosts that will not work :

Adaptec 2742, 2742T, non Adaptec compatable DTC boards (including the 3270
and 3280), Mylex, all parallel->SCSI adapters, Rancho SCSI boards,
Grass Roots SCSI boards.

If you want to run Linux on an unsupported piece of hardware, your
options are to either write a driver yourself (Eric Youngdale and I are
usually willing to answer technical questions concerning the Linux
SCSI drivers) or to commision a driver.

Subsection B : Common Problems
1.  SCSI timeouts

        Make sure interrupts are enabled correctly, and there are no
        IRQ, DMA, or address conflicts with other boards.

2.  Boards using the BIOS to autoprobe are not detected (see the
        Autoprobe entry for your host adapter)

        This fails if the BIOS is disabled (see the Autoprobe Override
        entry for your board to see if you can override it) or your
        boards "signature" doesn't match one of the known ones.

        If the BIOS is installed, please use DOS and DEBUG to
        find a signature that will detect your board -

        Ie, if your board lives at 0xc8000 do

        debug
        d c800:0
        q

        and send a message to the SCSI channel of the mailing list with
        the ASCII message, with the length and offset from the base
        address (ie, 0xc8000).  Note that the EXACT text is required.

3.  Boards using memory mapped IO do not work.

        This is often caused when the memory mapped I/O ports
        are incorrectly cached.  You should have the board's
        address space marked as uncachable in the XCMOS settings.

        If this is not possible, you will have to disable cache
        entirely.

4.  The bootable kernel for an ALPHA driver does not work,
        resulting in a "kernel panic : cannot mount root device"
        message, or it does not work with your Linux distribution.

        You'll need to edit the binary image of the kernel (before
        or after writing it out to disk), and modify a few two byte
        fields (little endian) to gurantee that it will work on your
        system.  

        1.  default swap device at offset 502, this should be set to 0

        2.  ram disk size at offset 504, this should be set to the size
                of the boot floppy in K - ie, 5.25" = 1200, 3.5" = 1440.

                This means the bytes are

                3.5" : 0xA0 0x05
                5.25" : 0xB0  0x04

        3.  root device offset at 508, this should be 0, ie the boot
                device.

        dd or rawrite the file to a disk.  Insert the disk in the
        first floppy drive, wait until it prompts you to insert
        the root disk, and insert the root floppy from your
        distribution.

Subsection C : Adaptec 152x
ALPHA via ftp tsx-11.mit.edu:/pub/linux/ALPHA/scsi/aha1522
        bootable kernel not available.
Supported Configurations :
Addresses : 0xd8000, 0xdc000, 0xd0000, 0xd4000, 0xc8000, 0xcc000, 0xe0000,
        0xe4000.
Ports : 0x140, 0x340
IRQs : 9, 10, 11, 12
DMA is not used
IO : port mapped

Autoprobe : works with all supported configurations, requires installed BIOS

Autoprobe Override : none

Defines :
CONF_RECONNECT : configure reconnection from controller's jumpers
RECONNECT      : enable or disable reconnection
CONF_PARITY    : configure reconnection from controller's jumpers
PARIRY         : enable or disable parity
CONF_SCSI_ID   : configure scsi id of controller from its jumpers
SCSI_ID        : Override jumpered SCSI-ID

Notes : The Adaptec 152x boards are built arround the AIC-6260.  With
        minor modifications, things should work with the 1510 and
        AIC-6260 motherboard SCSI controllers.

Subsection D : Adaptec 154x
Supported Configurations :
Ports : 0x330 and 0x334
IRQs : 9, 10, 11, 12, 14, 15
DMA channels : 5, 6, 7
IO : port mapped, bus master

Unsupported Configurations:
The 'C' revision BIOS options to
- Autoprobe
- Support > 2 hard disks with the BIOS
- Do extended mapping

Autoprobe : works with all supported configurations, does not
        require an installed BIOS.

Autoprobe override : none

Common problems :

1.  There are unexpected errors with a revision C board.
        Early examples of the 154xC boards have a high slew rate on
        one of the SCSI signals, which results in signal reflections
        when cables with the wrong impedance are used.

        Try changing the cables, ESPECIALLY if you are using
        external cables.

2.  There are error messages (ie, interrupt received, no mail) during
        initialization with the C revision boards.

        These may result from the use of one of the unsupported BIOS
        options.  Turn it off.

Subsection E : Adaptec 174x
Supported Configurations :
Slots : 1-8
Ports : EISA board, not applicable
IRQs : 9, 10, 11, 12, 14, 15
DMA Channels : EISA board, not applicable
IO : port mapped, bus master

Autoprobe : works with all supported configurations

Autoprobe override : none

Common Problems :
1. If the Adaptec 1740 driver prints the message
        "aha1740: Board detected, but EBCNTRL = %x, so disabled it."

        your board was disabled because it was not running in enhanced
        mode.  Boards running in standard 1542 mode are not supported.

Subsection F : Allways IN2000
ALPHA available via ftp tsx-11.mit.edu/pub/linux/ALPHA/SCSI/in2000
        driver is in2000.tar.z, bootable kernel zImage
Ports : 0x100, 0x110, 0x200, 0x220
IRQs : 10, 11, 14, 15
DMA is not used
IO : port mapped

Autoprobe : BIOS not required

Autoprobe override : none

Common Problems :

1.  There are known problems in systems with IDE drives and with
        swapping.

Subsection G : Future Domain TMC-16xx
Supported Configurations :
Ports : 0x140, 0x150, 0x160, 0x170
IRQs : 3, 5, 10, 11, 12, 14, 15
DMA is not used
IO : port mapped

Autoprobe : works with all supported configurations, requires
        installed BIOS

Autoprobe Override : none

Subsection H : Generic NCR5380 (ALPHA)
Supported and Unsupported Configurations :
Ports : all
IRQs : all
DMA channels - DMA is not used
IO : port mapped

Autoprobe : none

Autoprobe Override :
Compile time : Define GENERIC_NCR5380_OVERRIDE to be an array of tupples
with port, irq - ie
#define GENERIC_NCR5380_OVERRIDE {{0x330, 5,}}

for a board at port 330, IRQ 5.

The symbolic IRQs IRQ_NONE and IRQ_AUTO may be used.

LILO command line : ncr5380=port,irq

-1 may be used for no irq, -2 for irq autoprobe.

Notes : the generic driver doesn't support DMA yet, and pseudo-DMA
        isn't supported in the generic driver.

Subsection I : Seagate ST0x/Future Domain TMC-8xx
Supported and Unsupported Configurations :
Base addresses : 0xc8000, 0xca000, 0xcc000, 0xce000, 0xdc000, 0xde000
IRQs : 3, 5
DMA channels : DMA is not used
IO : memory mapped

Autoprobe : probes for address only, IRQ is assumed to be 5,
        requires installed BIOS.

Autoprobe Override :
Compile time : Define OVERRIDE to be the base address, CONTROLLER to
FD or SEAGATE as appropriate, and IRQ to the IRQ.

LILO command line : st0x=irq, address or fd88x=irq, address.

Common Problems :

1.  There are command timeouts when Linux attempts to read the partition
    table or do other disk access.

    The board ships with the defaults set up for MSDOS, ie interrupts
    are disabled.  To jumper the board for interrupts, on the Seagate
    use jumper W3 (ST01) or JP3 (ST02) and short pins F-G to select
    IRQ 5.

2.  The driver can't handle some devices, particularly cheap SCSI
    tapes and CDROMs.

    The Seagate ties the SCSI bus REQ/ACK handshaking into the PC bus
    IO CHANNEL READY and (optionally) 0WS signals.  Unfortunately, it
    doesn't tell you when the watchdog timer runs out, and you have
    no way of knowing for certain that REQ went low, and may end up
    seeing one REQ pulse as multiple REQ pulses.

    Dealing with this means using a tight loop to look for REQ to
    go low, with a timeout incase you don't catch the transition due
    to an interrupt, etc.  This results in a performance decrease, so it
    would be undesireable to apply this to all SCSI devices.  Instead,
    it is selected on a per-device basis with the "borken" field for
    the given SCSI device in the scsi_devices array.  If you run into
    problems, you should try adding your device to the list of
    devices for which borken is not reset to zero (currently,
    only the TENEX CDROM drives).

Defines :

FAST or FAST32 will use blind transfers where possible

ARBITRATE will cause the host adapter to arbitrate for the
        bus for better SCSI-II compatability, rather than just
        waiting for BUS FREE and then doing it's thing.  Should
        let us do one command per Lun when I integrate my
        reorganization changes into the distribution sources.

SLOW_HANDSHAKE will allow compatability with broken devices that don't
        handshake fast enough (ie, some CD ROM's) for the Seagate
        code.

SLOW_RATE=x, x some number will let you specify a default
        transfer rate if handshaking isn't working correctly.

Subsection J : Trantor T128/T128F/T228 (ALPHA)
Supported and Unsupported Configurations :
Base addresses :  0xcc000, 00xc8000, 0xdc000, 0xd8000
IRQs : none, 3, 5, 7 (all boards)
        10, 12, 14, 15 (T128F only)
DMA is not used.
IO : memory mapped

Autoprobe : works for all supported configurations, requires
        installed BIOS.

Autoprobe Override :
Compile time : Define T128_OVERRIDE to be an array of address, irq
tupples.  Ie

#define T128_OVERRIDE {{0xcc000, 5}}

for a board at address 0xcc000, IRQ 5.

The symbolic IRQs IRQ_NONE and IRQ_AUTO may be used.

LILO command line : t128=address, irq

-1 may be used for no irq, -2 for irq autoprobe.

Defines :
AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
for commands that return with a CHECK CONDITION status.

PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance
increase compared to polled I/O.

PARITY - enable parity checking.  Not supported

SCSI2 - enable support for SCSI-II tagged queueing.  Untested

UNSAFE - leave interrupts enabled during pseudo-DMA transfers.  You
         only really want to use this if you're having a problem with
         dropped characters during high speed communications, and even
         then, you're going to be better off twiddling with transfersize.

USLEEP - enable support for devices that don't disconnect.  Untested.

Subsection K : Ultrastor 14f, 34f
Supported and Unsupported Configurations :
Ports : 0x130, 0x140, 0x210, 0x230, 0x240, 0x310, 0x330, 0x340
IRQs : 10, 11, 14, 15
DMA channels : 5, 6, 7
IO : port mapped, bus master

Autoprobe : does not work for boards at port 0x310, BIOS not required.  

Autoprobe override : compile time only, define PORT_OVERRIDE

Subsection L : Ultrastor 14f, 24f, 34f (ALPHA)
ALPHA via ftp tsx-11.mit.edu:/pub/linux/ALPHA/scsi/u24f-driver.tar.z,
        boot kernel available, Image.Ultrastor in the same directory.
Ports : 0x130, 0x140, 0x210, 0x230, 0x240, 0x310, 0x330, 0x340
IRQs : 10, 11, 14, 15
DMA channels : 5, 6, 7
IO : port mapped, bus master

Autoprobe : does not work for boards at port 0x310, BIOS not required.  

Autoprobe override : compile time only, define PORT_OVERRIDE

Subsection L : Western Digital 7000
Supported Configurations :
BIOS Addresses : 0xce000
Ports : 0x350
IRQs : 15
DMA Channels : 6
IO : port mapped, bus master

Autoprobe :  requires installed BIOS

Common Problems :

1.  There are several revisisions of the chip and firmware.  Supposedly,
        revision 3 boards do not work, revision 5 boards do,
        chips with no suffix do not work, chips with an 'A' suffix do.

Section 4 : Disks
Subsection A : Supported and Unsupported Hardware

All direct access SCSI devices with a block size of 256, 512, or
1024 bytes should work.  Other block sizes will not work.

Removeable media devices, including Bernoulis, flopticals, and MO drives
should work.  Other sector sizes will not work.

Subsection B: Common Problems

1.  When partitioning, you get a warning message about "cylinder > 1024"
        or you are unable to boot from a partition including a logical
        cylinder past logical cylinder 1024.

        This is a BIOS limitation.

        See Subsection D, Disk Geometry, for an explanation.

2.  You are unable to partition /dev/hd*

        /dev/hd* aren't SCSI devices, /dev/sd* are.  

        See Subsection C, Device files, and Subsection E, partitioning
        for the correct device names and partitioning procedure.

3.  Removeable media devices are not recognized at boot time.

        Try booting with a disk in the drive.

Subsection C : Device Files

SCSI disks use block device major 8, and there are no "raw" devices
ala BSD.

16 minor numbers are allocated to each SCSI disk, with minor % 16 == 0
being the whole disk, minors  1 <= minor % 16 <= 4 the four primary
partitions, minors 5 <= minor & 16 <= 15 any extended partitions.

Due to constraints imposed by Linux's use of a six{*filter*} bit dev_t with
only eight bits allocated to the minor number, the SCSI disk minor
numbers are assigned dynamically starting with the lowest SCSI HOST/ID/LUN.

Ie, a configuration may work out like this (with one host adapter)
Device                  Target, Lun             SCSI disk
84M Seagate             0       0               /dev/sda
SCSI->SMD bridge disk 0      3       0               /dev/sdb
SCSI->SMD bridge disk 1      3       1               /dev/sdc
Wangtek tape            4       0               none
213M Maxtor             6       0               /dev/sdd

Etc.  

The standard naming convention is

/dev/sd{letter} for the entire disk device (minor 0)
/dev/sd{letter}{partition} for the partitions on that device (minor 0 - 15)

Ie

/dev/sda
/dev/sda1
/dev/sda2
/dev/sdb

etc.

Subsection D: Disk Geometry

The problem with partitioning SCSI disks and Linux is that Linux talks
directly to the SCSI interface.  Each disk is viewed as the SCSI host
sees it : N blocks, numbered from 0 to N-1, all error free.  There is
no portable way to get disk geometry.  Conversly, DOS predates
intelligent disks, and requires a head / cylinder / sector mapping.

If you don't care about using DOS, create a translation such that
H * C * S / 2 < size of your drive in megabytes (where a megabyte is
defined as 2^20 bytes).

Otherwise, you'll have to use the BIOS mapping.  In some cases, this
will mean reconfiguring the disk so that it is at SCSI ID 0, and
disabling the second IDE drive (if you have one).

You can either use a program like NU, or you can use the following
DEBUG code :

a 0100
mov ah, 8
int 3

g=0100
d

The BIOS imposed limits on the mapped disk geometry are  

1 <= # of heads <= 256
1 <= # of cylinders <= 1024
1 <= # of sectors <= 63

So, if you create a partition that includes logical cylinders at or
past logical cylinder 1024, it will be inaccessable to the BIOS and
you will be unable to boot kernels from it.  Since Linux uses the
relative sector and length fields in the partition table, and not
the head, cylinder, sector tuples, it is not bound by this restriction
and you will have no problems accessing the partition once Linux is
booted.

You can partition your SCSI disks using the partitioning program
of your choice, under DOS, OS/2, Linux or any other operating
system supporting the standard partitioning scheme.

The correct way to run the Linux fdisk program is by specifying the
device on the command line. Ie, to partition the first SCSI disk,

fdisk /dev/sda

If you don't explicitly specify the device, the partitioning program
may default to /dev/hda, which isn't a SCSI disk.

In some cases, you will get a warning message about a partition ending
past cylinder 1024, see Subsection D, Disk Geometry for an explanation.

Section 5 : CD ROMs

Subsection A: Supported and Unsupported Hardware

SCSI CD's with a block size of 512 or 2048 bytes should work.  Other
block sizes will not work.

Subsection B: Common Problems

1.  The device is not recognized at boot time.
        Try booting with a CDROM in the drive.

Subsection C: Device Files

SCSI CD ROMs use major 11.

Minors are allocated dynamically (See Section 4, Disks, Subsection C,
Device Files for an example) with the first CDROM found being minor 0,
the second minor 1, etc.

The standard naming convention is

/dev/sr{digit} ie

/dev/sr0
/dev/sr1

etc.

Section 6 : Tapes
Subsection A : Supported and Unsupported Hardware

All SCSI tape drives should work.

Subsection B : Common Problems
1.  The tape drive is not recognized at boot time
        Try booting with a tape in the drive.

Subsection C : Device Files

SCSI tapes use character device major 9.  

Due to constraints imposed by Linux's use of a six{*filter*} bit dev_t with
only eight bits allocated to the minor number, the SCSI tape minor
numbers are assigned dynamically starting with the lowest SCSI HOST/ID/LUN.

Rewinding devices are numbered from 0 - with /dev/st0 being c 9 0,
/dev/rst1 c 9 1, etc.  Non-rewinding devices have the high bit set -
ie /dev/nrst0 is c 9 128.

The standard naming convention is
/dev/nrst{digit}        for non-rewinding devices
/dev/rst{digit}         for rewingind devices

--
Send submissions for comp.os.linux.announce to: linux-annou...@tc.cornell.edu



 Wed, 06 Mar 1996 07:20:17 GMT   
 
   [ 1 post ] 

Similar Threads

1. Linux SCSI HOWTO (part 1/3)

2. Linux SCSI HOWTO (part 1/3)

3. Linux SCSI HOWTO (part 1/3)

4. Linux SCSI HOWTO (part 2/3)

5. Linux SCSI HOWTO (part 1/3)

6. Linux SCSI HOWTO (part 1/2)

7. Linux SCSI HOWTO (part 2/2)

8. Linux SCSI HOWTO (part 1/2)

9. Linux SCSI HOWTO (part 1/3)

10. Linux SCSI HOWTO (part 1/3)


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software