David Cho-Lerat wrote:
> >Google returns:
> >http://superuser.com/questions/289678/du-vs-df-output

I will also mention the GNU faq entry for it.  Perhaps then it will
rank higher in the search engine space.  :-)

  
http://www.gnu.org/software/coreutils/faq/#df-and-du-report-different-information

> smbd       2926       root    2w      REG      254,1       2665
> 65406 /var/log/samba/log.smbd.1 (deleted)
> smbd       2926       root    6w      REG      254,1       2665
> 65406 /var/log/samba/log.smbd.1 (deleted)
> proftpd   14060     nobody    7w      REG      254,1 2807896675
> 49066 /var/log/proftpd/proftpd-trace.log (deleted)
> ...
> Yes ! Looks like they just need to restart the ProFTPD and Samba
> services to free up around 2.7G !

When I want to free up disk space used in a log file instead of
removing the file, which creates the above situation of large files
that no longer have a directory entry, instead of removing the file I
truncate it.

  $ : > somelargefile

By truncating the file it is immediately reduced and the disk blocks
freed.  The file isn't removed and therefore won't be lost from the
filesystem where du can't find it anymore.  Any daemon that is still
writing to the file will still keep its file handle to it and will
continue to write to the file.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to