diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/aoe |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'Documentation/aoe')
-rw-r--r-- | Documentation/aoe/aoe.txt | 91 | ||||
-rw-r--r-- | Documentation/aoe/autoload.sh | 17 | ||||
-rw-r--r-- | Documentation/aoe/mkdevs.sh | 36 | ||||
-rw-r--r-- | Documentation/aoe/mkshelf.sh | 25 | ||||
-rw-r--r-- | Documentation/aoe/status.sh | 31 | ||||
-rw-r--r-- | Documentation/aoe/udev-install.sh | 26 | ||||
-rw-r--r-- | Documentation/aoe/udev.txt | 23 |
7 files changed, 249 insertions, 0 deletions
diff --git a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt new file mode 100644 index 000000000000..43e50108d0e2 --- /dev/null +++ b/Documentation/aoe/aoe.txt | |||
@@ -0,0 +1,91 @@ | |||
1 | The EtherDrive (R) HOWTO for users of 2.6 kernels is found at ... | ||
2 | |||
3 | http://www.coraid.com/support/linux/EtherDrive-2.6-HOWTO.html | ||
4 | |||
5 | It has many tips and hints! | ||
6 | |||
7 | CREATING DEVICE NODES | ||
8 | |||
9 | Users of udev should find the block device nodes created | ||
10 | automatically, but to create all the necessary device nodes, use the | ||
11 | udev configuration rules provided in udev.txt (in this directory). | ||
12 | |||
13 | There is a udev-install.sh script that shows how to install these | ||
14 | rules on your system. | ||
15 | |||
16 | If you are not using udev, two scripts are provided in | ||
17 | Documentation/aoe as examples of static device node creation for | ||
18 | using the aoe driver. | ||
19 | |||
20 | rm -rf /dev/etherd | ||
21 | sh Documentation/aoe/mkdevs.sh /dev/etherd | ||
22 | |||
23 | ... or to make just one shelf's worth of block device nodes ... | ||
24 | |||
25 | sh Documentation/aoe/mkshelf.sh /dev/etherd 0 | ||
26 | |||
27 | There is also an autoload script that shows how to edit | ||
28 | /etc/modprobe.conf to ensure that the aoe module is loaded when | ||
29 | necessary. | ||
30 | |||
31 | USING DEVICE NODES | ||
32 | |||
33 | "cat /dev/etherd/err" blocks, waiting for error diagnostic output, | ||
34 | like any retransmitted packets. | ||
35 | |||
36 | "echo eth2 eth4 > /dev/etherd/interfaces" tells the aoe driver to | ||
37 | limit ATA over Ethernet traffic to eth2 and eth4. AoE traffic from | ||
38 | untrusted networks should be ignored as a matter of security. | ||
39 | |||
40 | "echo > /dev/etherd/discover" tells the driver to find out what AoE | ||
41 | devices are available. | ||
42 | |||
43 | These character devices may disappear and be replaced by sysfs | ||
44 | counterparts, so distribution maintainers are encouraged to create | ||
45 | scripts that use these devices. | ||
46 | |||
47 | The block devices are named like this: | ||
48 | |||
49 | e{shelf}.{slot} | ||
50 | e{shelf}.{slot}p{part} | ||
51 | |||
52 | ... so that "e0.2" is the third blade from the left (slot 2) in the | ||
53 | first shelf (shelf address zero). That's the whole disk. The first | ||
54 | partition on that disk would be "e0.2p1". | ||
55 | |||
56 | USING SYSFS | ||
57 | |||
58 | Each aoe block device in /sys/block has the extra attributes of | ||
59 | state, mac, and netif. The state attribute is "up" when the device | ||
60 | is ready for I/O and "down" if detected but unusable. The | ||
61 | "down,closewait" state shows that the device is still open and | ||
62 | cannot come up again until it has been closed. | ||
63 | |||
64 | The mac attribute is the ethernet address of the remote AoE device. | ||
65 | The netif attribute is the network interface on the localhost | ||
66 | through which we are communicating with the remote AoE device. | ||
67 | |||
68 | There is a script in this directory that formats this information | ||
69 | in a convenient way. | ||
70 | |||
71 | root@makki root# sh Documentation/aoe/status.sh | ||
72 | e10.0 eth3 up | ||
73 | e10.1 eth3 up | ||
74 | e10.2 eth3 up | ||
75 | e10.3 eth3 up | ||
76 | e10.4 eth3 up | ||
77 | e10.5 eth3 up | ||
78 | e10.6 eth3 up | ||
79 | e10.7 eth3 up | ||
80 | e10.8 eth3 up | ||
81 | e10.9 eth3 up | ||
82 | e4.0 eth1 up | ||
83 | e4.1 eth1 up | ||
84 | e4.2 eth1 up | ||
85 | e4.3 eth1 up | ||
86 | e4.4 eth1 up | ||
87 | e4.5 eth1 up | ||
88 | e4.6 eth1 up | ||
89 | e4.7 eth1 up | ||
90 | e4.8 eth1 up | ||
91 | e4.9 eth1 up | ||
diff --git a/Documentation/aoe/autoload.sh b/Documentation/aoe/autoload.sh new file mode 100644 index 000000000000..78dad1334c6f --- /dev/null +++ b/Documentation/aoe/autoload.sh | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/sh | ||
2 | # set aoe to autoload by installing the | ||
3 | # aliases in /etc/modprobe.conf | ||
4 | |||
5 | f=/etc/modprobe.conf | ||
6 | |||
7 | if test ! -r $f || test ! -w $f; then | ||
8 | echo "cannot configure $f for module autoloading" 1>&2 | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | grep major-152 $f >/dev/null | ||
13 | if [ $? = 1 ]; then | ||
14 | echo alias block-major-152 aoe >> $f | ||
15 | echo alias char-major-152 aoe >> $f | ||
16 | fi | ||
17 | |||
diff --git a/Documentation/aoe/mkdevs.sh b/Documentation/aoe/mkdevs.sh new file mode 100644 index 000000000000..6ce70703eb47 --- /dev/null +++ b/Documentation/aoe/mkdevs.sh | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | n_shelves=${n_shelves:-10} | ||
4 | n_partitions=${n_partitions:-16} | ||
5 | |||
6 | if test "$#" != "1"; then | ||
7 | echo "Usage: sh `basename $0` {dir}" 1>&2 | ||
8 | exit 1 | ||
9 | fi | ||
10 | dir=$1 | ||
11 | |||
12 | MAJOR=152 | ||
13 | |||
14 | echo "Creating AoE devnode files in $dir ..." | ||
15 | |||
16 | set -e | ||
17 | |||
18 | mkdir -p $dir | ||
19 | |||
20 | # (Status info is in sysfs. See status.sh.) | ||
21 | # rm -f $dir/stat | ||
22 | # mknod -m 0400 $dir/stat c $MAJOR 1 | ||
23 | rm -f $dir/err | ||
24 | mknod -m 0400 $dir/err c $MAJOR 2 | ||
25 | rm -f $dir/discover | ||
26 | mknod -m 0200 $dir/discover c $MAJOR 3 | ||
27 | rm -f $dir/interfaces | ||
28 | mknod -m 0200 $dir/interfaces c $MAJOR 4 | ||
29 | |||
30 | export n_partitions | ||
31 | mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'` | ||
32 | i=0 | ||
33 | while test $i -lt $n_shelves; do | ||
34 | sh -xc "sh $mkshelf $dir $i" | ||
35 | i=`expr $i + 1` | ||
36 | done | ||
diff --git a/Documentation/aoe/mkshelf.sh b/Documentation/aoe/mkshelf.sh new file mode 100644 index 000000000000..40932836bb80 --- /dev/null +++ b/Documentation/aoe/mkshelf.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | if test "$#" != "2"; then | ||
4 | echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2 | ||
5 | exit 1 | ||
6 | fi | ||
7 | n_partitions=${n_partitions:-16} | ||
8 | dir=$1 | ||
9 | shelf=$2 | ||
10 | MAJOR=152 | ||
11 | |||
12 | set -e | ||
13 | |||
14 | minor=`echo 10 \* $shelf \* $n_partitions | bc` | ||
15 | endp=`echo $n_partitions - 1 | bc` | ||
16 | for slot in `seq 0 9`; do | ||
17 | for part in `seq 0 $endp`; do | ||
18 | name=e$shelf.$slot | ||
19 | test "$part" != "0" && name=${name}p$part | ||
20 | rm -f $dir/$name | ||
21 | mknod -m 0660 $dir/$name b $MAJOR $minor | ||
22 | |||
23 | minor=`expr $minor + 1` | ||
24 | done | ||
25 | done | ||
diff --git a/Documentation/aoe/status.sh b/Documentation/aoe/status.sh new file mode 100644 index 000000000000..6628116d4a9f --- /dev/null +++ b/Documentation/aoe/status.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #! /bin/sh | ||
2 | # collate and present sysfs information about AoE storage | ||
3 | |||
4 | set -e | ||
5 | format="%8s\t%8s\t%8s\n" | ||
6 | me=`basename $0` | ||
7 | sysd=${sysfs_dir:-/sys} | ||
8 | |||
9 | # printf "$format" device mac netif state | ||
10 | |||
11 | # Suse 9.1 Pro doesn't put /sys in /etc/mtab | ||
12 | #test -z "`mount | grep sysfs`" && { | ||
13 | test ! -d "$sysd/block" && { | ||
14 | echo "$me Error: sysfs is not mounted" 1>&2 | ||
15 | exit 1 | ||
16 | } | ||
17 | test -z "`lsmod | grep '^aoe'`" && { | ||
18 | echo "$me Error: aoe module is not loaded" 1>&2 | ||
19 | exit 1 | ||
20 | } | ||
21 | |||
22 | for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do | ||
23 | # maybe ls comes up empty, so we use "end" | ||
24 | test $d = end && continue | ||
25 | |||
26 | dev=`echo "$d" | sed 's/.*!//'` | ||
27 | printf "$format" \ | ||
28 | "$dev" \ | ||
29 | "`cat \"$d/netif\"`" \ | ||
30 | "`cat \"$d/state\"`" | ||
31 | done | sort | ||
diff --git a/Documentation/aoe/udev-install.sh b/Documentation/aoe/udev-install.sh new file mode 100644 index 000000000000..861a27f98771 --- /dev/null +++ b/Documentation/aoe/udev-install.sh | |||
@@ -0,0 +1,26 @@ | |||
1 | # install the aoe-specific udev rules from udev.txt into | ||
2 | # the system's udev configuration | ||
3 | # | ||
4 | |||
5 | me="`basename $0`" | ||
6 | |||
7 | # find udev.conf, often /etc/udev/udev.conf | ||
8 | # (or environment can specify where to find udev.conf) | ||
9 | # | ||
10 | if test -z "$conf"; then | ||
11 | if test -r /etc/udev/udev.conf; then | ||
12 | conf=/etc/udev/udev.conf | ||
13 | else | ||
14 | conf="`find /etc -type f -name udev.conf 2> /dev/null`" | ||
15 | if test -z "$conf" || test ! -r "$conf"; then | ||
16 | echo "$me Error: no udev.conf found" 1>&2 | ||
17 | exit 1 | ||
18 | fi | ||
19 | fi | ||
20 | fi | ||
21 | |||
22 | # find the directory where udev rules are stored, often | ||
23 | # /etc/udev/rules.d | ||
24 | # | ||
25 | rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`" | ||
26 | test "$rules_d" && sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules" | ||
diff --git a/Documentation/aoe/udev.txt b/Documentation/aoe/udev.txt new file mode 100644 index 000000000000..ab39d8bb634c --- /dev/null +++ b/Documentation/aoe/udev.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | # These rules tell udev what device nodes to create for aoe support. | ||
2 | # They may be installed along the following lines (adjusted to what | ||
3 | # you see on your system). | ||
4 | # | ||
5 | # ecashin@makki ~$ su | ||
6 | # Password: | ||
7 | # bash# find /etc -type f -name udev.conf | ||
8 | # /etc/udev/udev.conf | ||
9 | # bash# grep udev_rules= /etc/udev/udev.conf | ||
10 | # udev_rules="/etc/udev/rules.d/" | ||
11 | # bash# ls /etc/udev/rules.d/ | ||
12 | # 10-wacom.rules 50-udev.rules | ||
13 | # bash# cp /path/to/linux-2.6.xx/Documentation/aoe/udev.txt \ | ||
14 | # /etc/udev/rules.d/60-aoe.rules | ||
15 | # | ||
16 | |||
17 | # aoe char devices | ||
18 | SUBSYSTEM="aoe", KERNEL="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
19 | SUBSYSTEM="aoe", KERNEL="err", NAME="etherd/%k", GROUP="disk", MODE="0440" | ||
20 | SUBSYSTEM="aoe", KERNEL="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
21 | |||
22 | # aoe block devices | ||
23 | KERNEL="etherd*", NAME="%k", GROUP="disk" | ||