growfs.sh revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#pragma ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#exec newfs -G "$@"
if [ ! "$UFS_MKFS" ]; then
fi
verbose=""
mkfs_opts="-G"
mkfs_subopts=""
size=""
newsize=0
mkfs_opts="$mkfs_opts $1"
}
mkfs_subopts="-o $1"
else
fi
}
while getopts "GM:Nva:b:c:d:f:i:m:n:o:r:s:t:C:" c ; do
case $c in
G) ;;
N) add_subopt "N" ;;
v) verbose="1" ;;
a) add_subopt "apc=$OPTARG" ;;
b) add_subopt "bsize=$OPTARG" ;;
c) add_subopt "cgsize=$OPTARG" ;;
d) add_subopt "gap=$OPTARG" ;;
f) add_subopt "fragsize=$OPTARG" ;;
i) add_subopt "nbpi=$OPTARG" ;;
m) add_subopt "free=$OPTARG" ;;
n) add_subopt "nrpos=$OPTARG" ;;
o) add_subopt "opt=$OPTARG" ;;
t) add_subopt "ntrack=$OPTARG" ;;
C) add_subopt "maxcontig=$OPTARG" ;;
\?) echo $USAGE; exit 1 ;;
esac
done
if [ $# -ne 1 ]; then
echo $USAGE
exit 1
fi
raw_special=$1
if [ ! "$size" ]; then
echo "$myname: cannot get partition size"
exit 2
fi
fi
if [ -n "$verbose" ]; then
echo $cmd
fi
echo "Growing filesystem in increments due to limited available space."
if [ -n "$verbose" ]; then
echo $cmd
fi
echo "$myname: cannot probe the possible file system size"
exit 2
fi
echo "$myname: the file system is full and cannot be grown, please delete some files"
exit 2
fi
if [ -n "$verbose" ]; then
echo $cmd
fi
exit $retv
fi
done
echo \
"\nThe incremental grow has successfully completed, but since the first growth \
attempt failed (see output from first mkfs(1M) run), the filesystem is still \
locked and needs to be checked with fsck(1M).\n\
Please run \`fsck -F ufs $raw_special' and then unlock the filesystem \
fi
exit $retv