Sbp-target

From IEEE 1394 FireWire Wiki
Jump to: navigation, search
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

You can find more information about the Linux target subsystem at the Linux iscsi site.

Personal tools