[nylug-talk] Viewing the kernels config/LUN's
Remy De la Cruz
remydlc at gmail.com
Mon Apr 16 16:05:09 EDT 2007
As long as you get the scsi (sd) driver loaded, that line will add that
option to the driver. Now for automatic lun discovery is done by the linux
sd driver at boot time, there is an script we use to do it on the fly but it
does not work as well as in the 2.6 linux kernel.
The script i'm talking about is from emulex and it's bundled with
their "*Applications kit
*", I've attached it for your reference.
Let me know if that helps, Thanks.
On 4/16/07, sixtyfourbeets <sixtyfourbeets at gmail.com> wrote:
>
> Maybe one of these lines may work for you:
>
> 1) options scsi_mod scsi_allow_ghost_devices=1 max_scsi_luns=255
> # in /etc/modules.conf for 2.4 kernel
> or
> 2) options scsi_mod max_luns=256
> # in /etc/modules.conf in 2.6 kernel
>
> I have #1 in the /etc/module.conf file because the kernel is a 2.4.
> However, the /boot/config-kernel has the following entry when I
> grep for LUN:
> # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
> # CONFIG_SCSI_MULTI_LUN is not set
>
> So now the question is does multi LUN discovery have to be
> enabled in the kernel? The tech at QLogic says: 'LUN detection
> is automatically configured in the kernel' which if I were
> to go by conventional knowledge it appears to not be.
>
> I did't configure this system, I inhereted it but if it were
> up to me I would have recompiled the kernel with LUN enabled
> from the very start.
>
> Thanks,
> Steve M
>
> _____________________________________________________________________________
> Hire expert Linux talent by posting jobs here :: http://jobs.nylug.org
> The nylug-talk mailing list is at nylug-talk at nylug.org
> The list archive is at http://nylug.org/pipermail/nylug-talk
> To subscribe or unsubscribe: http://nylug.org/mailman/listinfo/nylug-talk
>
-------------- next part --------------
#!/bin/sh
#
# scripts/lun_scan Rev : 1.1
# This script is provided by Emulex to use with its 7.1.X linux device
# driver for Light Pulse Fibre Channel adapters.
#
# This script performs a scan on either specific lpfc HBAs or on all
# lpfc HBAs. When scanning an HBA, all discovered targets, and all
# luns (0 to 255) will be probed.
#
#
# USAGE: The script is invoked with at least 1 argument. The arguments
# specify either the SCSI Host numbers corresponding to the specific
# lpfc HBA that are to be scanned, or the keyword "all" which indicates
# that all lpfc HBAs are to be scanned.
#
usage()
{
echo ""
echo "Usage: lun_scan [ <#> [<#>] | all ]"
echo " where "
echo " <#> : is a scsi host number of a specific lpfc HBA that is to"
echo " be scanned. More than 1 host number can be specified. "
echo " all : indicates that all lpfc HBAs are to be scanned."
echo ""
echo " Example:"
echo " lun_scan all : Scans all lpfc HBAs"
echo " lun_scan 2 : Scans the lpfc HBA with scsi host number 2"
echo " lun_scan 2 4 : Scans the lpfc HBAs with scsi host number 2 and 4"
echo ""
echo " Warning: Scanning an adapter while performing a tape backup should"
echo " be avoided."
echo ""
}
# Validate argument list
if [ $# -eq 0 -o "$1" = "--help" -o "$1" = "-h" ] ; then
usage
exit 1
fi
# get list of lpfc HBAs to scan
hosts=$*;
lowhost=0
# If all option is used get all the lpfc host numbers.
if [ "$hosts" == "all" ] ; then
ha=`ls /proc/scsi/lpfc/? 2> /dev/null | cut -f5 -d'/'`
hb=`ls /proc/scsi/lpfc/?? 2> /dev/null | cut -f5 -d'/'`
hc=`ls /proc/scsi/lpfc/??? 2> /dev/null | cut -f5 -d'/'`
hosts="$ha $hb $hc"
lowhost=`echo $hosts | sed "s/ .*//"`
fi
for host in $hosts ; do
# Convert host number to lpfc instance number.
instance=`expr $host - $lowhost`
if [ ! -e /proc/scsi/lpfc/$host ] ; then
echo ""
echo "Error: Cannot find an lpfc HBA instance with scsi host number : $host"
echo "... Aborting lun_scan."
echo ""
exit 2
fi
echo Scanning lpfc$instance, scsi host number : $host;
max_lun=256
targets=`cat /proc/scsi/lpfc/$host | grep 'lpfc*t*' | cut -f2 -d't' | cut -f1 -d' '`
for target in $targets ; do
# convert target ID to decimal from Hex format
let "dec_target = 0x$target"
echo " Scanning Target Id $dec_target..."
for ((lun=0; lun<$max_lun; lun++)) ; do
echo "scsi add-single-device $host 0 $dec_target $lun" >/proc/scsi/scsi
done
done
done
echo ""
More information about the nylug-talk
mailing list