Fixed a bug when target size is larger or equal to current size.
This commit is contained in:
parent
7244a229e7
commit
540cd52832
10
pishrink.sh
10
pishrink.sh
|
@ -363,8 +363,14 @@ if [[ $currentsize -eq $minsize ]]; then
|
|||
fi
|
||||
|
||||
#Add some free space to the end of the filesystem
|
||||
minsize=$(($minsize + $extraspace * 1024**2 / $blocksize))
|
||||
logVariables $LINENO minsize
|
||||
targetsize=$(($minsize + $extraspace * 1024**2 / $blocksize))
|
||||
if [ $targetsize -ge $currentsize ]; then
|
||||
info "Target size ($targetsize) too large, force to current size minus 1"
|
||||
let minsize=$currentsize-1
|
||||
else
|
||||
minsize=$targetsize
|
||||
fi
|
||||
logVariables $LINENO targetsize currentsize minsize
|
||||
|
||||
#Shrink filesystem
|
||||
info "Shrinking filesystem"
|
||||
|
|
Loading…
Reference in New Issue