[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Idea: mount /tmp to tmpfs depending on free space and RAM

On June 2, 2012 03:48:03 AM Serge wrote:
> 2012/6/2 Bruce Sass wrote:
> >> Maintainer will probably write a better code.
> > 
> > Much better... if TMPTIME != 0 it will be necessary to mount the FS based
> > /tmp, clean it, create a tmpfs, move anything left in /tmp to the tmpfs,
> > then mount --bind the tmpfs on /tmp.
> Oh... I was not thinking about TMPTIME. Does it mean that there's no way
> we can mount /tmp to tmpfs because it breaks TMPTIME?
no... TMPTIME is currently meaningless (or effectively == 0) when /tmp is a 
tmpfs, that is simply an expected consequence of keeping /tmp in RAM. It could 
become meaningful if tmpfs on /tmp's contents were written to disk at shutdown 
then reloaded at boot when TMPTIME's value is !=0.

What it does mean is that automatically changing a system over to /tmp on 
tmpfs was a bad idea both philosophically and because it could cause data 
lose; and that there should be a check of TMPTIME's value and the contents of 
/tmp before any automated mechanism changes to a tmpfs based /tmp, to mitigate 
the possibility of data loss.

- Bruce

Reply to: