Skip to content

Commit 1ef5a91

Browse files
authored
Update linux_userData.sh
- fix comments
1 parent bbd7346 commit 1ef5a91

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Management-Utilities/ec2-user-data-iscsi-create-and-mount/linux_userData.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ device_name=fsxontap
219219
# multipaths {
220220
# multipath {
221221
# wwid 3600a0980${serialHex}
222-
# alias ${device_name}
222+
# alias ${VOLUME_NAME}
223223
# }
224224
# }
225225
# Assign name to block device, this should be function that will get serial hex and device name
@@ -228,7 +228,6 @@ logMessage "${commandDescription}"
228228
cp /etc/multipath.conf /etc/multipath.conf_backup
229229

230230
SERIAL_HEX=$serialHex
231-
#ALIAS=$device_name
232231
ALIAS=$VOLUME_NAME
233232
CONF=/etc/multipath.conf
234233
chmod o+rw $CONF
@@ -240,7 +239,7 @@ else
240239
printf "multipaths {\n\tmultipath {\n\t\twwid 3600a0980$SERIAL_HEX\n\t\talias $ALIAS\n\t}\n}" >> $CONF
241240
fi
242241

243-
fileContent=$(cat $CONF)
242+
fileContent="$(cat $CONF)"
244243
logMessage "Updated /etc/multipath.conf file content: $fileContent"
245244

246245
commandDescription="Restart the multipathd service for the changes at: /etc/multipathd.conf will take effect."
@@ -283,7 +282,7 @@ checkCommand "${commandDescription}"
283282
addUndoCommand "rm -rf /$directory_path/$mount_point"
284283

285284
#check this command
286-
# volume_name=the frindly device name as we set it in the multipath.conf file
285+
# volume_name=the friendly device name as we set it in the multipath.conf file
287286
commandDescription="Creating the file system for the new partition: /dev/mapper/${ALIAS}"
288287
logMessage "${commandDescription}"
289288
mkfs.ext4 /dev/mapper/$ALIAS
@@ -295,13 +294,13 @@ mount -t ext4 /dev/mapper/$ALIAS /$directory_path/$mount_point
295294
checkCommand "${commandDescription}"
296295
addUndoCommand "umount /$directory_path/$mount_point"
297296

298-
username=$(whoami)
299-
chown $username:$username /$directory_path/$mount_point
300-
301297
# verify read write
302298
# example: echo "test mount iscsci" > /mnt/myIscsi/testIscsi.txt
299+
commandDescription="Verify read write on the mounted file system"
300+
logMessage "${commandDescription}"
303301
echo "test mount iscsci" > /$directory_path/$mount_point/testIscsi.txt
304302
cat /$directory_path/$mount_point/testIscsi.txt
303+
checkCommand "${commandDescription}"
305304
rm /$directory_path/$mount_point/testIscsi.txt
306305

307306
logMessage "Mounting the FSXn iSCSI volume was successful."

0 commit comments

Comments
 (0)