From owner-freebsd-doc Wed Nov 7 6:10: 9 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 107CF37B41A for ; Wed, 7 Nov 2001 06:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fA7EA1L88318; Wed, 7 Nov 2001 06:10:01 -0800 (PST) (envelope-from gnats) Received: from blackhelicopters.org (geburah.blackhelicopters.org [209.69.178.18]) by hub.freebsd.org (Postfix) with ESMTP id DB52E37B405 for ; Wed, 7 Nov 2001 06:09:22 -0800 (PST) Received: (from mwlucas@localhost) by blackhelicopters.org (8.9.3/8.9.3) id JAA01617; Wed, 7 Nov 2001 09:09:22 -0500 (EST) (envelope-from mwlucas) Message-Id: <200111071409.JAA01617@blackhelicopters.org> Date: Wed, 7 Nov 2001 09:09:22 -0500 (EST) From: mwlucas@blackhelicopters.org Reply-To: mwlucas@blackhelicopters.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: docs/31821: new FAQ: du/df Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31821 >Category: docs >Synopsis: new FAQ: du/df >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 07 06:10:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Michael Lucas >Release: FreeBSD 3.5-STABLE i386 >Organization: None >Environment: yesterday's -doc tree >Description: People have asked several times about the difference between du and df; specifically, the example cited below keeps happening. >How-To-Repeat: read -questions >Fix: *** 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 09:05:22 2001 *************** *** 5869,5874 **** --- 5869,5921 ---- + + The du and df + commands show different amounts of disk space available? + What's going on? + + + + You need to understand what du and + df really do. du + shows how much of the disk is designated used by + files. df shows how much of + the disk is designated free. While + they seem to be opposite, that isn't exactly true. + + When a program has a file open, and you delete the + file, it isn't really deleted until the program releases + the file. You can see this easily enough with a program + such as more. If you delete a file + while using more on it, + more doesn't immediately choke and + complain that it cannot view the file. You cannot access + the file from anywhere except that more + window. If the file is large enough, + df will show that it is gone. The + space the file took up is now designated free. + du will show that it is still there, as + the space the file uses is still technically in use. Once + you end the more session, + du and df will + agree. + + 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! + + 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 /var. + 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;. + + + + How can I add more swap space? >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message