2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 18:16:39 +00:00

Remove trailing spaces in file xCAT/postscripts/createFS

This commit is contained in:
GONG Jie 2017-12-31 23:59:59 +00:00
parent ad0f111a3c
commit 86d4db992a

View File

@ -1,15 +1,15 @@
#!/bin/sh
#set -x
#-----------------------------------------------------------------------------
# createFS
# createFS
#
# This script is used to create new FS on xCAT Service Node to hold the nim
# resources. Currently it support AIX system, will support Linux later.
#
# By default, the new FS is created as 5G based on rootvg. But it can be
# By default, the new FS is created as 5G based on rootvg. But it can be
# customized, the options are compatible with AIX crfs command.
#
# If we need to create multiple file systems, then we need to call "create_FS"
# If we need to create multiple file systems, then we need to call "create_FS"
# multiple times at the bottom of this script, passing it different parameters.
#
# For example:
@ -22,13 +22,13 @@
#-----------------------------------------------------------------------------
# For AIX system
# MountPiont, VfsType, VolumeGroup, harddisks, AutoMount, Attributes
# MountPiont, VfsType, VolumeGroup, harddisks, AutoMount, Attributes
FS1="/install,jfs2,rootvg,,yes,size=5G"
#FS2="/install,jfs2,datavg,hdisk2 hdisk3,yes,size=5G frag=512 nbpi=1024"
# To-DO
# For Linux system
# MountPiont, VfsType, fs-options
# MountPiont, VfsType, fs-options
#-----------------------------------------------------------------------------
create_FS(){
@ -59,7 +59,7 @@ create_FS_AIX(){
hd=$4
mnt=$5
attrs=$6
unset IFS
echo "MountPiont: $mp, VfsType: $vfs, VolumeGroup: $vg, harddisks: $hd, AutoMount: $mnt, Attributes: $attrs"
@ -83,7 +83,7 @@ create_FS_AIX(){
# harddisk provided
# check if hardisk is the same with current ones
old_hd=`lsvg -p $vg|grep 'hd'|awk '{print $1}'|tr "\n" " "`
if [ "$old_hd" = "$hd" ]; then
# use the existed vg
tocr_fs=1
@ -147,7 +147,7 @@ create_FS_AIX(){
echo "Back up $mp to $tmp_mp"
bakup=1
fi
# create fs
cmd="crfs"
if [ "$vfs" != "" ]; then
@ -169,7 +169,7 @@ create_FS_AIX(){
if [ "$attrs" != "" ]; then
cmd="$cmd -a $attrs"
fi
echo "Running command: $cmd"
result=`$cmd`
if [ $? -ne 0 ]; then
@ -182,11 +182,11 @@ create_FS_AIX(){
echo "Can not mount file system $mp"
exit 1
fi
# restore /install to FS
if [ "$bakup" = "1" ]; then
echo "Restore $tmp_mp to new FS $mp"
result=`cd $tmp_mp;find . -print | cpio -pdlvu $mp`
if [ $? -ne 0 ]; then
echo "Can not restore $tmp_install to file system $mp"
@ -198,7 +198,7 @@ create_FS_AIX(){
echo "Can not remove $tmp_mp"
exit 1
fi
fi
fi
fi
}