[yocto] iSCSI in Yocto

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Thu Nov 1 15:54:01 PDT 2012


I am trying to get iSCSI support into my Yocto build, however I am finding that it is not going very well...

I have my kernel configured with all the necessary options (I think...):

iSCSI Boot Firmware Table Attributes module (SCSI_ISCSI_ATTRS)
Linux-iSCSI.org iSCSI Target Mode Stack (ISCSI_TARGET)
Generic Target Core Mod (TCM) and ConfigFS Infrastructure (CONFIG_TARGET_CORE)
Userspace-driven configuration filesystem (CONFIGFS_FS)

Now I am trying to get a program installed to configure the iSCSI setup.  I found that there are no recipes for targetcli (which I would prefer to use if there is one out there or if someone is willing to guide me through it), so I found a recipe for lio-utils, which I have modified to build into my image.

So far, I can run the LIO utilities, but am always getting errors stating that the device is busy.  How can I get around those?  Internet searches are fruitless.

Any thoughts?  My output is below.  I suspect that it has something to do with the fact that /dev/sdb1 is already mounted on /media/sdb1 (though it really isn't - you can see that in the umount command at the end...).  Can I prevent the system from trying to mount those?  It appears that it is doing it via udev, but even if I move the mount script out of it's location, it still is happening.

What am I doing wrong?

Thanks!


penryn:~# /etc/init.d/target start
Loading target_core_mod/ConfigFS core:   [OK]

penryn:~# tcm_node --block iblock_0/sms /dev/sdb1
 ConfigFS HBA: iblock_0
Successfully added TCM/ConfigFS HBA: iblock_0
 ConfigFS Device Alias: sms
Device Params ['/dev/sdb1']
sh: line 0: echo: write error: Device or resource busy
IBLOCK: createvirtdev failed for enable_opt with echo 1 > /sys/kernel/config/target/core/iblock_0/sms/enable
Unable to register TCM/ConfigFS storage object: /sys/kernel/config/target/core/iblock_0/sms

penryn:~# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/sda on /media/sda type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb3 on /media/sdb3 type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)
/dev/sdb1 on /media/sdb1 type ext2 (rw,relatime,errors=continue)
/dev/loop0 on / type ext3 (rw,noatime,barrier=1,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=974536k,nr_inodes=243634,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /var/volatile type tmpfs (rw,relatime)
tmpfs on /media/ram type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
/dev/sdb3 on /data type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)
configfs on /sys/kernel/config type configfs (rw,relatime)

penryn:~# umount /dev/sdb1
umount: /media/sdb1: not mounted

penryn:~# 



More information about the yocto mailing list