[6084] in linux-scsi channel archive
Re: SCSI generic interface addition
daemon@ATHENA.MIT.EDU (Matthias Andree)
Fri Mar 12 18:15:22 1999
Date: Fri, 12 Mar 1999 19:37:37 +0100
From: Matthias Andree <mandree@sx1.HRZ.Uni-Dortmund.DE>
To: linux-scsi@vger.rutgers.edu
Mail-Followup-To: linux-scsi@vger.rutgers.edu
In-Reply-To: <36E70072.3A291FCC@arkady.demon.co.uk>; from Bernard Hatt on Wed, Mar 10, 1999 at 11:29:54PM +0000
On Wed, Mar 10, 1999 at 11:29:54PM +0000, Bernard Hatt wrote:
> Because the /dev/sg? interfaces are assigned dynamically when
> booting, my CD writer device name changes depending on whether
> my scanner is attached or switched on.
>
> Having looked at the problem, I have hacked drivers/scsi/sg.c to
> create directories under /proc/sg which contains symbolic links
> named by the SCSI address or device name to the matching /dev/sg?
> device file.
>
> If anyone is interested in this code (for linux-2.2.3) it is
> available on http://www.arkady.demon.co.uk/scsi.html .
Hmm... at least a try to do something about the situation. There are
some things which are even worse:
* if for some reason the Kernel versions in use change the scanning
order, or some SCSI low-level driver changes state from module to
linked or vice versa, hard disk names themselves change. Same goes if
external SCSI towers are dis- or reconnected.
Now, a solution which comes from the good old Amiga m68k/ppc-based
systems, and which should really be considered, is as follows: (it uses
the so-called "rigid disk block")
- each drive has a RDB block which contains linkers to - among others -
PART blocks (we don't care for LSEG type filesystems for Linux)
- each partition on every drive has a PART block, stating the geometry
along with some flags (like "automount", "bootable", boot priority
(which partition is booted first, can be overridden in Kickstart which
resembles the BIOS boot order in this place) AND a partition name. Upon
boot up, the system scans these rigid disk blocks of each drive for
partitions, and checks the partition name found in the PART block
against a list of already known partition names. If it's a name which
is NOT already present, it's added. If the OS already knows another
partition by the same name, it increments the last digit.
So, since the OS reads partition names from the actual disks, it it
totally immune against:
- unit number
- LUN
- bus scanning order
- host adaptor scanning order
- SCAM (hum, the Amiga does not actually support SCAM, but some PCI
host adaptors do, like Tekram DC-390 series)
Under AmigaOS, let's consider two drives, one containing partitions
DH0, DH1, the other DI0: perfectly fine, the OS knows partitions DH0,
DH1, DI0, regardless of their actual position.
With two drives containing a DH0 partition each, the OS would mount the
first as DH0, the other as DH1. This is the place where we have our
current Linux situation: I don't exactly know what partition is mounted
where.
We should have some similar system for Linux. We could, however, use
Rigid Disk Blocks on x86 Linux systems (they're actually supported as
soon as you enable Amiga FFS for the kernel), if a bootable x86
partition is found, everything is fine, but Linux does not currently
use the RDB partition names, it just enumerates partitions as well. The
might be some way, however, to generate some /proc/partitions/dh0 files
which contain the actual partition position, so that cat
/proc/partitions/dh0 would give us for example "/dev/sdc4" or
something.
This is a very compact consideration, it does not regard all the gory
details (like: the Amiga can have a number of partitions only limited
by memory, while with Linux, we can have only as many as we have minor
numbers, like 16 per drive).
--
Matthias Andree
"Users never read manuals."
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu