Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: tinycorelinux on December 25, 2020, 04:53:43 AM

Title: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 04:53:43 AM
As title, How do I mount /tmp to a local hard disk instead of the default RAM.
Title: Re: How do I mount /tmp to the local hard disk
Post by: Juanito on December 25, 2020, 05:25:06 AM
You could perhaps delete /tmp and recreate it as a symlink to mounted permanent storage, but why do you need /tmp specifically?
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 05:41:06 AM
You could perhaps delete /tmp and recreate it as a symlink to mounted permanent storage,
I can do that, right? What should I do with the tcloop floder under this folder?

Quote
but why do you need /tmp specifically?
Not that I need it, but TCL needs it, because all of TCZ is mounted in this directory, and the system will not work without it, which I think you know best.
If this were not the case, I might simply delete the mount line of tmpfs in the /etc/fstab file.
Title: Re: How do I mount /tmp to the local hard disk
Post by: Juanito on December 25, 2020, 05:55:44 AM
You wouldn’t be able to load any extensions before attempting to change /tmp.

If you don’t need to save large files to /tmp, why not just save them elsewhere?
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 06:05:04 AM
You wouldn’t be able to load any extensions before attempting to change /tmp.

If you don’t need to save large files to /tmp, why not just save them elsewhere?
Because my memory is too small, tens of M of memory is a lot of memory for my computer. I just want to change the mount location of /tmp file or tmpfs, as long as it doesn't occupy my memory.
Title: Re: How do I mount /tmp to the local hard disk
Post by: Juanito on December 25, 2020, 06:10:19 AM
You could use a permanent /home and /opt - see the tinycore wiki or book for details on how to do this.

Note also that mounting extensions on /tmp/tcloop uses just a few bytes of ram.
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 06:19:46 AM
Note also that mounting extensions on /tmp/tcloop uses just a few bytes of ram.
I know, but my/tmp takes up at least 30M-80M of memory.
Title: Re: How do I mount /tmp to the local hard disk
Post by: jazzbiker on December 25, 2020, 06:31:56 AM
Hi, ONE and Juanito!

@ONE, how do You get the size of Your /tmp? Here is my example of "du -s /tmp"with and without the -x option:
Code: [Select]
tc@box:~$ du -s /tmp
110.5M  /tmp
tc@box:~$ du -xs /tmp
16.0K   /tmp
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 06:36:47 AM
Quote
@ONE, how do You get the size of Your /tmp?

Code: [Select]
tc@box:~$ du -s /tmp
67M  /tmp
tc@box:~$ du -xs /tmp
16.0K   /tmp
Title: Re: How do I mount /tmp to the local hard disk
Post by: curaga on December 25, 2020, 09:57:58 AM
It is a bad idea to put /tmp on a hd. Even traditional distros mostly put it in RAM. Lots of temp file writes go faster when in memory.
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 05:31:26 PM
It is a bad idea to ...
I also know that this is not what I want to do, but my computer configuration is too low, I have to do this, is there any way to change the size of the tmpfs partition? Have I tried to modify the /tmp partition, as is common with other distributions, and it doesn't seem to work with TCL?
Title: Re: How do I mount /tmp to the local hard disk
Post by: jazzbiker on December 25, 2020, 08:28:32 PM
Quote
@ONE, how do You get the size of Your /tmp?

Code: [Select]
tc@box:~$ du -s /tmp
67M  /tmp
tc@box:~$ du -xs /tmp
16.0K   /tmp

Hi, ONE!

Your /tmp consumes 16K of RAM. Extensions' loop devices are only mounted to /tmp/tcloop and does not consume RAM. I think saving 16K will not solve any problems...
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 09:15:35 PM
I think saving 16K will not solve any problems...
What you said is right.
As far as I know, most of the software (especially the desktop software) to /tmp folder as the default cache directory,
so every software to modify the cache directory is not reality, mainly is the most software have not provided or does not support such modification operations,so I just want to tmp takes up hard disk space rather than RAM, so as to realize once and for all.
Title: Re: How do I mount /tmp to the local hard disk
Post by: jazzbiker on December 25, 2020, 09:33:23 PM
I use the limited set of the software, available under TC, and I see ~/.cache directory and see it being used by some software, but I've never seen caches in /tmp. I propose You the following sequence of RAM saving steps:
1. Persistent /home and /opt
2. Using real swap on the hard disk and "nozswap" boot option

and as the very last

3. Moving /tmp somewhere else. I can not say exactly step by step how this can be done, but You will need to rework system startup files very thoroughly, otherwise You'll get system disaster.
Title: Re: How do I mount /tmp to the local hard disk
Post by: tinycorelinux on December 25, 2020, 11:33:56 PM
I propose You the following sequence of RAM saving steps:
Thank you for your advice.