Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-29-2004, 12:42 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 2

Rep: Reputation: 0
whys is that "df" and "du" dont match?


i recently deleted a 1.6G log file because some stupid kid tried to ping flood my box that made my disk full..

then i searched and deleted the file

then i "dh -h" the disk is still 100% full
but when i "du -hs at /" it shows 1.6G used my hd is 4G big

any help is appreciated
Old 07-29-2004, 01:03 AM   #2
bruce ford
Registered: Jul 2004
Location: Munich, Germany
Distribution: Sun Solaris 8, SuSE 9.0
Posts: 43

Rep: Reputation: 15

if you delete a file that some process still has open (in your case probably the process that writes the log file) your file system won't free the claimed disk space until this process dies (although the file isn't visible to other processes anymore - including 'ls' and 'du').

The different observations of the behaviour of the df and du commands results from the fact that df really displays the free disk space while du sums up all claimed space of all directory enties it can stat (b.t.w. this is why du takes longer to complete).

You have to end the process that is writing the log file. If you want to securely truncate a file and immediately reclaim all the disk space, use the following shell (bash) construct

> your.log.file
After that, the file's size is zero bytes.

so long...
Old 07-29-2004, 01:23 AM   #3
LQ Newbie
Registered: Jul 2004
Posts: 2

Original Poster
Rep: Reputation: 0
hi mr ford,

thank you for your reply and you were correct! although i paniced about the ping floods and i restarted my box. that freed up the disk space once i rebooted. now im focusing on iptables how to prevet those floods.

thanks again!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
"<" ">" Keyboard keys on Toshiba Satellite 1005-s157 dont work RodCas Linux - Laptop and Netbook 1 05-08-2004 04:22 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration