When use tmpfs?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ccc

When use tmpfs?

Post by ccc »

hi

Can anyone pls explain, when use tmpfs?
BTW I should install mint with XFCE on a 2GB CompactFlash (CF) with 1GB RAM and should I use it?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
oobetimer

Re: When use tmpfs?

Post by oobetimer »

Every time. Open terminal and give a command mount .. :wink:
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
ccc

Re: When use tmpfs?

Post by ccc »

Should I use it tmpfs for /tmp, /var/(log,lock...) as well and add in /etc/fstab to be fix?
oobetimer

Re: When use tmpfs?

Post by oobetimer »

ccc wrote:Should I use it tmpfs for /tmp, /var/(log,lock...) as well and add in /etc/fstab to be fix?
No.
ccc

Re: When use tmpfs?

Post by ccc »

oobetimer wrote:Every time. Open terminal and give a command mount .. :wink:
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
Thx, but what happens after system restart and why not to put in /etc/fstab?
ccc

Re: When use tmpfs?

Post by ccc »

ccc wrote:
Thx, but what happens after system restart and why not to put in /etc/fstab?
Can you pls answer my question?
mint123

Re: When use tmpfs?

Post by mint123 »

If you have enough memory, no reason why you should not mount /tmp in ram. To survive boots, it needs to be in fstab. For /var/lock, run, logs, there are cases where you may or may not want to do that. I say kep /var/logs out of ram so you have them when needing them. If you find your computer can't handle it, unmount the /tmp and remove from fstab.

Code: Select all

tmpfs /tmp tmpfs rw,nosuid,nodev,noatime,size=512M 0 0
eanfrid

Re: When use tmpfs?

Post by eanfrid »

Have a look to /etc/default/rcS and to /etc/default/tmpfs: these 2 files manage how (tmpfs) and what (rcS) is supposed to be run in tmpfs. No fstab entry needed unless if you want to add mount options (like noexec for /tmp) to the default ones.

Edit: these files seem not to be overly used in Ubuntu/LM (/etc/default/tmpfs is not present) but you can tune your default options here, like:

Code: Select all

# implicit default
RAMRUN=yes

# mount /run/lock as a tmpfs (separately from /run)
RAMLOCK=yes

# mount /run/shm as a tmpfs (separately from /run)
RAMSHM=yes

# mount /tmp as a tmpfs
RAMTMP=yes
these setting were previously present in /etc/default/rcS but are now migrated to /etc/default/tmpfs. See "man tmpfs".
Locked

Return to “Installation & Boot”