summaryrefslogtreecommitdiff
path: root/recipes-core/fs-init/files/resizefs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/fs-init/files/resizefs.sh')
-rwxr-xr-xrecipes-core/fs-init/files/resizefs.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/recipes-core/fs-init/files/resizefs.sh b/recipes-core/fs-init/files/resizefs.sh
index 78addeb..4f38d0b 100755
--- a/recipes-core/fs-init/files/resizefs.sh
+++ b/recipes-core/fs-init/files/resizefs.sh
@@ -28,19 +28,20 @@ fi
# resize now
-#reduce I/O load by doing this in 32M increments
+#reduce I/O load by doing this in STEPSIZE increments
#idea stolen from here:
#https://codereview.chromium.org/551127
-#get the current size in blocks of 512 byte
+#start from the current size in blocks of 512 byte, add STEPSIZE on each iteration
+STEPSIZE=`expr 64 \* 1024 \* 2`
NEXTSIZE=`df /dev/$PART | grep /dev/root | awk '{print $2}'`
NEXTSIZE=`expr $NEXTSIZE \* 2`
-NEXTSIZE=`expr $NEXTSIZE + 32 \* 1024 \* 2`
+NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE`
while [ $NEXTSIZE -lt $FSSIZE ]; do
FSSIZEMEG=`expr $NEXTSIZE / 2 / 1024`"M"
resize2fs /dev/$PART $FSSIZEMEG
sleep 1
- NEXTSIZE=`expr $NEXTSIZE + 32 \* 1024 \* 2`
+ NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE`
done
FSSIZEMEG=`expr $FSSIZE / 2 / 1024`"M"
resize2fs /dev/$PART $FSSIZEMEG