[ltp] External Video and Xinerama
Kirk Hilliard
linux-thinkpad@linux-thinkpad.org
05 Jun 2003 12:30:38 -0400
On Wed, Jun 04, 2003 at 18:18:19 +0100, Richard Neill wrote:
> I have 2 removable drives ...
> Depending on which is plugged in, the order in which they are plugged
> in, and the situation at power on, they both fight over which is
> /dev/sda and which is /dev/sdb. They also mess up the scsi id of the CD
> writer (was 0,0,0, sometimes becomes 1,0,0). This makes mounting them a
> real nuisance - as I can't put the right entry in /etc/fstab.
/proc/scsi/scsi shows information about the removable media attached
via scsi emulation:
------------------------------ 8< ------------------------------
$ cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: Maxtor Model: 5000DV v01.00.00 Rev: 0100
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: ASUS Model: SCB-1608 Rev: 1.0
Type: CD-ROM ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: LEXAR Model: DIGITAL FILM Rev: /W1.
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi4 Channel: 00 Id: 00 Lun: 00
Vendor: SONY Model: USB-FDU Rev: 5.01
Type: Direct-Access ANSI SCSI revision: 02
------------------------------ >8 ------------------------------
It would be easy to write a wrapper script around mount to intercept
commands for removable drives, mounting them appropriately -- if only
I knew how to determine the device assigned by scsi emulation.
dmesg often shows this info:
------------------------------ 8< ------------------------------
scsi3 : SCSI emulation for USB Mass Storage devices
Vendor: LEXAR Model: DIGITAL FILM Rev: /W1.
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi3, channel 0, id 0, lun 0
SCSI device sdb: 251904 512-byte hdwr sectors (129 MB)
sdb: Write Protect is off
sdb: sdb1
------------------------------ >8 ------------------------------
Can this be determined from /proc/?
Is it safe to assume that Direct-Access type devices will be assigned
/dev/sda, /dev/sdb, ... and CD-ROM type devices will be assigned
/dev/sr0, /dev/sr1, ... in the order they are listed in
/proc/scsi/scsi?
This would not help with scsi ids (0,0,0, vs 1,0,0). It seems that
scsi emulation should be hackable to "reserve a drive letter" as you
asked, but I have not heard of it being done.
Kirk