LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-29-2006, 02:20 PM   #1
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slack 10.2 kde 3.4.2 kernel 2.6.15
Posts: 452

Rep: Reputation: 30
6 gig /tmp folder !!!!


My /tmp folder is a tad on the large side.
I'm fighting the rm /tmp/* urge.

Is there no easy way to know what is vital/useful information and what is guff?
As always thnks in advance.
 
Old 11-29-2006, 02:28 PM   #2
nonfatalexec
Member
 
Registered: May 2006
Location: Toronto, Canada
Distribution: Fedora 17
Posts: 36

Rep: Reputation: 15
There's a program called tmpwatch which recursively removes old files from /tmp.

Hope this helps.
 
Old 11-29-2006, 02:32 PM   #3
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slack 10.2 kde 3.4.2 kernel 2.6.15
Posts: 452

Original Poster
Rep: Reputation: 30
I hope so too.
/ is at 99% and I could use the space :0)
Many thanks.
 
Old 11-29-2006, 02:49 PM   #4
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slack 10.2 kde 3.4.2 kernel 2.6.15
Posts: 452

Original Poster
Rep: Reputation: 30
went for stmpclean in the end,it does the same sort of thing.Thnks again.
 
Old 11-29-2006, 03:33 PM   #5
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 111Reputation: 111
Um, you can just mount /tmp using tmpfs. Then tmp will be wiped out when you reboot.

Also, rm -r /tmp/* is supposed to be safe. The files won't really go away until every program with a file handle dies.
 
Old 11-29-2006, 03:36 PM   #6
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Removing everything in /tmp should be fine. I have done that occasionally when it was getting a little crazy in there, and never had a problem. If it was important, it wouldn't get dumped into a temporary directory.
 
Old 11-29-2006, 04:13 PM   #7
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slack 10.2 kde 3.4.2 kernel 2.6.15
Posts: 452

Original Poster
Rep: Reputation: 30
thnks,i have " taken the plunge and did rm -r /tmp/*.
All seems well.

 
Old 11-29-2006, 04:26 PM   #8
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 30
Quote:
Originally Posted by tuxdev
Um, you can just mount /tmp using tmpfs. Then tmp will be wiped out when you reboot...
mmmmh I liked that one, is a neat idea.

How much space should I give to /tmp ?
I know that mounting with tmpfs gives by default half of the RAM to the filesystem but I have 2 gigs of RAM, I don't want to spend 1 gigabyte in /tmp
 
Old 11-29-2006, 05:02 PM   #9
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 111Reputation: 111
The 1G is max usage, not what it is currently using. You only pay for what you actually use, and the cap is there so that tmpfs doesn't bring the system to its knees. If you want, you can pass size=512M or somesuch in. There's an article in the LQ wiki (that I helped write) if you are interested.

I actually use it as an compost bin of sorts. I made a function so that "rm" would copy the data to /tmp and remove the original.
 
Old 11-29-2006, 05:20 PM   #10
slzckboy
Member
 
Registered: May 2005
Location: uk - Reading
Distribution: slack 10.2 kde 3.4.2 kernel 2.6.15
Posts: 452

Original Poster
Rep: Reputation: 30
/du -m /tmp gave an output showing 7001 Meg used.

df -m showed /dev/hdb1 mounted on / at 100%

startx was failing because i guess x had no where to place the necessary files at startup!?!??

after I dumped the contents of /tmp, / is now at 59 % and now X will start.

If one gig is the max limit how come I had 7 gig in my tmp folder?
Sorry but confused.
??????
 
Old 11-29-2006, 06:01 PM   #11
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 30
Quote:
Originally Posted by tuxdev
The 1G is max usage, not what it is currently using. You only pay for what you actually use, and the cap is there so that tmpfs doesn't bring the system to its knees. If you want, you can pass size=512M or somesuch in. There's an article in the LQ wiki (that I helped write) if you are interested....
That's good to know, thanks tuxdev, I'm going to review this intel once I get back at home and start tweaking this stuff ^_^


Quote:
Originally Posted by slzckboy
...If one gig is the max limit how come I had 7 gig in my tmp folder?
Sorry but confused.
??????
That was because you had your /tmp folder resident in your / partition, physically in your hard disk, without a space limit. tuxdev was talking about using tmpfs for the /tmp folder, which is a neat kernel trick that gives you a temporal/virtual filesystem resident in the computer's RAM.

Last edited by raska; 11-29-2006 at 06:03 PM.
 
Old 11-29-2006, 08:00 PM   #12
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 111Reputation: 111
You're Welcome . raska, here is the function for .bashrc I wrote to do a simple compost heap:
Code:
function rm {
   /usr/bin/cp -f "$@" /tmp 2> /dev/null
   /usr/bin/rm "$@"
}
Real simple, ne? I know it can overfill /tmp, but that's something I just deal with on a case-by-case basis.

On an unrelated note, I have no clue why that is K&R, I code using BSD most of the time.
 
  


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
TMP folder, is everything deletable in there? ginda Linux - Newbie 6 12-16-2006 01:43 PM
/tmp folder bytez Linux - Security 9 10-24-2006 01:10 AM
How to split a 9 Gig folder in 2x4.5 Gig folders jayhel Slackware 5 08-18-2005 11:36 PM
What is all this junk in the /tmp folder? HoosTrax Linux - Newbie 2 02-10-2004 04:03 PM
tmp folder question synaptical Linux - General 8 08-31-2003 03:10 PM


All times are GMT -5. The time now is 07: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