LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Free Disk Space Not Available (https://www.linuxquestions.org/questions/linux-general-1/free-disk-space-not-available-548415/)

qwertyman19 04-23-2007 06:21 PM

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!

MensaWater 04-23-2007 06:36 PM

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.

qwertyman19 04-24-2007 10:18 AM

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.

MensaWater 04-24-2007 10:26 AM

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.)

qwertyman19 04-24-2007 12:45 PM

Thanks for all of your help, jlightner! You've taught me a lot. :study:
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! :)

MensaWater 04-24-2007 03:40 PM

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 /.


All times are GMT -5. The time now is 06:34 PM.