File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 3838RC=0
3939mkdir -p /scratch
4040chmod 1777 /scratch
41- DEVS=$( /usr/bin/ec2-metadata -b | grep ephemeral | awk ' {print $2}' )
41+ MAPPING=$( /usr/bin/ec2-metadata -b | grep ephemeral | awk ' {print $2}' | sed ' s/sd/xvd/' )
42+ for m in MAPPING; do
43+ check=$( stat -t /dev/${m} > /dev/null 2>&1 )
44+ if [ ${check} -eq 0 ]; then
45+ DEVS=" ${m} $DEVS "
46+ fi
47+ done
4248NUM_DEVS=0
4349for d in $DEVS ; do
4450 d=/dev/${d}
@@ -48,7 +54,7 @@ for d in $DEVS; do
4854 parted -s -a optimal ${d} mkpart primary 1MB 100%
4955 parted -s ${d} set 1 lvm on
5056 let NUM_DEVS++
51- PARTITIONS=" $PARTITIONS $ {d} 1"
57+ PARTITIONS=" ${d} 1 $PARTITIONS "
5258done
5359# sleep 10 seconds to let partitions settle (bug?)
5460sleep 10
Original file line number Diff line number Diff line change 5757RC=0
5858mkdir -p /scratch
5959chmod 1777 /scratch
60- DEVS=$( /usr/bin/ec2-metadata -b | grep ephemeral | awk ' {print $2}' )
60+ MAPPING=$( /usr/bin/ec2-metadata -b | grep ephemeral | awk ' {print $2}' | sed ' s/sd/xvd/' )
61+ for m in MAPPING; do
62+ check=$( stat -t /dev/${m} > /dev/null 2>&1 )
63+ if [ ${check} -eq 0 ]; then
64+ DEVS=" ${m} $DEVS "
65+ fi
66+ done
6167NUM_DEVS=0
6268for d in $DEVS ; do
6369 d=/dev/${d}
@@ -67,7 +73,7 @@ for d in $DEVS; do
6773 parted -s -a optimal ${d} mkpart primary 1MB 100%
6874 parted -s ${d} set 1 lvm on
6975 let NUM_DEVS++
70- PARTITIONS=" $PARTITIONS $ {d} 1"
76+ PARTITIONS=" ${d} 1 $PARTITIONS "
7177done
7278# sleep 10 seconds to let partitions settle (bug?)
7379sleep 10
You can’t perform that action at this time.
0 commit comments