lkml.org 
[lkml]   [1996]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: SCSI device numbering
As a user, my primary concern is that whatever names are chosen for the SCSI
devices in my system are consistent across reboots unless I reconfigure the
system hardware in a way that makes this no longer possible. My secondary
concern is that these names are as meaningful to me as possible. Major and
minor numbers are an implementation detail I really don't want to know about.
They can be fully dynamic as far as I'm concerned, since I hope never to see
them.

I'd like to see names like /dev/scsi/IBM_DFHSS4W so I know which physical disk
is being referred to. SCSI Bus numbers and Target IDs are not what I want to
think about any more than is necessary. Where a given file system should be
mounted from is a particular partition of a particular disk, regardless of
where that physical disk happens to be located at any given time. Furthermore,
I'd like a simple mapping from the official names to names of my choosing made
automatically during system startup based on a configuration file. The OS can
create (or perhaps provide a /proc/scsi/dev/ entry for) /dev/scsi/HP_C2520A and
I want to specify that this should be available as /dev/scanjet.

The inquiry data from SCSI devices should always provide enough information to
uniquely name a SCSI device except for the case of multiple devices that are
identical. In that case we need some unique information from the device. Many
or most SCSI disks have their serial number accessible, so a has of that can
handle those devices (/dev/scsi/IBM_DFHSS4W_63672546263). For disks that
don't, we need a place to write a unique ID. Other devices that seem identical
may in fact have different inquiry data or mode page data that we can hash to a
unique ID. For removable media, I expect the particular media that's loaded is
also an important factor to key on. In cases where there is no way to
differentiate between two devices, then and only then do we need to fall back
on appending an arbitrary ordinal (/dev/scsi/toshiba_3401b_12312312_1,
/dev/scsi/toshiba_3401b_12312312_2). As long as the naming for devices we
cannot differentiate completely is consistent until we reconfigure the
hardware, we'll be far better off than we are now.

If we feel it's necessary, for cases where the hardware configuration does
change in nonobvious ways, we can write user space utilities that attempt to be
smart about figuring out what has happened, comparing a previous snapshot of
the system configuration to the current one, and trying to arrive at likely
names for the devices that cannot be uniquely identified. Most of the
scenarios described so far can be detected fairly easily.

Leonard


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.052 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site