When I use the statvfs command on a Linux machine to get available free space on a mounted file system, the number I get is slightly different from what df reports.
For example, on the computer that I have with a 500G hard drive, I get the following output from df:
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/md0 492256247808 3422584832 463828406272 1% /
tmpfs 2025721856 0 2025721856 0% /lib/init/rw
varrun 2025721856 114688 2025607168 1% /var/run
varlock 2025721856 4096 2025717760 1% /var/lock
udev 2025721856 147456 2025574400 1% /dev
tmpfs 2025721856 94208 2025627648 1% /dev/shm
The statvfs call gives me a block size of 4096 and 119344155 free blocks, so there should be 488 833 658 880 bytes for free. However, df reports that there are 463,828,406,272 bytes. Why is there a mismatch here?
Charles Salvia
source
share