diff --git a/pishrink.sh b/pishrink.sh index f16af49..bf40aaf 100755 --- a/pishrink.sh +++ b/pishrink.sh @@ -334,15 +334,8 @@ if [[ $currentsize -eq $minsize ]]; then exit 11 fi -#Add some free space to the end of the filesystem -extra_space=$(($currentsize - $minsize)) -logVariables $LINENO extra_space -for space in 5000 1000 100; do - if [[ $extra_space -gt $space ]]; then - minsize=$(($minsize + $space)) - break - fi -done +#Add 5% free space to the end of the filesystem +minsize=$(($minsize + ($minsize/20))) logVariables $LINENO minsize #Shrink filesystem