Can't get disk space back after running out of space (and removing some files) in Ubuntu 18.04
Solution 1:
Find out what is eating up the disk space, and then find out why, before deleting something.
To show the "Top 10 directories", you could use du -Sh / | sort -rh | head -10
.
To show the "Top 10" files", you could use find / -type f -exec du -Sh {} + | sort -rh | head -n 10
.
Often you will find huge or not rotated log files, of fast-filling log files. Depending on your findings, it is sometimes enough to delete some older log files, or to configure log rotate, or to configure the log-settings of your services.
Regarding your calculation: This does not have to drive you crazy :-)
Often filesystems reserve 5% space for use by the root user. You have 315G disk size, so 5% would be ~16G reserved space. There is a nice article which explains the background: https://blog.tinned-software.net/utility-df-shows-inconsistent-calculation-for-ext-filesystems/