Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on a managed machine but I'd like to create a folder stored in RAM for temporary storage, how might I do this?

share|improve this question

migrated from stackoverflow.com Feb 13 '12 at 20:45

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

AFAIK, you can't create a new tmpfs mount without root privileges.

However, many Linux distos provide a tmpfs mount on /dev/shm that's writable by all users. If it's there, you should be able to abuse use that to store your temporary directory.

On RHEL4/RHEL5:

[me@home]$ mount | grep tmpfs
none on /dev/shm type tmpfs (rw)

On Ubuntu 11.10, it is mounted on /run/shm:

[me@ubuntu_home]$  mount | grep shm
none on /run/shm type tmpfs (rw,nosuid,nodev)
share|improve this answer
    
I'm on Scientific Linux which I believe is a spin of RHEL so /dev/shm is working wonderfully well, thank you. – KitB Feb 14 '12 at 13:49
    
@KitB You're welcome. – Shawn Chin Feb 14 '12 at 14:01

Without the help of a sysadmin you can't. In fact you need him to use sudo to make you able to mount tmpfs or to put an ad-hoc entry in /etc/fstab .

The point is that mount requires special rights.

Ask your sysadmin

PS: if your system works with tmpfs mounted on /tmp, then you can create a folder there.

share|improve this answer
    
+1 for mentioning that there usually is a tmpfs mounted in world writable /tmp – Kimvais Feb 13 '12 at 16:22
    
/tmp is not in memory unfortunately – KitB Feb 14 '12 at 13:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .