Preface

Initial Write up: 08/09/2012
Last Updated: 24/02/2016

24/02/16:
Excuse the mess, this page is old and has been "forced" into the current style. Content has remained unchanged bar actually adding clickable links.


Sauce: H-Online, Kernel 3.5 Details

Together with the Linux-Iscsi.org (LIO) target infrastructure software, the new FireWire SBP-2 fabric module enables Linux 3.4 to export local storage devices via FireWire so that other systems can mount them as an ordinary FireWire storage device. Many Apple systems have offered such a "FireWire target disk mode" for some time; a screenshot by one of the contributing developers shows that MacOS X can mount a device that a Linux system has made available via the new Linux FireWire fabric module.

The new TCM_QLA2XXX fabric module, and the required support in the Qla2xxx driver, allow Linux to operate as a SCSI target with Qlogic's series 2400, 2500 and 2600 fibre channel controllers; the same can also be achieved with the USB gadget target fabric module via UASP (USB Attached SCSI Protocol), provided that the USB controller is capable of the "gadget" features that allow it to operate as a USB master.

Step 1

Sauce: IEEE1394 wiki, SBP-Target

Here's the series of commands I used to create a sbp2-target instance

# Create a backing store for the exported filesystem  This creates an 8G store
# Use a path appropriate for your system
dd < /dev/zero bs=1M count=8192 > /local/tmp/backing-store
# Load the target core and the sbp2 interface
modprobe sbp-target
# Tell the target subsystem about the backing store
mkdir -p /sys/kernel/config/target/core/fileio_0/sbptest
echo "fd_dev_name=/local/tmp/backing-store,fd_dev_size=8589934592" > /sys/kernel/config/target/core/fileio_0/sbptest/control
echo 1 > /sys/kernel/config/target/core/fileio_0/sbptest/enable
# Create and enable the sbp2 target
# I used the uuid of my host adapter here.  You can use something different.
mkdir -p /sys/kernel/config/target/sbp/00110666000000c1/tpgt_1
mkdir -p /sys/kernel/config/target/sbp/00110666000000c1/tpgt_1/lun/lun_0
ln -s /sys/kernel/config/target/core/fileio_0/sbptest /sys/kernel/config/target/sbp/00110666000000c1/tpgt_1/lun/lun_0/
echo 1 > /sys/kernel/config/target/sbp/00110666000000c1/tpgt_1/enable
# On the initiator host, use dmesg to find out the device name of the target, then
mkfs.ext4 /dev/sdb   # Or whatever the actual device is
# And mount it
mount /dev/sdb /mnt/tmp

Step 2

Sep  8 01:21:52 Momiji kernel: [ 4100.425105] Rounding down aligned max_sectors from 4294967295 to 8388600
Sep  8 01:22:05 Momiji kernel: [ 4113.910772] Unable to load target_core_stgt
Sep  8 01:24:06 Momiji kernel: [ 4235.185465] firewire_core 0000:02:04.1: refreshed device fw0
Sep  8 01:25:35 Momiji kernel: [ 4324.159856] firewire_ohci 0000:02:04.1: isochronous cycle inconsistent
Sep  8 01:25:36 Momiji kernel: [ 4324.660140] firewire_core 0000:02:04.1: rediscovered device fw0
Sep  8 01:25:36 Momiji kernel: [ 4324.663238] firewire_core 0000:02:04.1: created device fw1: GUID 0019e3fffe988c4e, S400
Sep  8 01:25:36 Momiji kernel: [ 4324.663416] firewire_core 0000:02:04.1: phy config: new root=ffc1, gap_count=5
Sep  8 01:25:36 Momiji kernel: [ 4325.198006] net firewire0: IPv4 over IEEE 1394 on card 0000:02:04.1
Sep  8 01:25:37 Momiji kernel: [ 4325.376447] sbp_target: mgt_agent LOGIN to LUN 0 from 0019e3fffe988c4e
Sep  8 01:25:38 Momiji kernel: [ 4326.490913] MODE SENSE: unimplemented page/subpage: 0x03/0x00
Sep  8 01:25:38 Momiji kernel: [ 4326.491130] MODE SENSE: unimplemented page/subpage: 0x03/0x00
Sep  8 01:25:38 Momiji kernel: [ 4326.491346] MODE SENSE: unimplemented page/subpage: 0x04/0x00
Sep  8 01:25:38 Momiji kernel: [ 4327.208750] firewire_core 0000:02:04.1: refreshed device fw0
Sep  8 01:25:39 Momiji kernel: [ 4327.311768] sbp_target: mgt_agent RECONNECT from 0019e3fffe988c4e
Sep  8 01:25:41 Momiji kernel: [ 4329.310272] sbp_target: mgt_agent RECONNECT from 0019e3fffe988c4e
Sep  8 01:25:41 Momiji kernel: [ 4329.709430] firewire_core 0000:02:04.1: phy config: new root=ffc1, gap_count=5
Sep  8 01:25:41 Momiji kernel: [ 4329.811335] sbp_target: mgt_agent RECONNECT from 0019e3fffe988c4e
Sep  8 01:27:50 Momiji kernel: [ 4458.642045] sbp_target: Waiting for reconnect from node: 0019e3fffe988c4e
Sep  8 01:27:51 Momiji kernel: [ 4459.644044] sbp_target: Reconnect timer expired for node: 0019e3fffe988c4e

Step 3

Target Get