nixCraft Linux Forum

nixCraft

Linux / UNIX 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

Linux answers from nixCraft.


Linux hardware Discussion about Linux hardware related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 28-01-2007, 02:50 PM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
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
  #2 (permalink)  
Old 28-01-2007, 02:57 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
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 28-01-2007, 03:16 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
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 Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #4 (permalink)  
Old 12-05-2007, 02:10 AM
Junior Member
User
 
Join Date: May 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
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 14-05-2007, 05:51 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
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.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
Reply


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 Off


Similar Threads

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


All times are GMT +5.5. The time now is 01:00 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

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 37 38