tmpfs and /tmp partition
tmpfs and /tmp partition
Greetings,
As I understand it, /tmp is by default mapped to tmpfs and swap. That would seem to suggest there is no point putting /tmp on it's own partition as the security guide still suggests ?
What am I missing ?
BRgds/Alan
As I understand it, /tmp is by default mapped to tmpfs and swap. That would seem to suggest there is no point putting /tmp on it's own partition as the security guide still suggests ?
What am I missing ?
BRgds/Alan
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: tmpfs and /tmp partition
No. By default only /dev/shm, /run,, and /sys/fs/cgroup are type tmpfs.
/tmp is just a directory.
/tmp is just a directory.
Re: tmpfs and /tmp partition
Wrrong, doesn't seems so. Using CentOS 7 x64, standard install, 8 GB Ram, no custom fstab
Correct reply:
"/tmp is by default mapped to tmpfs"
Since i'm not using at all swap, cannot reply about this
Code: Select all
[matteo@localhost ~]$ df
File system 1K-blocchi Usati Disponib. Uso% Montato su
/dev/sda2 56756376 5580276 48269988 11% /
devtmpfs 4009556 0 4009556 0% /dev
tmpfs 4018484 140 4018344 1% /dev/shm
tmpfs 4018484 9084 4009400 1% /run
tmpfs 4018484 0 4018484 0% /sys/fs/cgroup
tmpfs 4018484 18308 4000176 1% /tmp
/dev/sda1 789904 122136 610424 17% /boot
/dev/sdb1 976759804 39284524 937475280 5% /run/media/matteo/Dati
"/tmp is by default mapped to tmpfs"
Since i'm not using at all swap, cannot reply about this
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: tmpfs and /tmp partition
Then it must depend on amount of RAM.
I did a default install with 2G RAM and I do not have tmpfs for /tmp.
I did a default install with 2G RAM and I do not have tmpfs for /tmp.
Re: tmpfs and /tmp partition
thank you for your answer, , really useful. I thought the same behavior for tmpfs for systems with less RAM
I'm wrong
but re-reading http://en.wikipedia.org/wiki/Tmpfs the definition of tmpfs had to get there by myself ...
if a system has little ram, is diabolical use tmpfs and then use immediately swap ..
I'm wrong
but re-reading http://en.wikipedia.org/wiki/Tmpfs the definition of tmpfs had to get there by myself ...
if a system has little ram, is diabolical use tmpfs and then use immediately swap ..
Re: tmpfs and /tmp partition
Mmmm thanks very much for the follow up. That is what I thought:
For a reasonable amount of RAM, the default is for /tmp (tmpfs) to take up to half of RAM and then use swap.
So I think making a separate /tmp partition is just a waste of disk space - better to make swap a bit bigger ...
??
Alan
For a reasonable amount of RAM, the default is for /tmp (tmpfs) to take up to half of RAM and then use swap.
So I think making a separate /tmp partition is just a waste of disk space - better to make swap a bit bigger ...
??
Alan
Re: tmpfs and /tmp partition
It is NEVER "better" to make swap bigger.ataylor wrote:better to make swap a bit bigger
If you're hitting swap, it means your running applications are poorly configured.
Optimize the apps, or add ram - NEVER add swap.
Swap came from the days when ram was limited (because of hardware architecture and ram cost). It was the only way to keep things limping along due to ram shortage.
None of that's true with modern hardware.
For the 2.5^15th time :: Better Details = Better Answers
Re: tmpfs and /tmp partition
"better" in this case means better than an empty, unused /tmp partition
Re: tmpfs and /tmp partition
The real culprit with /tmp on tmpfs (besides losing its content on reboot, which sometimes may be undesirable) is that tmpfs grows as long as there is RAM available. Now just imagine some process writing into /tmp a, say, input video stream... and the picture is not nice at all. Once upon a time some processes loved writing core files into /tmp too...
I'd advise everybody dealing with CentOS 7 to carefully consider bringing /tmp back to the disk - or, at least, engage proper monitoring of its size (because RAM usage monitor itself will not help).
WWell,
I'd advise everybody dealing with CentOS 7 to carefully consider bringing /tmp back to the disk - or, at least, engage proper monitoring of its size (because RAM usage monitor itself will not help).
WWell,