Talk:df (Unix)

Latest comment: 17 years ago by Carpetsmoker in topic df fakes the numbers?


[Untitled

edit

Isn't the default 1K blocks? --70.132.24.230 19:42, 15 January 2006 (UTC)Reply

The default output of df is blocks; however, blocks default to 512b, 1k, or 8k, depending on the filesystem in question. --ssd 07:41, 16 January 2006 (UTC)Reply

df fakes the numbers?

edit

The UNIX Haters Handbook states that df (obviously circa 1990) fakes the numbers to prevent a disk from actually becoming 100% full, except for root. Is this the case in the GNU implementation (or indeed was it ever the case)? — The preceding unsigned comment was added by Rossheth (talkcontribs) 21:49, 3 February 2007 (UTC).Reply

I'm not sure it's df that does that. A standard option for Linux when setting up filesystems is to reserve a set percentage (usually 5%) for root, but df sort of reports it. That is, I can run df and get /dev/hda6 ext3 66G 62G 407M 100% /home on one line; obviously 407M + 62G != 66G. The difference is the reserved percentage. --Gwern (contribs) 01:22 4 February 2007 (GMT)
Gwern is right, most (if not all) Unix like system reserve some diskspace, IEEE Std 1003.1, 2004 Edition states:
<percentage used>
The percentage of the normally available space that is currently allocated to all files on the file system. This shall be calculated using the fraction: <space used>/( <space used>+ <space free>) expressed as a percentage. This percentage may be greater than 100 if <space free> is less than zero. The percentage value shall be expressed as a positive integer, with any fractional result causing it to be rounded to the next highest integer.
Note Editing main page to include this Carpetsmoker 01:50, 15 February 2007 (UTC)Reply