From: Drew Eckhardt <drew@kinglear.cs.Colorado.EDU>
Newsgroups: comp.os.linux.announce,comp.os.linux.admin
Subject: Linux SCSI HOWTO
Date: 15 Dec 1993 22:09:41 GMT
Approved: linux-announce@tc.cornell.edu (Matt Welsh)
Message-ID: <2eo1v5$656@samba.oit.unc.edu>

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

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

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

X-MN-Admin: join SCSI

in the header.

I'm aware that this document isn't the most user-friendly, if 
you have constructive comments on how to rectify the situation
you're free to mail me about it.

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 151x, 152x (ALFALFA diffs)
	Subsection D		Adaptec 154x (Standard)
	Subsection E		Adaptec 174x (Standard))
	Subsection F		Allways IN2000 (ALPHA)
	Subsection G		Future Domain 16x0 with TMC-1800 or 
				TMC-18C50 chip (Standard)
	Subsection H		Generic NCR5380 (ALFALFA diffs)
	Subsection I		Seagate ST0x/Future Domain TMC-8xx/TMC-9xx 
					(Standard)
	Subsection J		Trantor T128/T128F/T228 (ALFALFA diffs) 
	Subsection K		Ultrastor 14f, 34f (Standard)
	Subsection L		Ultrastor 14f, 24f, 34f (ALFALFA diffs)
	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 7			Generic 
	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.

3.  A kernel configured with networking does not work.

	The auto-probe routines for many of the network drivers 
	are not passive, and will interfere with operation with some
	of the SCSI drivers.

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 with TMC-1800 or TMC-18C50 chip,
Seagate ST0x, Ultrastor 14F and 34F,  and Western Digital 7000 

Drivers included in ALFALFA diffs : 
Adaptec 1520,  Ultrastor 14F, 24F, 34F, Trantor T128/T128F/T228

ALFALFA diffs are available from tsx-11.mit.edu:/pub/linux/ALPHA/scsi
	0.99.13.scsipatch.txt
A bootable kernel incorporating the ALFALFA disks is 
	0.99.13.scsipatch.zImage

Alpha drivers :
Allways IN2000

Drivers that are being developed, but aren't publically available 
PAS-16 (based on my NCR5380 driver, works if booted with a CD in 
	the drive but fails if none is there or there is a disk change)
Richoch NCR5380 (based on my NCR5380 driver, works but gives low 
	(ie 50K/sec) performance since DMA transfers are not used 
	yet)
NCR539x (The main motivation for this is that the R4000 based 
	MIPS boards will be using a NCR53cf9x of some flavor.  However,
	since the hardware isn't here yet, the driver is in no hurry)_

SCSI Hosts that would work with a little work : 
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, under DOS 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.

5.  Installing a device driver not bundled with the distribution kernel
	You need to start with the version of the kernel used by the 
	driver author.  This revision may be alluded to in the documentation
	included with the driver.

	Various recent kernel revisions can be found at 
		nic.funet.fi:/pub/OS/Linux/PEOPLE/Linus

	as linux-version.tar.gz

	They are also mirrored at tsx-11.mit.edu and various other sites.

	cd to /usr/src.

	Remove your old Linux sources, if you want to keep a backup copy
	of them

	mv linux linux-old

	or whatever.

	Untar the archive

	gunzip < linux-0.99.12.tar.gz | tar xvfp -

	Apply the patches.  The patches will be relative to some directory
	in the filesystem.  By examining the output file lines in the patch
	file (grep for ^---), you can tell where this is - ie patches with 
	these lines

	--- ./kernel/blk_drv/scsi/Makefile

	--- ./config.in Wed Sep  1 16:19:33 1993


	would have the files relative to /usr/src/linux.

	Untar the driver sources at an appropriate place - you
	can do a 

	tar tfv patches.tar 

	or whatever to get a listing, and move files as necessary
	(The SCSI driver files should live in /usr/src/linux/kernel/blk_drv/
	scsi)

	Either cd to the directory they are relative to and do a 

	patch -p0 < patch_file

	or tell patch to "strip off" leading paths components.  Ie,
	if the files started with

	--- linux-new/kernel/blk_drv/scsi/Makefile 

	and you wanted to apply them while in /usr/src/linux, you 
	could cd to /usr/src/linux and do a 

	patch -p1 <  patches 

	to strip off the "linux-new" component.

	After you have applied the patches, look for any patch rejects,
	which will be the name of the rejected file with a # suffix appended.

	Ie

	find /usr/src/linux/ -name "*#" -print 

	If any of these exist, look at them.  In some cases, the 
	differences will be in RCS identifiers and will be harmless,
	in other cases, you'll have to manually apply important 
	parts.  Documentation on diffs files and patch is beyond the
	scope of this document.

	Next, cd to /usr/src/linux and do a 

	make config

	to choose the options you want

	If you are installing off of floppy disk, you'll also have to 
	edit the Makefile to set the ROOT device to ramdisk.

	do a make depend

	followed by 

	make

	You should end up with a file "zImage".  Write this out to a floppy
	disk -

	cat zImage > /dev/fd0

	and use that to boot your system.  When it comes up, it should prompt
	for the root floppy, use a1 from SLS or whatever and you'll be fine.

Subsection C : Adaptec 151x, 152x (ALFALFA diffs)
ALFALFA diffs are available from tsx-11.mit.edu:/pub/linux/ALPHA/scsi
        0.99.13.scsipatch.txt
A bootable kernel incorporating the ALFALFA disks is
        0.99.13.scsipatch.zImage

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 : 
Compile time : 
Define PORTBASE, IRQ, SCSI_ID, RECONNECT as appropriate, see Defines

LILO commandline : aha152x=<PORTBASE>,<IRQ>,<SCSI-ID>,<RECONNECT>

Defines : 
AUTOCONF      : use configuration the controller reports (only 152x)
IRQ           : override interrupt channel (9,10,11 or 12) (default 11)
SCSI_ID       : override scsiid of AIC-6260 (0-7) (default 7)
RECONNECT     : override target dis-/reconnection/multiple 
	outstanding command - set to non-zero to enable, zero to
	disable.
DONT_SNARF     : Don't register ports (pl12 and below)
SKIP_BIOSTEST  : Don't test for BIOS signature (AHA-1510 or disabled BIOS)
PORTBASE       : Force port base. Don't try to probe

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

Antiquity Problems, fix by upgrading : 

1.  Linux kernel revisions prior to .99.10 don't support the 'C' 
	revision.

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 16x0 with TMC-1800 or TMC-18C50 chip
Supported Configurations :
BIOSs :  2.0, 3.0, 3.2
BIOS Addresses :    0xc8000, 0xca000, 0xce000, 0xde000
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

Antiquity Problems, fix by upgrading : 

1.  Old versions do not support the TMC-18C50 chip, and will fail with
	newer boards. 

2.  Old versions will not have the most current BIOS signatures for 
	autodetection.

Subsection H : Generic NCR5380 (ALFALFA diffs)
ALFALFA diffs are available from tsx-11.mit.edu:/pub/linux/ALPHA/scsi
        0.99.13.scsipatch.txt
A bootable kernel incorporating the ALFALFA disks is
        0.99.13.scsipatch.zImage

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

255 may be used for no irq, 254 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/TMC-9xx 
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=address,irq or fd8xx=address,irq

Antiquity Problems, fix by upgrading :

1.  Versions prior to the one in the Linux .99.12 kernel had a problem
	handshaking with some slow devices, where

	This is what happens when you write data out to the bus

	1.  Write byte to data register, data register is asserted to bus
	2.  time_remaining = 12us
	3.  wait while time_remaining > 0 and REQ is not asserted
	4.  if time_remaining > 0, assert ACK
	5.  wait while time remaining > 0  and REQ is asserted
	6.  deassert ACK

	The problem was encountered in slow devices that do the command
	processing as they read the command, where the REQ/ACK handshake
	takes over 12us - REQ didn't go false when the driver expected it
	to, so the driver ended up sending multiple bytes of data for
	each REQ pulse.

2.  With Linux .99.12, a bug was introduced when I fixed the arbitration
	code, resulting in failed selections on some systems.  This was
	fixed in .99.13.

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).

3.  A future domain board (most notably the 880) doesn't work.
	
	A few of the Future domain boards use the Seagate 
	register mapping, and have the MSG and CD bits of the 
	status register flipped.

	You should edit seagate.h, swapping the definitions for 
	STAT_MSG and STAT_CD, and recompile the kernel with 
	CONTROLLER defined to SEAGATE and an appropriate 
	IRQ and OVERRIDE specified.

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 its 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 (ALFALFA diffs)
ALFALFA diffs are available from tsx-11.mit.edu:/pub/linux/ALPHA/scsi
        0.99.13.scsipatch.txt
A bootable kernel incorporating the ALFALFA disks is
        0.99.13.scsipatch.zImage

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

Common Problems :
1.  The default address for the board, 0x310, is not supported by the 
	autoprobe code, and may cause conflicts if networking is enabled.

	Please use a different address.

2.  The networking code probes at some of the addresses, and breaks 
	the driver.  Try a different address, or build a kernel without
	networking support.

Subsection L : Ultrastor 14f, 24f, 34f (ALFALFA diffs)
ALFALFA diffs are available from tsx-11.mit.edu:/pub/linux/ALPHA/scsi
        0.99.13.scsipatch.txt
A bootable kernel incorporating the ALFALFA disks is
        0.99.13.scsipatch.zImage

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

Common Problems :
1.  The default address for the board, 0x310, is not supported by the 
	autoprobe code, and may cause conflicts if networking is enabled.

	Please use a different address.

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 sixteen 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 CDs 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.

2.  You can't mount a CDROM
        The correct syntax to mount an ISO-9660 CDROM is

        mount -t iso9660 /dev/sr0 /mount_point

        Note that for this to work, you must have the kernel
        configured with support for SCSI, your host adapter,
        the SCSI CDROM driver, and the iso9660 filesystem.


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

Drives using both fixed and variable length blocks smaller than the
the driver buffer length (set to 32K in the distribution sources) are
supported.

Parameters (block size, buffering, density) are set with ioctls
(usually with the mt program), and remain in effect after the 
device is closed and reopened.

Subsection B : Common Problems
1. The tape drive is not recognized at boot time.

	Try booting with a tape in the drive.

2.  When reading a tape with multiple files, the first tar 
	is successful, a second tar fails silently, and retrying 
	the second tar is successful.

	User level programs, such as tar, don't understand file marks.
	The first tar reads up until the end of the file.  The second 
	tar attempts to read at the file mark, gets nothing, but the 
	tape spaces over the file mark.  The third tar is successful
	since the tape is at the start of the next file.

	Use mt on the no-rewind device to space forward to the next file.

3.  Reading compressed archives fails at the end.

4.  Decompressing programs cannot handle the zeros padding the 
	last block of the file. 

	To prevent warnings and errors, wrap your compressed files 
	in a .tar file - ie, rather than doing 

	tar cfvz /dev/nrst0 file.1 file.2 ...

	do 

	tar cfvz tmp.tar.z file.1 file.2 ...

	tar cf /dev/nrst0 tmp.tar.z

5.  You can't read a tape made with another operating system or
	another operating system can't read a tape written in Linux.

	Different systems often use different block sizes.  On a
	tape device using a fixed blocksize, you will get errors 
	when reading blocks written using a different block size.

	Things that can help you to determine the correct block 
	size include 

	- tar defaults to 20 512 byte blocks, ie blocksize = 10k
	- Linux prints the blocksize on bootup

Subsection C : Device Files

SCSI tapes use character device major 9.  

Due to constraints imposed by Linux's use of a sixteen 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

Section 7 : Generic 
Subsection A : Supported Hardware 

The Generic SCSI device driver provides an interface for sending 
SCSI commands to all SCSI devices - disks, tapes, CDROMs, media
changer robots, etc. 

Everything electrically compatable with your SCSI board should work.

Subsection B : Common Problems

Subsection C : Device Files

SCSI generic devices use character major 21.  Due to constraints 
imposed by Linux's use of a 16 bit dev_t, minor numbers are dynamically
assigned from 0, one per device, with

/dev/sg0 

corresponding to the lowest numerical target/lun on the first 
SCSI board.

-- 
Boycott USL/Novell for their absurd anti-BSDI lawsuit. | Drew Eckhardt, 
Condemn Colorado for Amendment Two.		       | Professional Linux 
Use Linux, the fast, flexible, and free 386 unix       | Consultant
Will administer Unix for food                          | drew@cs.Colorado.EDU

