Sbp-target

From IEEE 1394 FireWire Wiki
(Difference between revisions)
Jump to: navigation, search
m
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
<nowiki>Here's the series of commands I used to create a sbp2-target instance
+
<nowiki>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
+
# Create a backing store for the exported filesystem  This creates an 8G store
# Use a path appropriate for your system
+
# Use a path appropriate for your system
dd < /dev/zero bs=1M count=8192 > /local/tmp/backing-store
+
dd < /dev/zero bs=1M count=8192 > /local/tmp/backing-store
# Load the target core and the sbp2 interface
+
# Load the target core and the sbp2 interface
modprobe sbp-target
+
modprobe sbp-target
# Tell the target subsystem about the backing store
+
# Tell the target subsystem about the backing store
mkdir -p /sys/kernel/config/target/core/fileio_0/sbptest
+
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 "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
+
echo 1 > /sys/kernel/config/target/core/fileio_0/sbptest/enable
 
+
# Create and enable the sbp2 target
+
# Create and enable the sbp2 target
# I used the uuid of my host adapter here.  You can use something different.
+
# 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
mkdir -p /sys/kernel/config/target/sbp/00110666000000c1/tpgt_1/lun/lun_0
+
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/
+
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
+
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
+
# 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
+
mkfs.ext4 /dev/sdb  # Or whatever the actual device is
# And mount it
+
# And mount it
mount /dev/sdb /mnt/tmp
+
mount /dev/sdb /mnt/tmp
 
</nowiki>
 
</nowiki>
 +
You can find more information about the Linux target subsystem at [http://linux-iscsi.org/wiki/Main_Page the Linux iscsi site].

Latest revision as of 19:22, 15 June 2012

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