Author: parv
Date: 23-12-05 01:14
The comment similar to the following comes up quite often on FreeBSD mailing list(s): in df(1) output "Avail" (4th column) and "Used" (3d) columns, for FreeBSD slices, do not add up to the "1K-blocks" (if BLOCKSIZE is set to 1kB; 2d column). Below is a short pipeline to confirm that comment (assuming default settings while setting up a slice)...
df -t ufs \
| tail +2 \
| awk ' { sum = $3 + $4 + $2 * 0.08;
printf "%s: space diff: %f\n" , $1 , $2 - sum
}
'
Above ...
- df -t ufs lists the usage only for mounted UFS slices;
- tail +2 skips the "Filesystem ... Mounted on" header;
- awk for each slice ...
-- sum = $3 + $4 + $2 * 0.08; sums up the 3d & 4th columns, and 8% of the total reported size;
-- printf "%s: space diff: %f\n" , $1 , $2 - sum prints the difference in the reported size and the calculated total size.
|
|