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

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

2012/6/8 Petter Reinholdtsen wrote:

> [Wouter Verhelst]
>> - You could mount your mail spool there, and make things go blazingly
>>   fast [1]

You could, but this is not related to /tmp.

>> - There's no danger of a symlink attack or similar with things like
>>   tmpreaper -- or indeed any need for tmpreaper anymore. You reboot the
>>   system, and /tmp is clean again, no matter what was there before. This
>>   is more than just a convenience.

This works for many years. /tmp on disk is also cleaned on reboot.

> - It allow diskless setups like LTSP to work the same way the default
>   installation in Debian work.  They use read-only NFS-mounted file
>   systems and a writable tmpfs mounted on /tmp/.

But `mount --bind /tmp /home/tmp` or /tmp->/var/tmp also allows read-only
NFS root. And it's even better, because it gives you more free RAM, which
is usually very important for LTSP stations.

>  - It reduces the number of disk writes on a laptop, allowing it to
>   spin down the disk a bit longer.

It does not, because /tmp is mostly unused by default. On the contrary
vm.laptop_mode=1 do it much better than tmpfs. :)

> There are luckily other arguments too. :)

I start thinking that "if you use /tmp on tmpfs you're doing something wrong"
or rather "if you use /tmp on tmpfs you've missed a better option". :)


Reply to: