LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-18-2010, 02:50 PM   #1
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Rep: Reputation: 0
Exclamation Out of inodes and can't access /tmp!


Ok, I'm hoping somebody can help me out with this. Its kind of a strange issue:

My server started acting flaky this weekend and my Webmin interface was throwing strange errors. I finally tracked it down to the fact that I was out of inodes on my primary partition. I'm fairly certain that the /tmp folder has an outrageous number of files in it. I can't do an ls on the directory because the console just sits there forever after I issue the command. I also tried to do an rm -rf on the /tmp directory and it did the same thing. Any suggestions on how I can clear out this directory?
 
Old 01-18-2010, 02:58 PM   #2
AleLinuxBSD
Member
 
Registered: May 2006
Location: Italy
Distribution: Ubuntu, ArchLinux, Debian, SL, OpenBSD
Posts: 274

Rep: Reputation: 42
Probably you haven't sufficient space on your OS:
Maintaining free space in filesystems

You could access on your Pc using a livecd and remove the file unnecessary ...
 
Old 01-18-2010, 05:08 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Please add your distro & version to your info so we can advise more accurately.
 
Old 01-18-2010, 05:21 PM   #4
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chrism01 View Post
Please add your distro & version to your info so we can advise more accurately.
I'm running CentOS 5.4 and I have Webmin installed.
 
Old 01-18-2010, 05:34 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
In that case, I'd use the install DVD. Boot from that and at the initial prompt (where it asks what you want to do) type in:

linux rescue


It'll then boot from the DVD, and mount (read-only ?) your HDD(s). You can then

mount -o remount,rw /tmp

or whatever partition it's on and delete files etc.
 
Old 01-18-2010, 07:53 PM   #6
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Also, if your using ext3 then the file system has problems over 32,000 files.

Therefore you might have to delete in small sections

e.g rm /tmp/a*
rm /tmp/b*

etc


df -i shows u your inode usage, the only way to increase inodes is to re-create a file system

mkfs -N is what you need or also look at -T option.
 
Old 01-19-2010, 07:29 AM   #7
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by FragInHell View Post
Also, if your using ext3 then the file system has problems over 32,000 files.

Therefore you might have to delete in small sections

e.g rm /tmp/a*
rm /tmp/b*

etc


df -i shows u your inode usage, the only way to increase inodes is to re-create a file system

mkfs -N is what you need or also look at -T option.
I booted from the install disc with the rescue option but I'm still having trouble. I tried deleting with rm -r [a-m]* while in the tmp directory that it mounted from my filesystem but after accessing the hard drive for about a half hour it didn't find any files to delete. I can't do an rm -r * on the directory because it gives me an error about having too many arguments (which I believe means there are too many files for it to delete). How else can I break up this delete process so there aren't too many files at a time? Keep in mind that I can't do an ls so I don't know the names or dates on the files.
 
Old 01-19-2010, 04:31 PM   #8
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Hi.

Ok so the problem is file system limits booting to a rescue disk is not going to help you here.

Even rm -r [a-m]* might be too large a number, try rm -r a* (you could of course script this to do each letter)
 
Old 01-19-2010, 04:41 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Yes, one letter at a time should do the trick. You may also have filenames starting with a number, so use the same trick there.
 
Old 01-20-2010, 07:10 AM   #10
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by FragInHell View Post
Hi.

Ok so the problem is file system limits booting to a rescue disk is not going to help you here.

Even rm -r [a-m]* might be too large a number, try rm -r a* (you could of course script this to do each letter)
Usually when the request matches too many files it gives me the "too many arguments" error but when I tried rm -r [a-m]* it gave me a "no such file or directory error" leading me to believe that there aren't any files in that directory that start with a through m. I'm going to take chrism01's advice and see if it matches any numbers.
 
Old 01-20-2010, 07:54 AM   #11
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
Your expansion syntax is wrong; the first and last letters are separated by two dots, not a hyphen. You might try curly brackets instead, eg rm -r {a..m}*
 
Old 01-20-2010, 08:01 AM   #12
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by cantab View Post
Your expansion syntax is wrong; the first and last letters are separated by two dots, not a hyphen. You might try curly brackets instead, eg rm -r {a..m}*
That was worth a try; this is what I got though:

Code:
rm: cannot remove `/tmp/a*': No such file or directory
rm: cannot remove `/tmp/b*': No such file or directory
rm: cannot remove `/tmp/c*': No such file or directory
rm: cannot remove `/tmp/d*': No such file or directory
rm: cannot remove `/tmp/e*': No such file or directory
rm: cannot remove `/tmp/f*': No such file or directory
rm: cannot remove `/tmp/g*': No such file or directory
rm: cannot remove `/tmp/h*': No such file or directory
rm: cannot remove `/tmp/i*': No such file or directory
rm: cannot remove `/tmp/j*': No such file or directory
rm: cannot remove `/tmp/k*': No such file or directory
rm: cannot remove `/tmp/l*': No such file or directory
rm: cannot remove `/tmp/m*': No such file or directory
I proceeded through all numbers and letters and got the same results! How is this possible? I know there's something in the directory because it's using 78M.

Last edited by fizix610; 01-20-2010 at 08:13 AM.
 
Old 01-20-2010, 05:41 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Did you check UPPERCASE as well; *nix is case sensitive.
Also, it could be that the partition that /tmp is on is full; might not be that dir specifically.
 
Old 01-22-2010, 09:01 AM   #14
fizix610
LQ Newbie
 
Registered: Jun 2004
Posts: 6

Original Poster
Rep: Reputation: 0
OK, I let an ls run all night and all day while I was at work and finally got a directory listing. It turns out that I had thousands of CURLCOOKIE files in /tmp and those used up all my inodes. These must have been generated by my webcrawler script that was using CURL and would generate a cookie file for each site it connected to. I've been systematically deleting them using "rm CURLCOOKIE{a..e}*". Looks good so far. Thanks for your help!
 
Old 01-24-2010, 06:49 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You should also amend the curl script to clean up after itself ..
 
  


Reply

Tags
inode



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
Can't login, says tmp directory full but tmp file is empty! Could be linked to MySQL? bethanlowder Fedora 7 09-25-2009 07:17 AM
how to securing /tmp , /var/tmp and /dev/shm hackintosh Linux - Security 7 10-17-2007 11:26 PM
The Gimp /tmp access powadha Linux - Software 1 12-05-2004 08:56 AM
Numerous scb_*.tmp files in /tmp dburk Programming 3 08-18-2003 04:28 PM
Newbie question - /tmp /var/tmp Mr happy Linux - Security 3 01-27-2003 01:03 PM

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

All times are GMT -5. The time now is 07:12 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
Open Source Consulting | Domain Registration