[EMAIL PROTECTED] said:
> I'm working with a mixture of v2.2.x and v2.4.x hosts in an FC-SW
> environment that requires the host to be able to skip LUNs.  I've
> applied Eric's linux-2.4.1.diff and Doug's scsi241_ey2.diff patches on
> different v2.4.x hosts to address the issue of scanning past LUN 7 on
> v2.4.x.   Has anyone addressed allowing a v2.4.x Linux host running to
> skip LUNs?  or to scan past a non-existent target 0 LUN 0?  If so, is
> there a patch available?   

We use a user level program, arrayscan, to work around this---we put it in the 
init system so it scans known targets for luns at an early stage.  I've 
attached the program.  It's pretty simple, it just recognises ID strings and 
probes all LUNs when it does.

Not having a LUN 0 is illegal under the SCSI standards, but if you know the 
target number you can persuade the arrayscan program to probe there for the 
LUNs.

James

#!/bin/bash
#
# arrayscan: parse /proc/scsi/scsi for arrays (see template file)
#            and probe them on all available LUNs.
# Author: James Bottomley
# Modified: 9/11/2000 Paul Clements
#
# Copyright (c) 2000 SteelEye Technology Inc. - Mountain View, CA, USA
#
if [ ! -f "/etc/array/templates" -o ! -f "/proc/scsi/scsi" ]; then
        exit 1
fi

/bin/gawk '
        {
                i = 0;
                while(getline < "/etc/array/templates") {
                        if($0 ~ /^[[:space:]]*\#/) continue;
                        template[i++] = $0;
                }
                # Note, file is already on line 1 ("Attached devices:"), so
                # the getline in while moves it to the next line.
                while(getline) {
                        id = $0;
                        getline;
                        for(v in template) {
                                if(!match($0, template[v])) continue;
                                print gensub("^Host: scsi([[:digit:]]+) Channel: 
([[:digit:]]+) Id: ([[:digit:]]+) Lun: ([[:digit:]]+)$", "\\1 \\2 \\3", 1, id);
                        }
                        getline;
                }
        }' /proc/scsi/scsi  | (
last=
while read a; do
        if [ "$a" = "$last" ]; then
                continue
        fi
        last=$a
        i=1
        while [ $i -lt 16 ]; do
                echo "scsi add-single-device $a $i" > /proc/scsi/scsi
                i=$[$i+1]
        done
done )

#
# Template file for arrayscan
# Author: James Bottomley
# Copyright (c) 2000 SteelEye Technology Inc. - Mountain View, CA, USA
#
# The format is exactly the same as the vendor line in /proc/scsi/scsi
# except that regular expressions may be used (one line per recognised
# array)
Vendor: NCR      Model: .*
Vendor: EMC      Model: .*
Vendor: SYMBIOS  Model: .*
Vendor: CMD      Model: .*
Vendor: CMD TECH Model: .*
Vendor: DGC      Model: .*
Vendor: JetStor  Model: .*
Vendor: Compaq   Model: .*
Vendor: COMPAQ   Model: .*
Vendor: Baydel   Model: .*
Vendor: CNSi     Model: .*

Reply via email to