[ale] cleaning out /tmp

Jeff Lightner jlightner at water.com
Mon Sep 3 10:44:05 EDT 2007


lost+found is used by journaled filesystems as a location to store those
files it couldn't completely identify by (fully qualified path) name
during a "full" fsck.  It dumps them in there with numeric names so that
you can examine them and decide whether you want to keep them.   (Sort
of like the old chkdisk CHK0000# files you'd get sometimes after running
DOS' chkdisk.)

Since it is /tmp and you intend to delete all the files on a reboot
anyway there's no real benefit to having it there - on the flip side
since it takes a single inode and few bytes (when empty) there seems to
be no real reason not to leave it alone.

By the way - if you did cron a clean out rather than only have it happen
on reboots you'd want to insure that the clean out script was only
deleting files not currently "open" by some process.  Running fuser or
lsof against the files you intend to delete before doing so to be sure
they're not open would be a good idea in such a script.

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of
Michael B. Trausch
Sent: Monday, September 03, 2007 12:46 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] cleaning out /tmp

Jim Popovitch, on 09/02/2007 10:52 PM said:
> On Sun, 2007-09-02 at 22:06 -0400, James Sumners wrote:
>> Debian cleans /tmp at boot time. Evidently, Ubuntu decided to break
>> this sane behavior. Here's something that might work for you --
>>
http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_clean_.2Ftmp.2F_folder_
contents_on_shutdown
> 
> While looking at that URL out of curiosity.... I realized that, if
> your /tmp dir is a mounted partition, those instructions would purge
> lost+found.  Question: what's the value of lost+found on /tmp mount
> point anyway?
> 

None that I can see, however, if someone wanted to ensure that it
existed, all one would have to do is run (cd /tmp; mklost+found) to
restore the lost+found directory.

	-- Mike

-- 
Michael B. Trausch               Internet Mail & Jabber: mike at trausch.us
Phone:  (404) 592-5746 x1                         http://www.trausch.us/
Mobile: (678) 522-7934             VoIP: 6453 at sip.trausch.us, 861384 at fwd
Pidgin 2.1.1 and plugins for Ubuntu Feisty! http://www.trausch.us/pidgin



More information about the Ale mailing list