Linux SCSI subsystem overview

Linux SCSI subsystem overview

This topic provides an overview of SCSI disk connectivity.

The Linux SCSI subsystem consists of three layers:
  • The upper layer consists of specific device type drivers that are closest to user-space, such as the disk driver, tape driver, and CD-ROM driver.
  • The lower layer consists of drivers, such as the QLogic and Emulex host bus adapter (HBA) drivers, which are closest to the hardware.
  • The middle layer is the SCSI core that glues the upper and lower layer drivers together.
Depending on the kernel distribution, the drivers may be compiled into the kernel or built as modules which are loaded into the kernel. The sd driver is the SCSI disk driver, or block driver, which is named sd_mod when built as a module. The SCSI mid-layer driver is known as scsi_mod when built as a module.

Typically, in most distributions these drivers are built as modules and will be loaded at boot as part of the initrd images. If they are not loaded on boot, and are required at boot time, then an initrd image should be built to include them. For 2.4 kernels this is done by modifying the /etc/modules.conf file. For 2.6 kernels, this is done by modifying the /etc/modprobe.conf file and the /etc/sysconfig/kernel file. After modifying these files, the mkinitrd command needs to be run to pick up the changes.

To check if the drivers are built as modules and are currently loaded, check for sd_mod and scsi_mod in the lsmod command output. The following is example output:

# lsmod | grep sd
sd_mod                 13440 296
scsi_mod              104068   6  [qla2300 st sr_mod sg ncr53c8xx sd_mod]
Note: If the SCSI mid-layer driver is compiled as a module, it is important that scsi_mod is loaded before the upper and lower level drivers and unloaded last.

posted on 2011-08-29 14:34  Tonystz  阅读(200)  评论(0编辑  收藏  举报