LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 04-23-2007, 07:21 PM   #1
qwertyman19
LQ Newbie
 
Registered: Oct 2004
Location: LA
Distribution: Red Hat 9
Posts: 6

Rep: Reputation: 0
Free Disk Space Not Available


My RedHat 9 system is having trouble accessing free disk space.

XFree86 can not load, I can't initiate a Webmin session (the Webmin server starts just fine), and Windows clients report no free space on the Samba shares. I assume that XFree86 and Webmin is having trouble creating temporary files.

df reports no Available blocks, but, I can copy files and create new files with the vi editor.

e2fsck reports a clean file system. The RAID 1 array is fine. Rebooting doesn't help. This is the df output:

Code:
# df --sync
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/md0         5937952   5686532         0 100% /
none              127632         0    127632   0% /dev/shm

# rm Test.gz
rm: remove regular file `Test.gz'? y

# df --sync
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/md0         5937952   5687292         0 100% /
none              127632         0    127632   0% /dev/shm
Note that the number of Available blocks is always 0, while the number of Used blocks decreases after I delete the file.

Any ideas?
Thanks!
 
Old 04-23-2007, 07:36 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
If you remove a file while it is still "open" the file name goes away but its space is still there because the inode didn't really go away.

Some people delete large logfiles but neglect to shutdown the process that is writing to it. When this occurs it appears to have worked but it didn't actually free the inode or the space.

You can run lsof and look in the size column to see if you see any large numbers that don't have corresponding file names. If so you should stop the process reported by lsof to clear the inode.

Alternatively you can just reboot to clear the condition.

The 0 blocks available deals with the concept of minfree. To protect itself a filesystem will sometimes reserve some space so it tells you it is "full" when it is actually only "mostly full". The used blocks will tell you how much is really used but the remaining blocks shows you 0 at the point it hits this "mostly full" state where it has "minfree" blocks left.
 
Old 04-24-2007, 11:18 AM   #3
qwertyman19
LQ Newbie
 
Registered: Oct 2004
Location: LA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlightner
You can run lsof and look in the size column to see if you see any large numbers that don't have corresponding file names. If so you should stop the process reported by lsof to clear the inode.

Alternatively you can just reboot to clear the condition.
Thanks for the reply. I've rebooted many times and it hasn't helped.

I've looked at the output at lsof and all of the entries with a size has a corresponding file name.
 
Old 04-24-2007, 11:26 AM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
In that case I'd say your filesystem IS full and you need to do some cleaning.

Some things to look at:

find / -name core

Do "file <filename>" to be sure it is a "core file". These are left when a program dies so you can debug why it died. They are dumps of the memory the program was using so can often be quite large. Deleting them can free up space.

Also look at log files (starting with /var/log) to see if you have any huge ones. If so stopping whatever writes to that log (e.g. syslogd for /var/log/messages) then removing the log could free up some space. (You won't be able to compress it if you don't have enough space because it keeps the original while it writing the compressed file.)
 
Old 04-24-2007, 01:45 PM   #5
qwertyman19
LQ Newbie
 
Registered: Oct 2004
Location: LA
Distribution: Red Hat 9
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for all of your help, jlightner! You've taught me a lot.
The minfree concept was most informative. It looks like my filesystem tries to reserve about 5% of the total space. I uninstalled Webmin and then tried to reinstall it. rpm reported that it needed 45MB more space to complete the installation! So in other words, my filesystem was 45MB short of it's minfree space.

I'm in the process of archiving some big, old files that I haven't used in a long time.

Thanks again!
 
Old 04-24-2007, 04:40 PM   #6
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
Minfree is the name I learned for it in HP-UX. After some digging I found the Linux information in the info page for mke2fs:

Quote:
-m reserved-blocks-percentage
Specify the percentage of the filesystem blocks reserved for the
super-user. This avoids fragmentation, and allows root-owned
daemons, such as syslogd(8), to continue to function correctly
after non-privileged processes are prevented from writing to the
filesystem. The default percentage is 5%.
And it shows you are correct in your 5% assessment as that is the default it uses.

You could actually adjust it with tune2fs using the same "-m" option but if you really have gotten that close to filling it you're better off doing the cleaning. If / actually filled completely your host would stop responding. This is one reason why I like to have multiple filesystems and only keep key system files in /.
 
  


Reply

Tags
df, freespace


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How t get it known free disk space? ukrainet Linux - General 3 05-06-2008 11:52 PM
Disk Free Space Ian D Linux - Newbie 1 02-09-2006 08:11 AM
How much disk space do I have free? Ian D Linux - General 5 10-27-2005 07:22 PM
Free up disk space TheShemeta Slackware 5 11-26-2003 05:50 PM
How to see free disk space bripage Linux - General 3 04-29-2002 09:38 PM


All times are GMT -5. The time now is 10:29 AM.

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