Re: Clean up / filesystem

2010-10-11 Thread four . harrisons
On Sun, Oct 10, 2010 at 8:40 AM, Mike Clarke
jmc-freeb...@milibyte.co.uk wrote:
 On Saturday 09 October 2010, Arthur Chance wrote:

 Not if running an X desktop, as all sorts of things get stuck in /tmp
 that are needed. In single user mode it should be safe, and it
 probably is when simply running on the console.

 As a long term solution, if you wish to clear /tmp every reboot add
  clear_tmp_enable=YES  #  Clear /tmp at startup.
 to your /etc/rc.conf


You may also want to consider changing /tmp to be a TMPFS file system

add the line
tmpfs   /tmptmpfs   rw,mode=01777   0   0

to /etc/fstab (and remove any other /tmp lines).

A warning will come saying that it is highly experimental - but I've
been running with it for a while now without any issues.

-- 
Eitan Adler
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread Mike Clarke
On Saturday 09 October 2010, Arthur Chance wrote:

 Not if running an X desktop, as all sorts of things get stuck in /tmp
 that are needed. In single user mode it should be safe, and it
 probably is when simply running on the console.

 As a long term solution, if you wish to clear /tmp every reboot add
 clear_tmp_enable=YES  # Clear /tmp at startup.
 to your /etc/rc.conf

Also consider using periodic(8) to do a safe daily cleanup deleting 
files in /tmp not accessed in the last 3 days. You need to add 
daily_clean_tmps_enable=YES to /etc/periodic.conf. If you prefer a 
different retention period you can set it by adding a line setting 
daily_clean_tmps_days to the desired value. You can also modify the 
default list of files to ignore with the variable 
daily_clean_tmps_ignore

-- 
Mike Clarke
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread Eitan Adler
On Sun, Oct 10, 2010 at 8:40 AM, Mike Clarke
jmc-freeb...@milibyte.co.uk wrote:
 On Saturday 09 October 2010, Arthur Chance wrote:

 Not if running an X desktop, as all sorts of things get stuck in /tmp
 that are needed. In single user mode it should be safe, and it
 probably is when simply running on the console.

 As a long term solution, if you wish to clear /tmp every reboot add
 clear_tmp_enable=YES  # Clear /tmp at startup.
 to your /etc/rc.conf


You may also want to consider changing /tmp to be a TMPFS file system

add the line
tmpfs   /tmptmpfs   rw,mode=01777   0   0

to /etc/fstab (and remove any other /tmp lines).

A warning will come saying that it is highly experimental - but I've
been running with it for a while now without any issues.

-- 
Eitan Adler
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread bdsfbsd
On Sun, 10 Oct 2010 07:34:40 -0400, Eitan Adler li...@eitanadler.com  
wrote:



On Sun, Oct 10, 2010 at 8:40 AM, Mike Clarke
jmc-freeb...@milibyte.co.uk wrote:

On Saturday 09 October 2010, Arthur Chance wrote:


Not if running an X desktop, as all sorts of things get stuck in /tmp
that are needed. In single user mode it should be safe, and it
probably is when simply running on the console.

As a long term solution, if you wish to clear /tmp every reboot add
clear_tmp_enable=YES  # Clear /tmp at startup.
to your /etc/rc.conf




You may also want to consider changing /tmp to be a TMPFS file system

add the line
tmpfs   /tmptmpfs   rw,mode=01777   0   0

to /etc/fstab (and remove any other /tmp lines).

A warning will come saying that it is highly experimental - but I've
been running with it for a while now without any issues.



I have been using tmpfs (mount /tmp in memory instead of on the hard  
drive) on my netbook to save writes to the SSD, and have had no problems.


While there may be important stuff in /tmp at the moment you are running  
the system for some reason (like X, apparently), there shouldn't be  
anything in there that needs to survive a reboot, if that gives you an  
indication of the safeness of deleting things. That's my understanding, if  
I'm wrong I'd be interested to hear it.


Brian
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread Polytropon
On Sun, 10 Oct 2010 09:41:16 -0400, bdsf...@att.net wrote:
 While there may be important stuff in /tmp at the moment you are running  
 the system for some reason (like X, apparently), there shouldn't be  
 anything in there that needs to survive a reboot, if that gives you an  
 indication of the safeness of deleting things. That's my understanding, if  
 I'm wrong I'd be interested to hear it.

I also understodd the meaning of /tmp in this way - does not need
to survive reboot. For things that have a kind of temporary nature,
but have to survivve a reboot, /var/tmp is usually used.

For example, mergemaster's temproot/ tree resides here, as well as
LaTeX's texfonts/ or vi's vi.recover/ subtrees.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread Eitan Adler
 I also understodd the meaning of /tmp in this way - does not need
 to survive reboot. For things that have a kind of temporary nature,
 but have to survivve a reboot, /var/tmp is usually used.

I did not know that. I aliased /var/tmp to /tmp which is tmpfsed
I'm guessing I should undo that - right?
-- 
Eitan Adler
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-10 Thread Polytropon
On Sun, 10 Oct 2010 15:00:43 +, Eitan Adler li...@eitanadler.com wrote:
  I also understodd the meaning of /tmp in this way - does not need
  to survive reboot. For things that have a kind of temporary nature,
  but have to survivve a reboot, /var/tmp is usually used.
 
 I did not know that. I aliased /var/tmp to /tmp which is tmpfsed
 I'm guessing I should undo that - right?

Just in case you encountered problems that *may* be related to
mergemaster, vi, or any other software you're running that requires
persistent temporary files (sounds illogical). There shouldn't
be much stuff accumulating in /var/tmp.

If you didn't have trouble yet, I don't think it is a big no-go to
symlink /var/tmp tp /tmp (tmpfs).


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Caleb Stein

On Fri, 08 Oct 2010 22:46:55 -0700, Robert Huff roberth...@rcn.com wrote:



Caleb Stein writes:


 I'm constantly getting the message, :/ write failed, filesystem
 is full, so I did df, and it said that my / filesystem was at
 108%.  What files can I delete to free some space?


Start by checking the contents of /tmp.
Any *.core in /root you don't recognize is suspect.
After that?  Try:

du -x / | sort -n -r | head -n 40

Look in those directories.


Robert Huff

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to  
freebsd-questions-unsubscr...@freebsd.org


So is it safe to do rm -rf /tmp/*?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Eitan Adler
On Sat, Oct 9, 2010 at 12:43 AM, Caleb Stein calebzst...@gmail.com wrote:
 I'm constantly getting the message, :/ write failed, filesystem is full,
 so I did df, and it said that my / filesystem was at 108%.  What files can I
 delete to free some space?
du -chx /
to view all and their sizes
you might want to use du -cx /|sort to view them largest to smallest.


-- 
Eitan Adler
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Arthur Chance

On 10/09/10 17:58, Caleb Stein wrote:

On Fri, 08 Oct 2010 22:46:55 -0700, Robert Huff roberth...@rcn.com wrote:

[Full /tmp discussion snipped]


So is it safe to do rm -rf /tmp/*?


Not if running an X desktop, as all sorts of things get stuck in /tmp 
that are needed. In single user mode it should be safe, and it probably 
is when simply running on the console.


As a long term solution, if you wish to clear /tmp every reboot add

clear_tmp_enable=YES# Clear /tmp at startup.

to your /etc/rc.conf

--
Although the wombat is real and the dragon is not, few know what a
wombat looks like, but everyone knows what a dragon looks like.

-- Avram Davidson, _Adventures in Unhistory_
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Devin Teske

On Oct 9, 2010, at 9:58 AM, Caleb Stein wrote:

 On Fri, 08 Oct 2010 22:46:55 -0700, Robert Huff roberth...@rcn.com wrote:
 
 
 Caleb Stein writes:
 
 I'm constantly getting the message, :/ write failed, filesystem
 is full, so I did df, and it said that my / filesystem was at
 108%.  What files can I delete to free some space?
 
  Start by checking the contents of /tmp.
  Any *.core in /root you don't recognize is suspect.
  After that?  Try:
 
  du -x / | sort -n -r | head -n 40
 
  Look in those directories.
 
 
  Robert Huff
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
 
 So is it safe to do rm -rf /tmp/*?


Generally yes, though it's always safest to check to make sure you're not 
deleting any files that actively held open by running processes. You can do 
this by:

fstat -f /tmp

(or if /tmp is not it's own filesystem -- if it lives on the `/' partition that 
is)

fstat | grep /tmp

If you a find a process that has open file descriptors in `/tmp', you can do 
two things:

1. You can kill the process (the third column in the output of fstat(1) is the 
process ID or PID). Continue until no processes are left holding open 
file-descriptors in `/tmp'. Then it would be safe to wipe everything in that 
directory.

2. You can avoid removing the files that are open. The sixth column in the 
output of fstat(1) is the inode/inum of the file on the device/mount (the 
device/mount column is the fifth column, just to the left of the inode/inum 
column). You can descend into `/tmp' and say `ls -li' to show the inode 
numbers, or you can say `find /tmp -inum INODE' to find the associated file. 
You would want to avoid deleting that file because a running process has it 
open.


In addition, there's an alternative way to clear the temporary files of a 
system (FreeBSD-5.0 and higher):


(as root or with sudo(8)) sh -c 'clear_tmp_enable=YES; 
/etc/rc.d/cleartmp start'

NOTE: Unless you've customized your rc.conf(5) files to change the defaults, 
clear_tmp_enable defaults to NO and clear_tmp_X defaults to YES (see 
`/etc/defaults/rc.conf'), so passing a start to this rc.d script will (by 
default) only clear out the X related temporary files located in `/tmp', 
whereas the above command will get the rc.d script to a full cleanup of `/tmp' 
(regardless of whether you've customized rc.conf(5) or not).

The rc.d script (cleartmp) _does_ do a slightly more sophisticated clean-up of 
the `/tmp' directory in that it will not kill-off the `lost+found' directory if 
it exists, and will also ignore `quota.user'/`quota.group' files. Lastly, it 
will recreate the X11 socket directories (`.X11-unix', `.ICE-unix', 
`.XIM-unix', and `.font-unix').

In addition, the above command is better in that it will clean up files 
beginning with `.' whereas your command which only specified rm -Rf /tmp/* 
won't get files that begin with `.' (of which there may be numerous).

Last but not least, if your system is running XFree86 or Xorg, running either 
the rm -Rf /tmp/* -or- the cleartmp rc.d script is bad while the X server is 
running since it might cause the running X server to lose its mind (these are 
lock-files in `/tmp' that shouldn't be removed while the server is running). 
Again, fstat(1) is your friend. Though, alternatively you could bring the X 
server down temporarily, clear `/tmp' however you prefer, and then restart the 
`X' server.

If this is all too overwhelming, you could always safely just clear `/tmp' and 
then immediately reboot. Or, plop clear_tmp_enable=YES into rc.conf(5), 
reboot, and the system will clear `/tmp' for you on boot-up.
--
Devin

(full sig at bottom)




 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

--
Cheers,
Devin Teske

- CONTACT INFORMATION -
Business Solutions Consultant II
FIS - fisglobal.com
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
devin.te...@fisglobal.com

- LEGAL DISCLAIMER -
This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.

- FUN STUFF -
-BEGIN GEEK CODE BLOCK-
Version 3.1
GAT/CS d(+) s: a- C++() UB$ P++() L++() !E--- W++ N? o? K- w O
M+ V- PS+ PE Y+ PGP- t(+) 5? X+(++) R++ tv(+) b+(++) DI+(++) D(+) G+++ e+ h
r++ y+ 
--END GEEK CODE 

Re: Clean up / filesystem

2010-10-09 Thread Robert Huff

Caleb Stein writes:

I'm constantly getting the message, :/ write failed, filesystem
is full, so I did df, and it said that my / filesystem was at
108%.  What files can I delete to free some space?
  
  Start by checking the contents of /tmp.
  Any *.core in /root you don't recognize is suspect.
  After that?  Try:
  
  du -x / | sort -n -r | head -n 40
  
  Look in those directories.
  
  So is it safe to do rm -rf /tmp/*?

No.  Blanket deletes are almost never a good idea.
_Look in the directories_.
Understand what's there, and why.
Do so regularly, and you'll get a feel for when something
changes.  The output of:

du /usr | sort -n -r | head -n 30

is waiting for me every morning when I check e-mail.  After
about a month, I knew what directories should be there (the exact
content fluctuates, depending on port builds etc.) and how big they
should be, and could a) pick out when something was wrong and b)
guess what might have caused it.


Robert Huff


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Caleb Stein
On Sat, 09 Oct 2010 10:38:41 -0700, Arthur Chance free...@qeng-ho.org  
wrote:



On 10/09/10 17:58, Caleb Stein wrote:
On Fri, 08 Oct 2010 22:46:55 -0700, Robert Huff roberth...@rcn.com  
wrote:

[Full /tmp discussion snipped]


So is it safe to do rm -rf /tmp/*?


Not if running an X desktop, as all sorts of things get stuck in /tmp  
that are needed. In single user mode it should be safe, and it probably  
is when simply running on the console.


As a long term solution, if you wish to clear /tmp every reboot add

clear_tmp_enable=YES# Clear /tmp at startup.

to your /etc/rc.conf



Ok, so it won't hurt X as long as I clear /tmp/ while X isn't running?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Polytropon
On Sat, 09 Oct 2010 10:40:20 -0700, Caleb Stein caleb.st...@me.com wrote:
 Ok, so it won't hurt X as long as I clear /tmp/ while X isn't running?

Correct, no problem.

It *may* be possible that some programs save files to /tmp, even
if it is NOT to be assumed that those files survive a reboot.
The content of /tmp is to be seen as easily flammable. :-)

X itself does use /tmp mainly for /tmp/.X0-lock as well as the
/tmp/.font-unix/, /tmp/.X11-unix/, /tmp/.ICE-unix/, /tmp/.XIM-unix/ 
and other subtrees that get generated anyway when not present
at X startup.

Make sure *YOU* don't have any important files in there. :-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Clean up / filesystem

2010-10-09 Thread Caleb Stein

On Sat, 09 Oct 2010 15:16:11 -0700, Polytropon free...@edvax.de wrote:

On Sat, 09 Oct 2010 10:40:20 -0700, Caleb Stein caleb.st...@me.com  
wrote:

Ok, so it won't hurt X as long as I clear /tmp/ while X isn't running?


Correct, no problem.

It *may* be possible that some programs save files to /tmp, even
if it is NOT to be assumed that those files survive a reboot.
The content of /tmp is to be seen as easily flammable. :-)

X itself does use /tmp mainly for /tmp/.X0-lock as well as the
/tmp/.font-unix/, /tmp/.X11-unix/, /tmp/.ICE-unix/, /tmp/.XIM-unix/
and other subtrees that get generated anyway when not present
at X startup.

Make sure *YOU* don't have any important files in there. :-)





Ok, thanks for the info.  I've added clear_tmp_enable=YES to rc.conf, so  
hopefully, after a reboot, I'll stop seeing the annoying message.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Clean up / filesystem

2010-10-08 Thread Caleb Stein
I'm constantly getting the message, :/ write failed, filesystem is full,  
so I did df, and it said that my / filesystem was at 108%.  What files can  
I delete to free some space?

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Clean up / filesystem

2010-10-08 Thread Robert Huff

Caleb Stein writes:

  I'm constantly getting the message, :/ write failed, filesystem
  is full, so I did df, and it said that my / filesystem was at
  108%.  What files can I delete to free some space?

Start by checking the contents of /tmp.
Any *.core in /root you don't recognize is suspect.
After that?  Try:

du -x / | sort -n -r | head -n 40

Look in those directories.


Robert Huff

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org