DENX . DULG . AN2007_03_iSCSI |
"Cryptographic API" (CONFIG_CRYPTO) "CRC32c CRC algorithm" (CONFIG_CRYPTO_CRC32C)For a LSI SAS controller:
CONFIG_FUSION=y # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set CONFIG_FUSION_SAS=y CONFIG_FUSION_MAX_SGE=128 CONFIG_FUSION_CTL=yFor Linux RAID support:
CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y CONFIG_MD_RAID10=y CONFIG_MD_RAID456=y CONFIG_MD_RAID5_RESHAPE=y # CONFIG_MD_MULTIPATH is not set # CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not setAlso, enable the SCSI disk option.
CONFIG_DEBUG_MUTEXES
option.
PATH=/opt/eldk/usr/ppc-linux/bin:/opt/eldk/usr/bin:$PATH CROSS_COMPILE=ppc_4xx- ARCH=ppc make KSRC=/home/wd/iscsi/linux-2.6-denx
PATH=/opt/eldk/usr/ppc-linux/bin:/opt/eldk/usr/bin:$PATH CROSS_COMPILE=ppc_4xx- ARCH=ppc make KSRC=/home/wd/iscsi/linux-2.6-denx DISTDIR=/opt/eldk/ppc_4xx
cp etc/ietd.conf /opt/eldk/ppc_4xx/etc
/opt/eldk-4.1/ppc_4xx/etc/ietd.conf
.
Set the target name appropriately. It may be left unchanged, though.
For this example, the target name was set to the following:
Target iqn.2007-03.domain:storage.disk1Edit the following string to set the "Lun" to be the Linux RAID device:
Lun 0 Path=/dev/md0,Type=fileio
... Fusion MPT base driver 3.04.04 Copyright (c) 1999-2007 LSI Logic Corporation Fusion MPT FC Host driver 3.04.04 Fusion MPT SAS Host driver 3.04.04 mptbase: Initiating ioc0 bringup ioc0: SAS1068: Capabilities={Initiator} scsi0 : ioc0: LSISAS1068, FwRev=01060000h, Ports=1, MaxQ=511, IRQ=24 scsi 0:0:0:0: Direct-Access ATA Maxtor 6Y250M0 1EW0 PQ: 0 ANSI: 5 SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB) sda: Write Protect is off SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA SCSI device sda: 490234752 512-byte hdwr sectors (251000 MB) sda: Write Protect is off SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA sda: sda1 sd 0:0:0:0: Attached scsi disk sda sd 0:0:0:0: Attached scsi generic sg0 type 0 scsi 0:0:1:0: Direct-Access ATA WDC WD1200JS-00M 1C03 PQ: 0 ANSI: 5 SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB) sdb: Write Protect is off SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA SCSI device sdb: 234441648 512-byte hdwr sectors (120034 MB) sdb: Write Protect is off SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdb: unknown partition table sd 0:0:1:0: Attached scsi disk sdb sd 0:0:1:0: Attached scsi generic sg1 type 0 scsi 0:0:2:0: Direct-Access ATA WDC WD1200JS-00M 1C03 PQ: 0 ANSI: 5 SCSI device sdc: 234441648 512-byte hdwr sectors (120034 MB) sdc: Write Protect is off SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA SCSI device sdc: 234441648 512-byte hdwr sectors (120034 MB) sdc: Write Protect is off SCSI device sdc: write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdc: unknown partition table sd 0:0:2:0: Attached scsi disk sdc sd 0:0:2:0: Attached scsi generic sg2 type 0 scsi 0:0:3:0: Direct-Access ATA WDC WD1200JS-00M 1C03 PQ: 0 ANSI: 5 SCSI device sdd: 234441648 512-byte hdwr sectors (120034 MB) sdd: Write Protect is off SCSI device sdd: write cache: enabled, read cache: enabled, doesn't support DPO or FUA SCSI device sdd: 234441648 512-byte hdwr sectors (120034 MB) sdd: Write Protect is off SCSI device sdd: write cache: enabled, read cache: enabled, doesn't support DPO or FUA sdd: sdd1 sd 0:0:3:0: Attached scsi disk sdd sd 0:0:3:0: Attached scsi generic sg3 type 0 Fusion MPT misc device (ioctl) driver 3.04.04 mptctl: Registered with Fusion MPT base driver mptctl: /dev/mptctl @ (major,minor=10,220) ...
mknod /dev/md0 b 9 0 mdadm -C /dev/md0 -c 32 -l 5 -n 4 /dev/sd[a-d]
depmod -a /etc/init.d/iscsi-target start
iscsi-initiator-utils
package
from the Fedora Core 6 distribution to set up the iSCSI initiator on
a Fedora Core 6 host. This package contains only user-level
components; kernel modules used are from the mainline Fedora Core 6
kernel. Such a combination did not work in our tests; the target gets
discovered but doesn't appear as a local SCSI virtual drive. We ended
up with the iscsi_tcp
module stuck and being unloadable from the
kernel, so we had to reboot the system.
There is note at
http://www.open-iscsi.org/cgi-bin/wiki.pl/Supported_Kernels
that
kernel mainline modules should not be used, so we downloaded and built
the package:
make KSRC=/usr/src/kernels/2.6.17-1.2187_FC5-i686
make KSRC=/usr/src/kernels/2.6.17-1.2187_FC5-i686 install depmod -a
echo "InitiatorName=iqn.2005-03.com.max:01.507a17"> /etc/iscsi/initiatorname.iscsi
/etc/init.d/open-iscsi start
open-iscsi-2.0-754/README
192.168.80.17
is the IP address
of the "taishan" board):
# iscsiadm -m discovery -t sendtargets -p 192.168.80.17:3260 192.168.80.17:3260,1 iqn.2007-03.domain:storage.disk1Login (connect) to the discovered target:
iscsiadm -m node -T iqn.2007-03.domain:storage.disk1 -p 192.168.80.17:3260 -lAfter this, you should be able to find the virtual appliance in
/proc/scsi/scsi
:
# cat /proc/scsi/scsi Attached devices: Host: scsi24 Channel: 00 Id: 00 Lun: 00 Vendor: IET Model: VIRTUAL-DISK Rev: 0 Type: Direct-Access ANSI SCSI revision: 04Examine "dmesg" output for the virtual disk name to use:
... csi24 : iSCSI Initiator over TCP/IP Vendor: IET Model: VIRTUAL-DISK Rev: 0 Type: Direct-Access ANSI SCSI revision: 04 SCSI device sda: 703324416 512-byte hdwr sectors (360102 MB) sda: Write Protect is off sda: Mode Sense: 77 00 00 08 SCSI device sda: drive cache: write through SCSI device sda: 703324416 512-byte hdwr sectors (360102 MB) sda: Write Protect is off sda: Mode Sense: 77 00 00 08 SCSI device sda: drive cache: write through sda: sda1 sd 24:0:0:0: Attached scsi disk sda sd 24:0:0:0: Attached scsi generic sg0 type 0 ...
# fdisk /dev/sda .... # mkfs -t ext3 /dev/sda1 ... # mount /dev/sda1 /mnt/iscsi # cp -a /usr /mnt/iscsi # cp -a /lib /mnt/iscsi # ls -l /mnt/iscsi total 24 drwxr-xr-x 11 psl psl 4096 Mar 13 10:31 lib drwx------ 2 root root 16384 Mar 13 11:46 lost+found drwxr-xr-x 15 psl psl 4096 Mar 13 10:31 usr
# umount /mnt/iscsi # iscsiadm -m node -T iqn.2007-03.domain:storage.disk1 -p 192.168.80.17:3260 -u
----- Revision r1.2 - 06 Sep 2007 - 16:13 - DetlevZundel
|