Fixed a bug when target size is larger or equal to current size.

This commit is contained in:
Phuong Vu 2022-03-25 07:05:41 +07:00
parent 7244a229e7
commit 540cd52832
1 changed files with 8 additions and 2 deletions

View File

@ -363,8 +363,14 @@ if [[ $currentsize -eq $minsize ]]; then
fi fi
#Add some free space to the end of the filesystem #Add some free space to the end of the filesystem
minsize=$(($minsize + $extraspace * 1024**2 / $blocksize)) targetsize=$(($minsize + $extraspace * 1024**2 / $blocksize))
logVariables $LINENO minsize 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 #Shrink filesystem
info "Shrinking filesystem" info "Shrinking filesystem"