Messages in this thread | | | Date | Wed, 25 Nov 1998 22:42:21 +0100 | From | Rolf Fokkens <> | Subject | PATCH: Different SCSI ordering for WIDE SCSI chains. |
| |
The nice thing about Wide SCSI (besides the speed) is the fact that a SCSI ID of a Wide SCSI device can have 16 different values, which gives the possibility to connect 16 devices on a SCSI chain without using the "LUN-mechanism". For backward compatibility you can connect non-wide devices on a wide-chain too, but their ID's range from 0 to 7. Furhermore I heard that non-wide take actually two ID's when connected on a WIDE chain: the configured ID and that ID+8. They can be addressed by their own ID, but the other ID is lost.
The nice thing about SCSI in general is that external devices can easily be connected. When having some internal wide devices and a non-wide external device we can get complications however. In my case, I have 2 internal wide devices and 1 (non-wide) CD-ROM player. To be able to connect as much external devices as possible, I chose ID's 1 and 9 for the WIDE devices, 6 for the CD-ROM and 7 for the Adapter. This way I can connect up to 5 external non-wide devices (ID's 0, 2, 3, 4 and 5 are still free).
Now comes the catch: when I DO connect an external non-wide device, it's ID is between the ID's of the internal wide devices (unless it hat ID 0). This causes problems during boot when I have connected an external device: what used to be /dev/sdb has become /dev/sdc. Now /etc/fstab is no longer accurate!
To avoid this problem, I changed the scanning order for wide scsi devices in the kernel. I changed it to: 0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15. This means that wide devices are always checked in pairs. Now I can use both ID 1 and 9 for my external wide devices and still connect an external non-wide devices.
On my machine I get the following SCSI order:
Attached devices: Host: scsi0 Channel: 00 Id: 01 Lun: 00 Vendor: SEAGATE Model: ST34520W Rev: 1206 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 09 Lun: 00 Vendor: SEAGATE Model: ST34520W Rev: 1206 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 03 Lun: 00 Vendor: DEC Model: DSP5400S Rev: 427L Type: Direct-Access ANSI SCSI revision: 02 Host: scsi0 Channel: 00 Id: 06 Lun: 00 Vendor: PLEXTOR Model: CD-ROM PX-32TS Rev: 1.01 Type: CD-ROM ANSI SCSI revision: 02
You can see that first devices 1 and 9 are scanned, and then 3 and 6 are. In this case ID 3 is an external device. Now devices 1 and 9 ALWAYS will be /dev/sda and /dev/sdb, unless I connect a (bootable) disk at ID 0.
I attached a patch to take care of this in kernel 2.1.129. it should be applied to drivers/scsi/scsi.c [unhandled content-type:application/octet-stream] | |