df command output, doesn't add up?
I do a df command on my mounted 256MB memory key and it reports in default 1K-blocks:
total: 245993 used: 3741 avail: 242253 well, if I add up avail and used, I get 1 more than the total. Am I missing something here .. is it a matter of df rounding up counts of bytes ? By the way, IS there a way to get it to report the numbers in bytes, I couldn't see to find an option for that in my version 4.5.8. |
To express it in bytes, use `df --block-size=1`.
|
might try df -h. that will put it in human readable form.
|
You are supposed to get one extra because the drive starts at 0 and df starts at 1.
|
Thanks for all the responses so far, going to play with the --block-size=1.
But I am confused by the post that says the counts are supposed to be off by 1. I don't get it. No matter where the drive starts and where df starts, what df reports for used space and avail space should add up to total space. |
it appears the counts being off is due to rounding off. When I run the df with --block-size=1, I get counts of:
total: 251896832 used: 3830272 avail: 248066560 and those add up ... So I would *guess* the df code is rounding off when you get the data in bigger chunks .. maybe it needs to round up used and round down avail or something like that ... thanks for all the help folks ... |
All times are GMT -5. The time now is 02:34 PM. |