While lurking on the list, I learned in a thread "Cannot make a copy of video DVD with k3b" that the way fedora is configured, tmpfs will consume 50% of my RAM and mount itself in /tmp. If you have gobs of RAM I suppose you'd never miss it unless you are doing serious video editing or something like that.
My system has only 3GB of RAM and it does appear that 1.5GB is now a tmpfs. I really don't have that to spare. I do have a 5GB /tmp partition on a physical HDD that I thought I had been using for years. Only now did I learn that I'm not.
Rick Stevens suggested "systemctl mask tmp.mount" as a fix. I tried that and then I couldn't log in. It turns out, that command will make my / partition read only. I googled it and discovered that someone else had the same problem. There was no answer to that thread. You can fix this by "mount -o remount,rw /" and then issuing "systemctl unmask tmp.mount" and rebooting again.
I tried editing the entry in /etc/fstab from
UUID=996d5f64-0745-4af7-9260-559d5c66c7bd / ext4 defaults 1 1
to
UUID=996d5f64-0745-4af7-9260-559d5c66c7bd / ext4 defaults,rw 1 1
but that still didn't mount / rw.
So, how do I turn off fedora's tmpfs forever so I can use my physical /tmp partition and not consume all my valuable RAM? Or stated otherwise, how do I disable tmpfs AND keep / read-write?
Thanks,
Once upon a time, Dennis Kaptain dennis.kaptain@gmail.com said:
While lurking on the list, I learned in a thread "Cannot make a copy of video DVD with k3b" that the way fedora is configured, tmpfs will consume 50% of my RAM and mount itself in /tmp. If you have gobs of RAM I suppose you'd never miss it unless you are doing serious video editing or something like that.
There's a lot of misinformation about this. The tmpfs does _not_ "consume 50% of [your] RAM". The maximum size of a tmpfs defaults to 50% of RAM, but it only uses space as needed. Also, space used in tmpfs can be pushed to swap (so if you run low on RAM, files in tmpfs will be pushed out to swap on disk to free up RAM for programs).
2014-08-08 10:46 GMT-05:00 Chris Adams linux@cmadams.net:
Once upon a time, Dennis Kaptain dennis.kaptain@gmail.com said:
While lurking on the list, I learned in a thread "Cannot make a copy of video DVD with k3b" that the way fedora is configured, tmpfs will consume 50% of my RAM and mount itself in /tmp. If you have gobs of RAM I suppose you'd never miss it unless you are doing serious video editing or something like that.
There's a lot of misinformation about this. The tmpfs does _not_ "consume 50% of [your] RAM". The maximum size of a tmpfs defaults to 50% of RAM, but it only uses space as needed. Also, space used in tmpfs can be pushed to swap (so if you run low on RAM, files in tmpfs will be pushed out to swap on disk to free up RAM for programs).
-- Chris Adams linux@cmadams.net --
Thanks for clearing that up Chris.
It still doesn't seem like an ideal way to handle /tmp when I have a perfectly good partition and swapping is a major performance killer. I'd rather disk access wait time is caused by accessing /tmp when I need to rather than swapping tmpfs in and out for a program.
Is there a way to totally disable tmpfs and keep / read-write?
Once upon a time, Dennis Kaptain dennis.kaptain@gmail.com said:
It still doesn't seem like an ideal way to handle /tmp when I have a perfectly good partition and swapping is a major performance killer. I'd rather disk access wait time is caused by accessing /tmp when I need to rather than swapping tmpfs in and out for a program.
Swapping tmpfs files to swap is no more of a performance killer than writing /tmp to disk to begin with (the same data would be written to the same disk, just in a little bit different format and location).
When a program writes data to disk, it goes through the kernel page cache, to the filesystem layer, to the block layer, and then to disk. The filesystem has to allocate space (which means other writes to disk, updating block allocations, directories, etc.). The blocks are cached in the page cache in case they are read later. If the kernel needs RAM, it can throw them away.
tmpfs lives directly in the page cache. So, when a program writes to a tmpfs file, it goes to the page cache and stops. Later, if the kernel needs RAM, it can push those pages to disk (swap space).
The only difference between /tmp on disk and tmpfs is when pages get pushed to disk. In a system with sufficient RAM to hold the normal /tmp contents (which aren't very big under most circumstances), they never get pushed to disk with tmpfs, and performance is faster.
The only downside to /tmp-on-tmpfs is that it is limited in size, based on available RAM. Ideally, it would be based on swap size, or total RAM+swap, but that's harder to do. However, Fedora defaults to a root filesystem that isn't huge (with a separate /home), so the size of /tmp is still limited. /tmp was never supposed to be about holding arbitrary sized chunks of data.
On Fri, 8 Aug 2014 12:39:39 -0500 Chris Adams linux@cmadams.net wrote:
Once upon a time, Dennis Kaptain dennis.kaptain@gmail.com said:
It still doesn't seem like an ideal way to handle /tmp when I have a perfectly good partition and swapping is a major performance killer. I'd rather disk access wait time is caused by accessing /tmp when I need to rather than swapping tmpfs in and out for a program.
Swapping tmpfs files to swap is no more of a performance killer than writing /tmp to disk to begin with (the same data would be written to the same disk, just in a little bit different format and location).
Please, please don't start about this stuff yet again.
It has been rehashed many times over, in countless places on the net: if your typical usecase does not involve large files in /tmp and you have enough RAM to never hit swap, tmpfs is more efficient. Otherwise, disk is more efficient. Everyone needs to decide for themselves, and configure their system accordingly.
If the OP has already decided what he wants, just tell him how to configure it, rather than trying to persuade him that your size fits all.
HTH, :-) Marko
On Friday, August 08, 2014 10:32:15 AM Dennis Kaptain wrote:
So, how do I turn off fedora's tmpfs forever so I can use my physical /tmp partition and not consume all my valuable RAM? Or stated otherwise, how do I disable tmpfs AND keep / read-write?
systemctl mask tmp.mount
-A
Allegedly, on or about 08 August 2014, Dennis Kaptain sent:
Rick Stevens suggested "systemctl mask tmp.mount" as a fix. I tried that and then I couldn't log in.
That sounds like a very old problem. I encountered that, many years ago, when I swapped hard drives on a PC. Check the permissions of your /tmp directory, the sticky bit needs to be set.
$ ll -d /tmp drwxrwxrwt. 24 root root 12288 Aug 9 02:15 /tmp
Without that, graphical logins would fail. But command line logins would work, as they didn't play around with putting things in /tmp.
Dennis Kaptain wrote:
Rick Stevens suggested "systemctl mask tmp.mount" as a fix. I tried that and then I couldn't log in. It turns out, that command will make my / partition read only.
Following http://fedoraproject.org/wiki/Features/tmp-on-tmpfs#Release_Notes has always worked for me. It shouldn't affect your / partition, odd.
-- Rex