There is a very conspicuous inaccuracy in the output of df. I should mention, that it was noticed to to
a sudden change in the amount of space that was left on the backup partition.
The df -h command produces the following output.
Code:
Filesystem Size Used Avail Use% Mounted on
/dev/sdi1 936G 884G 4.3G 100% /backups
My suspicion was immediately directed towards sparse files. The script I found on the following link, found too many files, and no immediate culprit.
A script for locating sparse files:
Code:
#!/bin/sh
# even in 30, it reduced too many results
typeset -i TOL=3 # plus or minus 3 blocks
while [[ ${#} -ge 1 ]]
do
typeset FNAME=${1}
shift
typeset -i SZ=$(ls -l "${FNAME}" | awk '{print $5}')
typeset -i DUSZ=$(du -k "${FNAME}" | awk '{print $1}')
typeset -i RSLT=$(echo "scale=0; h=0; a=(${SZ} / 1024) - ${DUSZ}; if (a < -${TOL}) h=1; if (a > ${TOL}) h=1; h" | bc)
if [[ ${RSLT} -ne 0 ]]
then
echo "${FNAME}"
fi
done
exit 0
The question is: what can be the reason for this inaccuracy?
The server is a run-of-the-mill Centos, with a standard LAMP configuration.
For obvious reasons, the server can't be taken down for an fsck check. And anyway, the problem is not in the '/backups/' partition, as it is only storing data from other locations.
Any ideas?