diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/aoe/aoe.txt | 75 | ||||
-rw-r--r-- | Documentation/aoe/autoload.sh | 17 | ||||
-rw-r--r-- | Documentation/aoe/mkdevs.sh | 33 | ||||
-rw-r--r-- | Documentation/aoe/mkshelf.sh | 23 | ||||
-rw-r--r-- | Documentation/aoe/status.sh | 15 |
5 files changed, 163 insertions, 0 deletions
diff --git a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt new file mode 100644 index 0000000000000..ce84de72bf5f4 --- /dev/null +++ b/Documentation/aoe/aoe.txt @@ -0,0 +1,75 @@ +The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... + + http://www.coraid.com/support/linux/EtherDrive-2.6-HOWTO.html + + It has many tips and hints! + +CREATING DEVICE NODES + + Users of udev should find device nodes created automatically. Two + scripts are provided in Documentation/aoe as examples of static + device node creation for using the aoe driver. + + rm -rf /dev/etherd + sh Documentation/aoe/mkdevs.sh /dev/etherd + + ... or to make just one shelf's worth of block device nodes ... + + sh Documentation/aoe/mkshelf.sh /dev/etherd 0 + + There is also an autoload script that shows how to edit + /etc/modprobe.conf to ensure that the aoe module is loaded when + necessary. + +USING DEVICE NODES + + "cat /dev/etherd/err" blocks, waiting for error diagnostic output, + like any retransmitted packets. + + "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to + limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from + untrusted networks should be ignored as a matter of security. + + "echo > /dev/etherd/discover" tells the driver to find out what AoE + devices are available. + + The block devices are named like this: + + e{shelf}.{slot} + e{shelf}.{slot}p{part} + + ... so that "e0.2" is the third blade from the left (slot 2) in the + first shelf (shelf address zero). That's the whole disk. The first + partition on that disk would be "e0.2p1". + +USING SYSFS + + Each aoe block device in /sys/block has the extra attributes of + state, mac, and netif. The state attribute is "up" when the device + is ready for I/O and "down" if detected but unusable. The + "down,closewait" state shows that the device is still open and + cannot come up again until it has been closed. + + The mac attribute is the ethernet address of the remote AoE device. + The netif attribute is the network interface on the localhost + through which we are communicating with the remote AoE device. + + There is a script in this directory that formats this information + in a convenient way. + + root@makki linux# sh Documentation/aoe/status.sh + device mac netif state + e6.0 0010040010c6 eth0 up + e6.1 001004001067 eth0 up + e6.2 001004001068 eth0 up + e6.3 001004001065 eth0 up + e6.4 001004001066 eth0 up + e6.5 0010040010c7 eth0 up + e6.6 0010040010c8 eth0 up + e6.7 0010040010c9 eth0 up + e6.8 0010040010ca eth0 up + e6.9 0010040010cb eth0 up + e9.0 001004000020 eth1 up + e9.5 001004000025 eth1 up + e9.9 001004000029 eth1 up + diff --git a/Documentation/aoe/autoload.sh b/Documentation/aoe/autoload.sh new file mode 100644 index 0000000000000..78dad1334c6fc --- /dev/null +++ b/Documentation/aoe/autoload.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# set aoe to autoload by installing the +# aliases in /etc/modprobe.conf + +f=/etc/modprobe.conf + +if test ! -r $f || test ! -w $f; then + echo "cannot configure $f for module autoloading" 1>&2 + exit 1 +fi + +grep major-152 $f >/dev/null +if [ $? = 1 ]; then + echo alias block-major-152 aoe >> $f + echo alias char-major-152 aoe >> $f +fi + diff --git a/Documentation/aoe/mkdevs.sh b/Documentation/aoe/mkdevs.sh new file mode 100644 index 0000000000000..fa007699c636a --- /dev/null +++ b/Documentation/aoe/mkdevs.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +n_shelves=10 + +if test "$#" != "1"; then + echo "Usage: sh mkdevs.sh {dir}" 1>&2 + exit 1 +fi +dir=$1 + +MAJOR=152 + +echo "Creating AoE devnode files in $dir ..." + +set -e + +mkdir -p $dir + +# (Status info is in sysfs. See status.sh.) +# rm -f $dir/stat +# mknod -m 0400 $dir/stat c $MAJOR 1 +rm -f $dir/err +mknod -m 0400 $dir/err c $MAJOR 2 +rm -f $dir/discover +mknod -m 0200 $dir/discover c $MAJOR 3 +rm -f $dir/interfaces +mknod -m 0200 $dir/interfaces c $MAJOR 4 + +i=0 +while test $i -lt $n_shelves; do + sh -xc "sh `dirname $0`/mkshelf.sh $dir $i" + i=`expr $i + 1` +done diff --git a/Documentation/aoe/mkshelf.sh b/Documentation/aoe/mkshelf.sh new file mode 100644 index 0000000000000..ba8c9a8ec0826 --- /dev/null +++ b/Documentation/aoe/mkshelf.sh @@ -0,0 +1,23 @@ +#! /bin/sh + +if test "$#" != "2"; then + echo "Usage: sh mkshelf.sh {dir} {shelfaddress}" 1>&2 + exit 1 +fi +dir=$1 +shelf=$2 +MAJOR=152 + +set -e + +minor=`echo 10 \* $shelf \* 16 | bc` +for slot in `seq 0 9`; do + for part in `seq 0 15`; do + name=e$shelf.$slot + test "$part" != "0" && name=${name}p$part + rm -f $dir/$name + mknod -m 0660 $dir/$name b $MAJOR $minor + + minor=`expr $minor + 1` + done +done diff --git a/Documentation/aoe/status.sh b/Documentation/aoe/status.sh new file mode 100644 index 0000000000000..7b8c8a7f8bd6f --- /dev/null +++ b/Documentation/aoe/status.sh @@ -0,0 +1,15 @@ +# collate and present sysfs information about AoE storage + +set -e +format="%8s\t%12s\t%8s\t%8s\n" + +printf "$format" device mac netif state + +for d in `ls -d /sys/block/etherd* | grep -v p`; do + dev=`echo "$d" | sed 's/.*!//'` + printf "$format" \ + "$dev" \ + "`cat \"$d/mac\"`" \ + "`cat \"$d/netif\"`" \ + "`cat \"$d/state\"`" +done | sort |