FreeBSD Bugzilla – Attachment 17535 Details for
Bug 31821
new FAQ: du/df
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
du-vs-df
du-vs-df (text/plain; charset=us-ascii), 3.32 KB, created by
Michael W Lucas
on 2001-11-07 16:10:34 UTC
(
hide
)
Description:
du-vs-df
Filename:
MIME Type:
Creator:
Michael W Lucas
Created:
2001-11-07 16:10:34 UTC
Size:
3.32 KB
patch
obsolete
>*** en_US.ISO8859-1/books/faq/book.sgml-dist Mon Nov 5 10:49:36 2001 >--- en_US.ISO8859-1/books/faq/book.sgml Wed Nov 7 11:09:10 2001 >*************** >*** 5869,5874 **** >--- 5869,5929 ---- > </qandaentry> > > <qandaentry> >+ <question id="du-vs-df"> >+ <para>The <command>du</command> and <command>df</command> >+ commands show different amounts of disk space available. >+ What's going on?</para> >+ </question> >+ >+ <answer> >+ <para>You need to understand what <command>du</command> and >+ <command>df</command> really do. <command>du</command> >+ goes through the directory tree, measures how large each >+ file is, and presents the totals. <command>df</command> >+ just asks the filesystem how much space it has left. They >+ seem to be the same thing, but a file without a directory >+ entry will affect <command>df</command> but not >+ <command>du</command>.</para> >+ >+ <para>When a program is using a file, and you delete the >+ file, the file isn't really removed from the filesystem >+ until the program stops using it. The file is immediately >+ deleted from the directory listing, however. You can see >+ this easily enough with a program such as >+ <command>more</command>. Assume you have a file large >+ enough that its presence affects the output of >+ <command>du</command> and <command>df</command>. (Since >+ disks can be so large today, this might be a >+ <emphasis>very</emphasis> large file!) If you delete this >+ file while using <command>more</command> on it, >+ <command>more</command> doesn't immediately choke and >+ complain that it cannot view the file. The entry is >+ simply removed from the directory so no other program or >+ user can access it. <command>du</command> shows that it >+ is gone -- it has walked the directory tree and the file >+ isn't listed. <command>df</command> shows that it is >+ still there, as the filesystem knows that >+ <command>more</command> is still using that space. Once >+ you end the <command>more</command> session, >+ <command>du</command> and <command>df</command> will >+ agree.</para> >+ >+ <para>Note that softupdates can delay the freeing of disk >+ space; you might need to wait up to 30 seconds for the >+ change to be visible!</para> >+ >+ <para>This situation is common on web servers. Many people >+ set up a FreeBSD web server and forget to rotate the log >+ files. The access log fills up <filename>/var</filename>. >+ The new administrator deletes the file, but the system >+ still complains that the partition is full. Stopping and >+ restarting the web server program would free the file, >+ allowing the system to release the disk space. To prevent >+ this from happening, set up &man.newsyslog.8;.</para> >+ </answer> >+ </qandaentry> >+ >+ <qandaentry> > <question id="add-swap-space"> > <para>How can I add more swap space?</para> > </question>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 31821
:
17534
| 17535