Tmpfs / shm - default setting

I have this in fstab.

UUID=9B96-8EF3                            /boot/efi      vfat    defaults,noatime 0       2
UUID=c63f7ccc-1f25-44e8-aafc-d5833a65f3ef /              ext4    defaults,noatime 0       1
UUID=b73dfb10-0e46-4863-8b13-6a38eed1755e swap           swap    defaults,noatime 0       0
# original ==>> tmpfs                     /tmp           tmpfs   defaults,noatime,mode=1777 0       0
tmpfs                                     /tmp           tmpfs   nodev, sosuid, size=6G 0       0

Today, an applications throw errors like this:

[21535:1024/] Creating shared memory in /dev/shm/.org.chromium.Chromium.AWjDy5 failed: No such file or directory (2)
[21535:1024/] Unable to access(W_OK|X_OK) /dev/shm: No such file or directory (2)
[21535:1024/] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.

In the whole manjaro-wiki-Page I don’t find any entry for “shm”. A short research in the Internet shows, that it’s seems to be an alternate place (and naming) for tmpfs.

So what to do? Should I just create a symbolic link from /dev/shm to /tmp?

It actually tells you it does not have permissions to write…maybe you should return the defaults? Actually, you can even comment out the whole line and let systemd take care of it automatically. We had a recent discussion here

1 Like

Thanks for your answer. It means I should comment out /tmp in my fstab, and this switch back to default?!

I mean… What do YOU want?

What was the reason you changed it to that specific line?

What does swapon --show return?

But most likely, yes.

I don’t remember, was some years ago that I had made this setup.

/dev/sda3 partition 14,9G   0B   -2

Either comment out or use the default parameters


1 Like

Yeah, your config makes zero sense. It’s not even the size of the swap partition (14,9G).

Do what Teo says.

Here is how to configure swap:

just comment it out as was recommended -
or comment out your entry and re-activate the default
your entry contains a typo:

tmpfs    /tmp   tmpfs   nodev, sosuid, size=6G 0       0

it’s not


it should be


ps: I just noticed:
I’m also not sure about the spaces before the dividing comma
There should be none - IMO this is another typo.

1 Like

Why would it need to be the size of swap? If anything /tmp should be smaller than swap.

The only thing wrong with the swap entry is the noatime option, though I doubt it matters since the swap is “on”.

Sure, you take over and let him have a swap PARTITION with 14,9G and a tmpfs in fstab that is 6G.
Don’t use the automated built in systems.

Listen to dmt, I’m going to bed.

Its pretty common, and I believe default, for tmpfs to be half of RAM.

Similarly SWAP may often be set to half, full, or double the size of RAM.

They are separate things really, without direct correlation.

1 Like

Why do you think that’s a problem?

To be clear, I’m not saying OP should use their tmpfs entry, which is wrong, but not because it’s smaller than swap. I would’ve told them to use the default entry or remove the tmpfs altogether, but I think enough people have already done so.

As @cscs pointed out, the default max size is half of RAM…swap’s size, even it’s existence is totally irrelevant to tmpfs, unless you want to hibernate and even then it’s the size of the RAM that matters (or more accurately the size of the current contents of RAM and swap).

It’s not efficient and you have to monitor it so it is enough. I prefer the system take care of that.
I f.ex would HATE if I could not use my memory to unpack and directly play blueray movies that are HUGE. I prefer the linux way over windows that creates tempfiles on a hard-drive.

But you went there, now explain how all of it goes, I was about to, but you came in and told me I was wrong so go ahead and explain how EVERYTING works for op since you recommend AGAINST the default line.

Please don’t tag me again, this thread is not about me.
You took over, help OP. Explain it all.

I don’t know what you’re talking about. How does swap have anything to do with tmpfs?

So if I comprehend correctly, you unpack bluerays to your /tmp dir?

It sounds more like a preference, than anything else.

You’re the one arguing against the defaults. I said to use the default entry or to remove it thereby still using the defaults (which is half the size of RAM, not 14.9G or the size of swap).

No, I simply corrected you. I made no attempt to take over as @Teo and @Nachlese had already covered it all.

OP has been helped, we’re now waiting for them to reply.

tmpfs is a temporary filesystem in RAM, the default max size is half the size of RAM.

swap is a place for pages to be swapped out of memory, it doesn’t have to exist, but is usually beneficial.

All Manjaro systems have a tmpfs for /tmp, and they all have varying amounts of swap, ranging from none to 32GB+. The size of RAM also varies so therefore the size of the tmpfs also varies.

The only time swap has any relevance to tmpfs, is when you want to hibernate, then swap has to exist so that the contents of memory can be put there. In that case swap needs to be bigger than everything already in RAM and swap, presumably including the tmpfs (all of them, though there’s usually only one).

I’m not even going to read.
I asked before, and I ask you AGAIN:

Ah yes, you’re right even though you’re wrong, you’ve had your say and now have the right to demand other people don’t have theirs.

You’re free to ignore it.

Well, yes and no. tmpfs is a filesystem in virtual memory. This means that it starts out in RAM, but that it can be paged out to swap if necessary.

Yes, but one can set another maximum size for it. It all depends on what it must be used for. :wink:

That is correct, yes. If you intend to hibernate (“suspend-to-disk”) the machine, then your swap device should be large enough to hold everything in RAM plus whatever’s already in swap.

1 Like

Yeah, there was some ambiguity in my wording. :smiley:

1 Like

Ok, that was much to read :wink: … but I’ve all done.

So I have comment out my tmpfs line in fstab and all work as expected now. The Application didn’t notice an error about /dev/shm anymore.

So thank you for this.

But question for swap… It’s set to 14.9 GB at my device… my RAM size is about 15GB (strange size, think should be two 8GB Sticks)

Are there now issues with my fstab settings for the swap, or I’m just fine with it?
I don’t mean the size, but the parameters that are used.

There’s no filesystem for noatime to apply to, but it doesn’t seem to cause a problem, as you showed your swap was “on” earlier in the thread. I’d still remove it though.

Other than that, it’s fine.

1 Like