View previous topic :: View next topic |
Author |
Message |
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Tue Aug 27, 2024 7:07 am Post subject: tmpfs but on boot still "Wiping /tmp directory" |
|
|
Hi, how do disable that wiping - because this is pointless to clear that RAM on boot, yes?
Should I set no in /etc/init.d/bootmisc?
I will update https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs after finding the correct answer
Thanks for the help.
And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM. |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1803 Location: Germany
|
Posted: Tue Aug 27, 2024 7:49 am Post subject: |
|
|
Quote: | Hi, how do disable that wiping - because this is pointless to clear that RAM on boot, yes? |
What would be the benefit of not wiping it?
Quote: | And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM. |
In the age of SSD and NVME the difference in performance will not be significant as the difference between older SSD, HD and RAM. So try it and see it for your self if something is faster _________________ Forum Guidelines
PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3477
|
Posted: Tue Aug 27, 2024 10:13 am Post subject: |
|
|
Quote: | And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM. | There is little reason to store temporary files on disk in the first place, so yes, usually it is good, unless it makes you run out of precious RAM.
16GB is plenty, so you should be good, but if you're ever short on RAM, you can make up for it by enabling SWAP. Combining it with low (but non-zero) value in vm.swappiness (from sysctl) should give you the best of both worlds: keep stuff in RAM as long as possible, but still complete big builds without assistance from OOM killer.
Quote: | tmpfs but on boot still "Wiping /tmp directory" | A newly mounted tmpfs is empty, so there's nothing to wipe.
So yes, it is pointless. Unless, for whatever reason you change your setup later and /tmp will happen to be on a persistent storage, and suddenly you start accumulating clutter.
Honestly clearing the empty /tmp never bothered me nearly enough to look for a solution. I've had it indicate a damaged filesystem on a persistent storage a few times though, after machine got hit with a power outage. _________________ Make Computing Fun Again |
|
Back to top |
|
|
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Wed Aug 28, 2024 12:38 pm Post subject: |
|
|
I set them to no but still see Cleaning /tmp directory on boot
What is the correct way to disable it? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22877
|
Posted: Wed Aug 28, 2024 12:52 pm Post subject: |
|
|
As I read /etc/init.d/bootmisc, you did disable it. The thread started with a report that it was Wiping tmp. Now, it is Cleaning tmp. Per the log messages in that script, cleaning is what happens when you disallow a total wipe. It looks like this might get skipped if the script determines that the directory is a tmpfs. However, this is speculation on my part. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1964
|
Posted: Wed Aug 28, 2024 1:23 pm Post subject: |
|
|
Code: | # Clean up /tmp directories
local tmp=
for tmp in ${clean_tmp_dirs:-${wipe_tmp_dirs-/tmp}}; do
mountinfo -q -f tmpfs "$tmp" || cleanup_tmp_dir "$tmp"
done |
By this code (line 205): - It looks to the value set by clean_tmp_dirs. If it is an empty string, wipe_tmp_dirs is looked at. If both are an empty string, nothing occurs. (This is different from not setting or commenting out.)
- If $tmp is mounted as a tmpfs at this point, don't do anything.
- If not mounted as tmpfs, run the cleanup_tmp_dir function which wipes or cleans by the wipe_tmp setting
Last edited by grknight on Wed Aug 28, 2024 1:35 pm; edited 1 time in total |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1777 Location: South America
|
Posted: Wed Aug 28, 2024 1:24 pm Post subject: |
|
|
Therefore, OP, what's the output of /lib/rc/bin/mountinfo --fstype /tmp? _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20529
|
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22877
|
Posted: Wed Aug 28, 2024 4:02 pm Post subject: |
|
|
I think that is not related to this thread. The systemd-tmpfiles-clean job will go through and periodically delete old files from /tmp while the system is up. OP is inquiring about an OpenRC at-boot behavior. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20529
|
Posted: Wed Aug 28, 2024 4:41 pm Post subject: |
|
|
I thought by definition a RAM based file system was ephemeral. I'm confused by the use of a portage tmpfs and then wanting it not on a tmpfs. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22877
|
Posted: Wed Aug 28, 2024 5:53 pm Post subject: |
|
|
Yes, a tmpfs is discarded at shutdown. There is no point to clearing individual files from a freshly mounted tmpfs because there will not be any files, which I think is why OP wants to know why his system is trying to clear it. I do not see why OP brought https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs into this, since PORTAGE_TMPDIR is usually /var/tmp, not /tmp, and this thread seems to be focused on /tmp. |
|
Back to top |
|
|
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Thu Aug 29, 2024 8:12 am Post subject: |
|
|
Sorry reverted my addition to the Wiki. |
|
Back to top |
|
|
vitaly-zdanevich Tux's lil' helper
Joined: 01 Dec 2019 Posts: 106 Location: Belarus
|
Posted: Thu Aug 29, 2024 8:14 am Post subject: |
|
|
GDH-gentoo wrote: | Therefore, OP, what's the output of /lib/rc/bin/mountinfo --fstype /tmp? |
tmpfs |
|
Back to top |
|
|
|