/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/openib-mount/openib-mount.cin
ViewVC logotype

Annotation of /trunk/nl.nikhef.ndpf.tools/openib-mount/openib-mount.cin

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1181 - (hide annotations) (download)
Wed Nov 25 12:50:36 2009 UTC (12 years, 5 months ago) by tsuerink
File size: 1782 byte(s)
added openib-mount script for the hooimaanden
1 tsuerink 1181 #! /bin/bash
2     #
3     # openib-mount @DESCR@
4     #
5     # Author: Tristan Suerink
6     #
7     # chkconfig: 2345 98 02
8     # description: @DESCR@
9    
10     # Source function library.
11     . /etc/init.d/functions
12    
13     start()
14     {
15     /etc/init.d/opensmd stop
16     /etc/init.d/openibd stop
17     sleep 5
18     /etc/init.d/openibd start
19     sleep 5
20     # Load Mellanox hardware driver; /etc/init.d/openibd should do this but better safe than sorry.
21     modprobe ib_mthca
22     sleep 5
23     /etc/init.d/opensmd start
24     sleep 5
25     echo -n $"Add target:"
26     /usr/sbin/ibsrpdm -d /dev/infiniband/umad1 -c | sed -e "s/\(service_id\)/max_sect=4096,max_cmd_per_lun=4,\1/" > /sys/class/infiniband_srp/srp-mthca0-2/add_target 2>/dev/null&
27     sleep 15
28     devices=`cd /sys/block; /bin/ls -1d * | grep sd | grep -v sda`
29     if [ "x$devices" == "x" ]; then
30     failure
31     echo
32     /etc/init.d/opensmd stop
33     /etc/init.d/openibd stop
34     echo "No devices detected"
35     exit 1
36     else
37     success
38     echo
39     fi
40    
41     for device in $devices
42     do
43     /usr/local/sbin/tune-ddn.sh S2A9900 $device
44     done
45    
46     fd=`echo $devices | sed 's/sd/\/dev\/sd/g'`
47    
48     echo -n $"Start software raid:"
49     mdadm --assemble /dev/md0 $fd >/dev/null 2>&1
50     if [ "x$?" != "x0" ]; then
51     failure
52     echo
53     /etc/init.d/opensmd stop
54     /etc/init.d/openibd stop
55     exit 1
56     else
57     success
58     echo
59     fi
60     sleep 5
61     echo -n $"Mounting file system:"
62     mount -t xfs /dev/md0 /space >/dev/null 2>&1 && success || failure
63     echo
64     }
65    
66     stop()
67     {
68     echo -n $"Unounting file system:"
69     umount /space >/dev/null 2>&1 && success || failure
70     echo
71     echo -n $"Stop software raid:"
72     mdadm --stop /dev/md0 >/dev/null 2>&1 && success || failure
73     echo
74     /etc/init.d/opensmd stop
75     /etc/init.d/openibd stop
76     }
77    
78     restart ()
79     {
80     stop
81     start
82     }
83    
84     usage ()
85     {
86     echo
87     echo "Usage: `basename $0` {start|stop|restart}"
88     echo
89     return 2
90     }
91    
92     case "$1" in
93     start) start;;
94     stop) stop;;
95     restart) restart;;
96     *) usage;;
97     esac

Properties

Name Value
svn:executable *

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28