UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Linux Dedicated Servers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-12-2006, 05:54
Senior System Administrator
 
Join Date: Oct 2006
Posts: 146
Thumbs up df show bigger disk usage than du on Server

Issue:

Why does df show bigger disk usage than du?

Resolution:

There are some instances where df would output a bigger disk usage than du. The most common instance is when a process has opened a huge file and that same file is deleted with rm. Technically, the file still exists because a process still has an open file descriptor associated with that file. An example is presented below.

First, a 200Mb file called bigfile is created and is opened using the vi editor:

Quote:
[root@localhost ~]# ls -lh bigfile
-rw-r--r-- 1 root root 200M Dec 22 14:53 bigfile
[root@localhost ~]# lsof|grep bigfile
vi 23824 root 3r REG 3,2 209715200 2052534 /root/bigfile
vi 23824 root 4u REG 3,2 4096 2052542 /root/.bigfile.swp
At this point, both df and du would have the same output:

Quote:
[root@localhost ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 19G 8.8G 8.4G 51% /
[root@localhost ~]# du -sh /
8.8G /
Now the discrepancy in output shows once bigfile is deleted:

Quote:
[root@localhost ~]# rm -f bigfile
[root@localhost ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 19G 8.8G 8.4G 51% /
[root@localhost ~]# du -sh /
8.6G /
Killing the vi process that has opened bigfile resolves the discrepancy:

Quote:
[root@localhost ~]# kill 23824
[root@localhost ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 19G 8.6G 8.6G 50% /
[root@localhost ~]# du -sh
8.6G /
------------------------
Best Regards,
eUKShane :P
http://www.eukhost.com
Reply With Quote
Reply



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

Advanced Search
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


All times are GMT. The time now is 15:34.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles