/[pdpsoft]/nl.nikhef.ndpf.tools/lvrasize/lvrasize.cin
ViewVC logotype

Contents of /nl.nikhef.ndpf.tools/lvrasize/lvrasize.cin

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (show annotations) (download)
Fri Apr 25 10:58:23 2008 UTC (14 years, 5 months ago) by davidg
File size: 1138 byte(s)
Added lvraszie tool to public repository

1 #! /bin/bash
2 #
3 # lvrasize @DESCR@
4 #
5 # Author: David Groep
6 #
7 # chkconfig: - 90 10
8 # description: @DESCR@
9
10 # Source function library.
11 . /etc/init.d/functions
12
13 #
14 for prog in /sbin/blockdev /usr/sbin/lvdisplay /usr/sbin/vdisplay
15 do
16 if test \! -x /sbin/blockdev
17 then
18 echo "$0: program $prog not found" >&2
19 exit 1
20 fi
21 done
22
23
24 start() {
25 /usr/sbin/lvdisplay -C | while read lv vg attr size x
26 do
27 [ "$lv" = "LV" -a "$vg" = "VG" ] && continue
28
29 pvs=`/usr/sbin/vgdisplay -v $vg 2>/dev/null | awk '/PV Name/ { print $3 }'`
30 pvramin=0
31 for pv in $pvs
32 do
33 crasize=`/sbin/blockdev --getra $pv`
34 [ "$crasize" -gt "$pvramin" ] && pvramin=$crasize
35 done
36 if [ $pvramin -ge 256 ]; then
37 /sbin/blockdev --setra $pvramin /dev/$vg/$lv
38 else
39 echo "WARNING: small RA size $pvramin for /dev/$vg/$lv not applied" >&2
40 fi
41 done
42
43 return 0;
44 }
45
46 stop() {
47 echo -n $"Block device readahead buffer unchanged: "
48 }
49
50 case "$1" in
51 start | restart | reload )
52 start
53 RETVAL=$?
54 ;;
55 stop )
56 stop
57 RETVAL=0
58 ;;
59 * )
60 echo $"Usage: $0 {start|stop|restart}"
61 RETVAL=0
62 ;;
63 esac
64
65 exit $RETVAL
66

Properties

Name Value
svn:executable *

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