LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2010, 04:45 AM   #1
siva balan
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Rep: Reputation: 0
no space in root directory


i am using fedora 12. i got "no space in root directory" warning from the system..when i went through it, i found many of the space has been occupied by /var/log/httpd/error-log file. so i just deleted the file..
but when i check the space with "df -h" command.it shows 0% availability..the same problem occured before...but it solved when i restarted the system..but how to regain the space wihtout restarting the system?

please guide me..
Thanks in advance..
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-25-2010, 04:54 AM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
Look for some debug files in /tmp
Used to see some 2G ones.
 
Old 11-25-2010, 05:00 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
but it solved when i restarted the system..but how to regain the space wihtout restarting the system?
restart the httpd deamon

Kind regards
 
Old 11-25-2010, 05:00 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The log file is in use, most likely by the syslog service (you can easily verify it using the lsof command). This means that the application creates a hard link and uses it to populate the log file: if you remove the file, the hard link is still there and keeps the disk space usage. You can restart the syslogd service using either
Code:
/etc/init.d/syslogd restart
or
Code:
kill -1 `cat /var/run/syslogd.pid`
In this way the service frees the log file, the hard link is destroyed and the space is available again.

Anyway I would investigate why the error-log file is used so heavily. Maybe you can limit the logging of the httpd service acting on the related iptables rules. Just an idea.
 
Old 11-25-2010, 07:03 AM   #5
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,597

Rep: Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690Reputation: 2690
zero log file

If I may add to the above: removing a log file while software is running is nearly ALWAYS a bad idea.
Better to 'zero' the log file by usine a command line such as " > logfile ".
while less prone to causing problems, this also is not the BEST solution. Best is to drop services, clean up logs and temp files, then restart services. Best is not always an option if a service outage would impact a production process, so I have used this 'second best' solution of returned a log to 'zero' using redirection often.
 
Old 11-25-2010, 07:51 AM   #6
meandsushil
Member
 
Registered: Feb 2010
Posts: 143

Rep: Reputation: 14
If your "/" directory is made on LVM . then simply extend with lvextend command!
 
0 members found this post helpful.
Old 11-25-2010, 10:26 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Are your logs rotated?
Then you can run a script to delete the rotated logs.
You can set logrotate to rotate, when a certain size is reached

Kind regards
 
1 members found this post helpful.
Old 11-25-2010, 09:16 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,622

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by meandsushil View Post
If your "/" directory is made on LVM . then simply extend with lvextend command!
The /var partition may be separate from the / partition, and there is no "simply" with lvextend. Running lvextend on a partition also means you have to run resize2fs, which you can't do on a mounted volume. If you do it, you'll wind up with a non-readable disk after you reboot. You have to be booted from a rescue CD/DVD, into single-user before doing those things.

If you're going to try to answer a question, please provide the OP with complete details, so they don't wind up with a broken system.
 
2 members found this post helpful.
  


Reply



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
how to remove a directory name with space ? jimmyjiang Red Hat 3 03-17-2008 10:46 AM
restoring desktop directory in /root (or any home directory) mel_lai Linux - Newbie 3 02-04-2008 03:13 AM
No space available in my '/' directory rvsridhar Linux - General 2 05-16-2006 06:45 AM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 12:44 PM
directory with a space singedwings Linux - Newbie 4 08-24-2004 05:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration