<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML ><HEAD ><TITLE >Device Names in scsidev</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="The Linux 2.4 SCSI subsystem HOWTO" HREF="index.html"><LINK REL="UP" TITLE="Names and Addresses" HREF="names.html"><LINK REL="PREVIOUS" TITLE="Device Names in devfs" HREF="dnamesdevfs.html"><LINK REL="NEXT" TITLE="Kernel Configuration" HREF="kconfig.html"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >The Linux 2.4 SCSI subsystem HOWTO</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="dnamesdevfs.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 3. Names and Addresses</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="kconfig.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="dnamesscsidev" ></A >3.4. Device Names in scsidev</H1 ><P > A utility program called <B CLASS="command" >scsidev</B > adds device names to the <TT CLASS="filename" >/dev/scsi</TT > directory that reflect the SCSI address of each device. The first 2 letters of the name are the upper level SCSI driver name (i.e. either sd, sr, st or sg). The number following the "h" is the host number while the number following the "-" is meant for host identification purposes. For PCI adapters this seems to be always 0 while for ISA adapters it is their IO address. [Perhaps this field could be made more informative or dropped.] The numbers following the "c", "i" and "l" are channel (bus), target id and lun values respectively. Raw disks are shown without a trailing partition number while partitions contained within them are shown with the partition number following a "p". </P ><P > The <B CLASS="command" >scsidev</B > would typically be run as part of the boot up sequence. It may also be useful to run it after the SCSI configuration has changed (e.g. adding or removing lower level driver modules, or the use of the add/remove-single-device command). After <B CLASS="command" >scsidev</B > has been run on my system which contains 2 disks, a cd reader and writer plus a scanner, then the following names were added in the <TT CLASS="filename" >/dev/scsi</TT > directory: <TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><FONT COLOR="#000000" ><PRE CLASS="programlisting" > $ ls -l /dev/scsi/ # abridged total 0 brw------- 8, 0 Sep 2 11:56 sdh0-0c0i0l0 brw------- 8, 1 Sep 2 11:56 sdh0-0c0i0l0p1 ... brw------- 8, 8 Sep 2 11:56 sdh0-0c0i0l0p8 brw------- 8, 16 Sep 2 11:56 sdh0-0c0i1l0 brw------- 8, 17 Sep 2 11:56 sdh0-0c0i1l0p1 ... brw------- 8, 24 Sep 2 11:56 sdh0-0c0i1l0p8 crw------- 21, 0 Sep 2 11:56 sgh0-0c0i0l0 crw------- 21, 1 Sep 2 11:56 sgh0-0c0i1l0 crw------- 21, 2 Sep 2 11:56 sgh1-0c0i2l0 crw------- 21, 3 Sep 2 11:56 sgh1-0c0i5l0 crw------- 21, 4 Sep 2 11:56 sgh1-0c0i6l0 br-------- 11, 0 Sep 2 11:56 srh1-0c0i2l0 br-------- 11, 1 Sep 2 11:56 srh1-0c0i6l0 </PRE ></FONT ></TD ></TR ></TABLE > The mapping between the SCSI generic device names (sg) and their corresponding names when controlled by other upper level drivers (i.e. sd, sr or st) can be seen by looking for name matches when the second letter is ignored. Hence "sdh0-0c0i0l0" and "sgh0-0c0i0l0" refer to the same device. By process of elimination the "sgh1-0c0i5l0" filename is the scanner since that class of devices can only be accessed via the sg interface. </P ><P > The scsidev package also includes the ability to introduce names like <TT CLASS="filename" >/dev/scsi/scanner</TT > by manipulating the <TT CLASS="filename" > /etc/scsi.alias</TT > configuration file. The package also includes the useful <B CLASS="command" >rescan-scsi-bus.sh</B > utility. For further information about <B CLASS="command" >scsidev</B > see <A HREF="refs.html#W6" >W6</A >. On my system, both devfs and scsidev co-exist happily. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="dnamesdevfs.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="kconfig.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Device Names in devfs</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="names.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Kernel Configuration</TD ></TR ></TABLE ></DIV ></BODY ></HTML >