nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Why is there a mismatch between df and du outputs?

This is a discussion on Why is there a mismatch between df and du outputs? within the Linux hardware forums, part of the Linux Getting Started category; Ok, don't Laugh at me why is there a mismatch between df and du outputs? Code: df /home du /home ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux hardware

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-28-2007, 02:50 PM
raj raj is offline
Contributors
User
 
Join Date: Jun 2005
Location: Hyderabad
Posts: 146
Rep Power: 4
raj is on a distinguished road
Default Why is there a mismatch between df and du outputs?

Ok, don't Laugh at me why is there a mismatch between df and du outputs?
Code:
df /home
du /home
TIA
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-28-2007, 02:57 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 481
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Linux/UNIX inode plays very important roll. A system can not deallocate an inode until Linux or UNIX has closed the file.

Another possibility is unlikned inode which is not allowing to reclaimed free space. Thus it result into different du and df output.
Reply With Quote
  #3 (permalink)  
Old 01-28-2007, 03:16 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 919
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

See Why command df and du reports different output?
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #4 (permalink)  
Old 05-12-2007, 02:10 AM
Junior Member
User
 
Join Date: May 2007
Posts: 8
Rep Power: 0
NVRAM is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
The open-file-descriptor gotcha is one I've seen lots of users trip over with daemons that would grow their log files without bound. This page expains it pretty well, but...

It is a bit misleading since on most systems "vi" does not keep the file opened, if you see the expected differences then I'd be surprised. A better example would be to run:

sleep 120 < /home/user/demo.txt &

instead of vi on another terminal/console. Then remove, check usages, kill the job, then check again.

Cheers.

PS: On many/most Linux systems with a "/proc" filesystem, you can find open, deleted files with:
ls -l /proc/[0-9]*/fd | grep ' (deleted)$'

PPS: Presuming you have permissions, you can often access the file by that symbolic link; use 'wc' to determine the size or even copy the contents back to a disk file.
Reply With Quote
  #5 (permalink)  
Old 05-14-2007, 05:51 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 564
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Quote:
Originally Posted by NVRAM View Post
T
PS: On many/most Linux systems with a "/proc" filesystem, you can find open, deleted files with:
ls -l /proc/[0-9]*/fd | grep ' (deleted)$'

PPS: Presuming you have permissions, you can often access the file by that symbolic link; use 'wc' to determine the size or even copy the contents back to a disk file.
Good explanation, especially wc and deleted files related commands.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
mtrr: type mismatch piggy Linux hardware 1 08-02-2007 10:32 PM


All times are GMT +5.5. The time now is 11:24 PM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36