pavement

Df

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
m
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[df]] is acronymic for '''disk free'''
+
[[df]] is acronymic for '''disk free'''.
  
 
When this command is used with no parameters, it will display the amount of disk space free on each mounted device in a 512-byte per block count, as well as a percentage.
 
When this command is used with no parameters, it will display the amount of disk space free on each mounted device in a 512-byte per block count, as well as a percentage.
Line 24: Line 24:
 
  Filesystem    Size  Used  Avail Capacity  Mounted on
 
  Filesystem    Size  Used  Avail Capacity  Mounted on
 
  /dev/ad0s1a  132M  107M    15M    88%    /
 
  /dev/ad0s1a  132M  107M    15M    88%    /
 +
 +
== Deleting locked files ==
 +
 +
Scenario:  MySQL is giving you error 28's, and you find /var is completely full.  You find that Apache's logs have grown over 200MB, so you delete them.  The 200MB this should free would put you well within limits...  but for some reason, df still reports that /var is completely full.  Why?
 +
 +
The problem is that even though you deleted the logfile, Apache still held a lock on it and thus the space cannot be reclaimed yet by the filesystem.  This is not an error on [df]'s part; the space really is still being taken up until the lock is released.  To fix it, you merely need to restart apache, (perhaps using [[Apachectl]]).  Apache then releases the log file, df shows the space returned as free, and MySQL goes back to working.
  
 
[[Category:System Commands]]
 
[[Category:System Commands]]

Latest revision as of 02:56, 19 June 2007

df is acronymic for disk free.

When this command is used with no parameters, it will display the amount of disk space free on each mounted device in a 512-byte per block count, as well as a percentage.

You may specify either a device path or plain directory path to retrieve the associated mount-point information. Also, the parameter -h may be used to have the output displayed in 'human-readable' format.

[light@splat ~]$ /bin/df
Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad0s1a    128990   104110   14562    88%    /
/dev/ad0s1f    257998      146  237214     0%    /tmp
/dev/ad0s1g  18809884 15014076 2291018    87%    /usr
/dev/ad0s1e    257998   236788     572   100%    /var
procfs              4        4       0   100%    /proc
[light@splat ~]$ df /tmp
Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad0s1f    257998      146  237214     0%    /tmp
[light@splat ~]$ df /dev/ad0s1f
Filesystem  1K-blocks     Used   Avail Capacity  Mounted on
/dev/ad0s1f    257998      146  237214     0%    /tmp
[light@splat ~]$ df -h /
Filesystem    Size   Used  Avail Capacity  Mounted on
/dev/ad0s1a   132M   107M    15M    88%    /

[edit] Deleting locked files

Scenario: MySQL is giving you error 28's, and you find /var is completely full. You find that Apache's logs have grown over 200MB, so you delete them. The 200MB this should free would put you well within limits... but for some reason, df still reports that /var is completely full. Why?

The problem is that even though you deleted the logfile, Apache still held a lock on it and thus the space cannot be reclaimed yet by the filesystem. This is not an error on [df]'s part; the space really is still being taken up until the lock is released. To fix it, you merely need to restart apache, (perhaps using Apachectl). Apache then releases the log file, df shows the space returned as free, and MySQL goes back to working.

Personal tools