LinuxQuestions.org
Help answer threads with 0 replies.
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 12-14-2010, 02:21 AM   #1
Isix
Member
 
Registered: Mar 2007
Location: Windhoek, Namibia
Distribution: Slackware, Kubuntu, Mandriva & PCLinuxOS
Posts: 80

Rep: Reputation: 18
can /tmp/SBo content safely be deleted


Hi all,

After installing numerous stuff on my Slackware system, I notice I am running out of hard-drive space. I see that /tmp/SBo has about 1G of staff that I recently installed --- may I safely delete this staff?

Cheers,
IDD

Last edited by Isix; 12-27-2010 at 12:40 PM.
 
Old 12-14-2010, 02:44 AM   #2
rfernandez
Member
 
Registered: Mar 2010
Location: Brazil
Distribution: Slackware64
Posts: 264

Rep: Reputation: 41
Sure you can. Maybe you'd like to save the .tgz packages for the future, but the /tmp/SBo folder you can remove - it's where the sources are unpacked and programs compiled and installed with DESTDIR. Take a look at some SlackBuild script and you'll see what are those.
 
Old 12-14-2010, 02:44 AM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,120

Rep: Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549
Yes you may! You can delete everything in /tmp if you really want to. Whatever the operating system actually requires the kernel will make again.
 
Old 12-14-2010, 02:55 AM   #4
Isix
Member
 
Registered: Mar 2007
Location: Windhoek, Namibia
Distribution: Slackware, Kubuntu, Mandriva & PCLinuxOS
Posts: 80

Original Poster
Rep: Reputation: 18
Thanks for the guide --- now I have got that 1G space back.
 
Old 12-14-2010, 03:17 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Opinions vary about the best way to clean /tmp and none of them are guaranteed to cause no breakage. I remove everything in /tmp as soon as the file system containing it is mounted; this by modifying the boot script which mounts it; works for me; YMMV.
 
Old 12-14-2010, 03:48 AM   #6
Isix
Member
 
Registered: Mar 2007
Location: Windhoek, Namibia
Distribution: Slackware, Kubuntu, Mandriva & PCLinuxOS
Posts: 80

Original Poster
Rep: Reputation: 18
Hi catkin,

you say, "by modifying the boot script which mounts" /tmp. Which is the boot script you are referring to (is it /boot/config ?), and how did you modify it?
 
Old 12-14-2010, 04:37 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by AwesomeMachine View Post
Yes you may! You can delete everything in /tmp if you really want to. Whatever the operating system actually requires the kernel will make again.
Ummm ... no, you can't, you shouldn't. Many apps, including X11,
have temporary files in /tmp for users CURRENT sessions. Deleting
those can make "bad things" happen. It's safe to delete OLD stuff
from /tmp, things that aren't currently being accessed.



Cheers,
Tink
 
Old 12-14-2010, 04:37 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
On Slackware it's /etc/rc.d/rc.S. When /tmp is on the / file system, the relevant part is just after comment "# Remount the root file system in read-write mode" which is mostly an if-fi to deal with it failing. I use this line after the closing fi: ( cd /tmp && rm -rf -- * .* 2>/dev/null )
 
Old 12-14-2010, 04:42 AM   #9
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
I delete everything in /tmp when the system shuts down by adding the following to /etc/rc.d/rc.local_shutdown:
Code:
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -print0 | xargs -0r /bin/rm -rf
 
Old 12-14-2010, 04:42 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by Tinkster View Post
It's safe to delete OLD stuff
from /tmp, things that aren't currently being accessed.
+1 to all of Tinkster's post. Regards the quote above, the potential gotcha is that even old files and directories may be in use. This is a topic that has been much debated and, as I posted earlier, there are no guaranteed safe solutions. Prior discussions on LQ listed here.
 
Old 12-14-2010, 04:52 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by sycamorex View Post
I delete everything in /tmp when the system shuts down by adding the following to /etc/rc.d/rc.local_shutdown:
Code:
/usr/bin/find /tmp -mindepth 1 -maxdepth 1 -print0 | xargs -0r /bin/rm -rf
I decided against that solution in favour of doing it during boot because rc.[06] runs rc.local_shutdown early so before shutting down many other things which _might_ depend on files+directories in /tmp including MySQL, Apache, Samba, NFS server, ssh (which does use /tmp), SASL, LDAP, D-bus, networked file systems, networking, process accounting, ACPI, quotas (which does use /tmp?) ...
 
1 members found this post helpful.
Old 12-14-2010, 04:56 AM   #12
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,825
Blog Entries: 1

Rep: Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221Reputation: 1221
Quote:
Originally Posted by catkin View Post
I decided against that solution in favour of doing it during boot because rc.[06] runs rc.local_shutdown early so before shutting down many other things which _might_ depend on files+directories in /tmp including MySQL, Apache, Samba, NFS server, ssh (which does use /tmp), SASL, LDAP, D-bus, networked file systems, networking, process accounting, ACPI, quotas (which does use /tmp?) ...
Thanks. Never thought of that.
 
Old 12-14-2010, 05:42 AM   #13
Isix
Member
 
Registered: Mar 2007
Location: Windhoek, Namibia
Distribution: Slackware, Kubuntu, Mandriva & PCLinuxOS
Posts: 80

Original Poster
Rep: Reputation: 18
After adding
Code:
cd /tmp && rm -rf -- * .* 2>/dev/null
in /etc/rc.d/rc.S after the line
Code:
# Remount the root file system in read-write mode
and then rebooting, I now have 4G of space. Wow, I needed space like cracy --- thanks!
 
Old 12-14-2010, 05:57 AM   #14
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by catkin View Post
( cd /tmp && rm -rf -- * .* 2>/dev/null )[/B]
I shy away from the .* wildcard because I've always though it'd expand to '..'. I tend to use .??* which forces the wildcard to expand to at least three characters (thereby omitting '..'). It still catches most dot-files: only those whose file name is fewer than three characters long don't get deleted. I have yet to come across such a file.
 
Old 12-14-2010, 06:32 AM   #15
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by Isix View Post
After adding
Code:
cd /tmp && rm -rf -- * .* 2>/dev/null
in /etc/rc.d/rc.S after the line
Code:
# Remount the root file system in read-write mode
and then rebooting, I now have 4G of space. Wow, I needed space like cracy --- thanks!
Safer to use
Code:
( cd /tmp && rm -rf -- * .* 2>/dev/null )
in case rc.S needs to have a specific current working directory (AFAIK it doesn't but best to play safe).

And it should go after the fi after
Code:
# Remount the root file system in read-write mode
not directly after it (because the / file system has been mounted read-write then -- surprising that it worked for you!).
 
  


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
ffmpeg.SlackBuild: line 194: cd: /tmp/SBo/package-ffmpeg/usr/man: No such file or dir darkstarbyte Linux - Software 7 12-29-2010 06:45 PM
I carelessly deleted /tmp deco81 Linux - Newbie 2 07-01-2010 10:26 AM
Things one can safely delete from /tmp folder glore2002 Slackware 24 09-17-2009 06:09 PM
deleted contents of /tmp dave`2005 Slackware 2 06-22-2007 11:45 PM
what files can be safely deleted to save disk space? rohan208 Linux - General 9 05-27-2004 09:06 PM

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

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