File: create_segment

package info (click to toggle)
evms 2.5.2-1.sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,248 kB
  • ctags: 15,488
  • sloc: ansic: 201,340; perl: 12,421; sh: 4,262; makefile: 1,516; yacc: 316; sed: 16
file content (29 lines) | stat: -rwxr-xr-x 414 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# Use the EVMS CLI to create a segment.

freespace=$1
size=$2		# In MB
type=$3		# "p" or "e"...only works for DOS.

if [ -z $size ]; then
	echo "USAGE: `basename $0` <freespace_segment> <size> [p|e]"
	exit 1
fi

case "$type" in
	p)
		type=",Primary=TRUE"
		;;
	e)
		type=",Primary=FALSE"
		;;
	*)
		type=""
		;;
esac

evms -s << EOF > /dev/null
create:segment,${freespace},size=${size}MB${type}
EOF