WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How do I mount /tmp to the local hard disk  (Read 4374 times)

tinycorelinux

  • Guest
How do I mount /tmp to the local hard disk
« 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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How do I mount /tmp to the local hard disk
« Reply #1 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?

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #2 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.
« Last Edit: December 25, 2020, 05:51:10 AM by ONE »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How do I mount /tmp to the local hard disk
« Reply #3 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?

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #4 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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How do I mount /tmp to the local hard disk
« Reply #5 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.
« Last Edit: December 25, 2020, 06:12:03 AM by Juanito »

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #6 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.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 933
Re: How do I mount /tmp to the local hard disk
« Reply #7 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

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #8 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

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: How do I mount /tmp to the local hard disk
« Reply #9 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.
The only barriers that can stop you are the ones you create yourself.

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #10 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?

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 933
Re: How do I mount /tmp to the local hard disk
« Reply #11 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...

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #12 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.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 933
Re: How do I mount /tmp to the local hard disk
« Reply #13 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.

tinycorelinux

  • Guest
Re: How do I mount /tmp to the local hard disk
« Reply #14 on: December 25, 2020, 11:33:56 PM »
I propose You the following sequence of RAM saving steps:
Thank you for your advice.