2 tmpfs partitions on new Linode

This weird, I have two tmpfs partition on a new Linode(Debian 5):

df -h

Filesystem Size Used Avail Use% Mounted on

/dev/xvda 12G 979M 11G 9% /

tmpfs 271M 0 271M 0% /lib/init/rw

tmpfs 271M 4.0K 271M 1% /dev/shm

Which one is correct and how do I get rid of the other one.

I only have one swap space setup in my Linode Manager

7 Replies

It's not a problem. I wish I could tell you exactly what those directories are for, but my guess is the kernel or some core library uses them for state.

tmpfs doesn't allocate any RAM it's not actually using, so the 271M you see there is some kind of maximum that'll never be approached. Do a du on those directories and you'll find they're so close to empty it's not even worth looking at.

the reason i was asking is that I want to mount my tmp space with noexec, so I want to know which one I need to deal with.

The tmpfs in /lib/init/rw seems to be a debian thing - see bugs 403863 and 405189.

@NeoGuru:

Which one is correct and how do I get rid of the other one.

I only have one swap space setup in my Linode Manager.
The tmpfs in /dev/shm is the "real" one. Don't get rid of the other one, as init scripts that write there may be run at other times (if you manually restart a service, or switch runlevels).

Neither one of those is your "tmp space".

@Xan:

Neither one of those is your "tmp space".
What are these then?

For the first, it appears to be something like /var/run, but Debian-specific and available prior to /var being mounted:

http://bugs.debian.org/cgi-bin/bugrepor … =%23403863">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%23403863

/dev/shm is for a particular inter-process shared memory mechanism.

Whether or not those are safe to noexec is something you'd have to ask the Debian folks about…

The reason you really want to noexec /tmp is because any user can write to it. That's not the case for these two housekeeping things.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct