Using AMCC PPC 440 processors for SAN applications over iSCSI
This document describes how to set up AMCC PPC 440 based systems
running DENX Linux for SAN applications over iSCSI transport.
It explains the process of setting up the iSCSI target and initiator
to use RAID arrays created on "katmai" (440SPe) and "taishan" (440GX)
boards as SAN appliances.
Building the iSCSI target and initiator kernel components (included
into the release tarballs) require the access to the kernel source
tree.
Configuring and building target components:
For the target, the linux-2.6-denx tree was used, version 2.6.21-rc3
- Build the target kernel
The following options should be enabled:
"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=y
For 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 set
Also, enable the SCSI disk option.
Note: Make sure to disable the CONFIG_DEBUG_MUTEXES
option.
- Build the iSCSI Target software (IET):
- Download the iscsitarget-0.4.14.tar.gz
tarball from
http://iscsitarget.sourceforge.net
- Unpack and apply patches:
- Build:
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
- Install (being root)
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
- Configure the iscsitarget. Edit
/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.disk1
Edit the following string to set the "Lun" to be the Linux RAID device:
Lun 0 Path=/dev/md0,Type=fileio
- Boot the target. Note the LSI SAS device and connected discs are
recognized:
...
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)
...
- On the target, create the RAID5 array using the "mdadm" utility:
mknod /dev/md0 b 9 0
mdadm -C /dev/md0 -c 32 -l 5 -n 4 /dev/sd[a-d]
- Start the iSCSI target service:
depmod -a
/etc/init.d/iscsi-target start
Building and configuring the iSCSI Initiator
In this example, a standard PC running Fedora Core 5 Linux was used as host
system.
Note: We also tried to use the
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:
- Download open-iscsi-2.0-754.tar.gz
from http://www.open-iscsi.org/
- Unpack and build:
make KSRC=/usr/src/kernels/2.6.17-1.2187_FC5-i686
- Install (being root)
make KSRC=/usr/src/kernels/2.6.17-1.2187_FC5-i686 install
depmod -a
- Create the following file:
echo "InitiatorName=iqn.2005-03.com.max:01.507a17"> /etc/iscsi/initiatorname.iscsi
- Start the initiator (being root)
/etc/init.d/open-iscsi start
- By default, the initiator is not configured for auto-connect the target.
To automate the discovery/login, see
open-iscsi-2.0-754/README
First, run the discovery process (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.disk1
Login (connect) to the discovered target:
iscsiadm -m node -T iqn.2007-03.domain:storage.disk1 -p 192.168.80.17:3260 -l
After 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: 04
Examine "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
...
- Partition, format and mount the disk:
# 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
- After use, unmount the virtual disk and disconnect from the target:
# umount /mnt/iscsi
# iscsiadm -m node -T iqn.2007-03.domain:storage.disk1 -p 192.168.80.17:3260 -u
Here you can find a
a tarball with daemon, utilities, kernel modules and
configuration files as used for this demo.
It works both on katmai and taishan.
--
WolfgangDenk - 14 Mar 2007