Recently i shrinked an ext4 filesystem size to 500GB
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 493G 64G 404G 14% /
now i want to shrink the partition size to fit exactly to the filesystem size.
I tried to used parted and the resizepart command. The problem is when parted asks for the new size. If i choose 500GB the resulting partition is smaller from 500GB and as a result the underlying filesystem cannot fit on this partition. Any hint on how to do the correct size calculations?