Calculating add. free space
Calculating freespace instead of adding a fixed amount.
This commit is contained in:
parent
48d175607e
commit
7e6b1521a8
11
pishrink.sh
11
pishrink.sh
|
@ -330,15 +330,8 @@ if [[ $currentsize -eq $minsize ]]; then
|
||||||
exit 11
|
exit 11
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Add some free space to the end of the filesystem
|
#Add 5% free space to the end of the filesystem
|
||||||
extra_space=$(($currentsize - $minsize))
|
minsize=$(($minsize + ($minsize/20)))
|
||||||
logVariables $LINENO extra_space
|
|
||||||
for space in 5000 1000 100; do
|
|
||||||
if [[ $extra_space -gt $space ]]; then
|
|
||||||
minsize=$(($minsize + $space))
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
logVariables $LINENO minsize
|
logVariables $LINENO minsize
|
||||||
|
|
||||||
#Shrink filesystem
|
#Shrink filesystem
|
||||||
|
|
Loading…
Reference in New Issue