LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-25-2013, 05:16 AM   #1
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 557

Rep: Reputation: 46
Disk Space Used is Less Than Size Still Available Disk Space is Zero


How comes it that Used is < Size still Avail is showing 0 in the output below:

Code:
# df -hT /export
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/drbd0    ext3     29G   27G     0 100% /export


# cat /etc/issue
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel \r on an \m
 
Old 09-25-2013, 05:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
This is usually open but deleted files. whilst you can delete a filename entry, until nothing is referencing that part of the disk, that disk space is still unavailable.
 
Old 09-25-2013, 08:02 AM   #3
genese
Member
 
Registered: Feb 2006
Location: belgium
Distribution: FC5
Posts: 39

Rep: Reputation: 16
I remember filesystems reserving some space for root exclusive access after they are declared full for non-root users.

I don't know if ext3 have this feature.
 
Old 09-27-2013, 02:34 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Also worth checking inodes usage
Code:
df -hi
 
Old 09-27-2013, 10:23 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,552

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
The discrepancy between 29G and 27G is the 5% that by default is reserved for root. You can use tune2fs to reduce that percentage, but fragmentation can become a problem if the free space gets much below 5%. The filesystem needs some free space in each cylinder group or else files might end up scattered widely around.
 
1 members found this post helpful.
Old 09-28-2013, 09:45 AM   #6
smbhandary
LQ Newbie
 
Registered: Jan 2013
Distribution: RHEL and AIX ( sort of )
Posts: 18

Rep: Reputation: Disabled
This happens when live files are deleted.

lsof /export | grep -i deleted - will give you the processes that are still "writing" to files that were deleted.

If the processes are bounceable processes e.g application processes try bouncing ( restarting ) the process.

else

kill -9 <pid> - to kill the processes that are "writing" to the deleted files.

Works for me everytime.

If you dont mind getting into meetings, reboot the system. Its a thoughtfree / sweatfree fix.
 
Old 09-28-2013, 02:23 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,552

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by smbhandary View Post
This happens when live files are deleted.
No, it doesn't. This is different from the frequently reported discrepancy between what df and du report for a filesystem. While du won't see deleted, but in use, files, for df a used block is a used block, and it makes no difference whether the file using that block does or does not have links in the directory tree.
 
Old 10-01-2013, 01:46 AM   #8
smbhandary
LQ Newbie
 
Registered: Jan 2013
Distribution: RHEL and AIX ( sort of )
Posts: 18

Rep: Reputation: Disabled
My response is based on my working experience.
My 'usefulness' to my employer is decided on what I can fix or get fixed.
The intention of my being a member here is that I hope my experience will help someone fix her/his problem.
No offense intended in any of the above statements, please.

The problem as I understand it :

# df -hT /export
Filesystem Type Size Used Avail Use% Mounted on
/dev/drbd0 ext3 29G 27G 0 100% /export

And du / du -<summary switch> does not show cause for it


Ive doing platform support for 11 years now.

Application support teams deleting live ( in use / being written to ) application logs is a common occurrence. Ive never spent time wondering why they do it.

The ticket comes to us saying the df says the filesystem is full and du -<summary switch> does not show cause for it.

I have fixed every single such ticket using the commands provided in my last post.

Another cause of df and du not saying the same thing could be the filesystem running out of inodes. I have never faced that condition till date.


I will accept that there is something I have not considered / am not aware of, if devUNIX states that my suggestion did not fix the problem at hand.

Last edited by smbhandary; 10-01-2013 at 01:50 AM.
 
Old 10-01-2013, 03:22 AM   #9
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 556

Rep: Reputation: Disabled
Its is not what we have done, the cause could be anything you told or told somewhere above, mostly the cause is deleted files that are still open to write somewhere, so @devunix confirm the inode usage and crosscheck with what @smbhandary has provided, you will have the solution and cause both.

cheers
 
Old 10-01-2013, 08:00 AM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,552

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by smbhandary View Post
The problem as I understand it :

# df -hT /export
Filesystem Type Size Used Avail Use% Mounted on
/dev/drbd0 ext3 29G 27G 0 100% /export

And du / du -<summary switch> does not show cause for it
If you would care to point out where the OP mentioned anything about du, I would like to see it.

This is a simple matter of the 5% default reserved space in the filesystem and df therefore reporting "100%" usage while the number of used blocks is less than the total.
 
Old 10-04-2013, 09:56 AM   #11
smbhandary
LQ Newbie
 
Registered: Jan 2013
Distribution: RHEL and AIX ( sort of )
Posts: 18

Rep: Reputation: Disabled
rknichols . Point taken....
Now I know what Voltaire meant when he said " The tragedy of speaking nonsense is when it is spoken pompously"
 
  


Reply


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
Disk Space shows more used disk thank size of files present in folder vinvar Linux - Virtualization and Cloud 2 11-03-2009 12:59 AM
Cedega "Disk space required for the installation exceeds available disk space" Solved Spewdemon LinuxQuestions.org Member Success Stories 1 10-18-2007 07:19 PM
Wrong Size of free disk space ALInux Linux - General 1 04-03-2006 05:22 AM
none partitionned size space disk sali Linux - General 6 10-23-2005 09:43 AM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration