LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


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

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


hi

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
Member
 
Registered: Jul 2004
Location: Munich, Germany
Distribution: Sun Solaris 8, SuSE 9.0
Posts: 43

Rep: Reputation: 15
Hi,

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

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

so long...
bruce
 
Old 07-29-2004, 01:23 AM   #3
jaredth
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!
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:05 PM.

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