Problem
Some external SCSI RAID controllers require that logical drive groups be specified by a logical unit number (LUN). How do I enable LUN support in the OS and for my host adapter?
Solution
An external SCSI-to-SCSI controller is a SCSI device that attaches
to a SCSI host adapter's bus. The SCSI-to-SCSI controller is seen
as a device off that host adapter and thus has a SCSI ID. The
SCSI-to-SCSI controller also has its own bus of devices (usually
hard drives in RAID configuration). Each of these devices or
device groups will share the SCSI-to-SCSI controller's SCSI ID,
but will have a unique LUN.The physical drives off the SCSI-to-SCSI controller are configured
into logical drives using the configuration utility that comes with
the SCSI-to-SCSI controller. During this configuration the logical
devices will be assigned the same SCSI target id as the SCSI-to-SCSI
controller (usually scsi id 0), but the LUN for each logical device
will increase incrementally starting at 0 for the first. So, the
LUN (logical unit number) for the second logical device will be 1.When configuring each logical device into the kernel (using "mkdev
hd") you will use the SCSI target ID of the SCSI-to-SCSI controller,
and the LUN assigned to the logical device through the SCSI-to-SCSI
controller's configuration utility. But, before using "mkdev hd" to
configure the devices, LUN support must be enabled in the host
adapter's BIOS and driver. The base OS does support LUN
specification by default; however, LUN specification must be
explicitly turned on in the host adapter's driver.NOTE: Some SCSI host adapter drivers have LUN support enabled by default.
To turn on LUN support in the adapter's BIOS, use the prompt you
see during boot (usually <Ctrl>A or <Ctrl>B) to enter the host
adapter's BIOS. Look for the LUN specification or LUN support
entry and set it to "on" or "enabled".To enable LUN support in the host adapter's driver, do the following from the root prompt:
# cd /etc/conf/pack.d/<driver name>where <driver name> is the driver for the host adapter your SCSI-to-SCSI controller is attached to (alad, arad, smad, and so on). Use your favorite editor to edit the space.c file in this directory. Search for a line of the format:
int <driver name>_scan_lun = 0;Changing the 0 to a 1 will enable LUN support for the driver. For example, if the SCSI-to-SCSI controller is attached to an Adaptec 2940 host adapter, you would search the file /etc/conf/pack.d/alad/space.c for the line:
int alad_scan_lun = 0;and change it to:int alad_scan_lun = 1;After making this change, save and exit the file. Relink the kernel and reboot the system with the following commands:
# cd /etc/conf/cf.d
# ./link_unix -y
# init 6You should now be able to successfully configure the devices off your SCSI-to-SCSI controller.
NOTES: In general, if the host adapter controller sees the devices off the
SCSI-to-SCSI controller, the OS will see them too. That is, if the
devices show in the adapter's table during boot, they will be
detected by the OS once LUN support is enabled in the driver, and
the devices are configured correctly. If the OS does not see it,
there could be problems with bad cables, termination and wide versus
narrow devices, which would allow the device to be seen during the
scan but fail during OS use. To confirm that the OS sees the
device(s), use the following command as root:# sconf -v