Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

add comment

2 Answers 2

up vote 1 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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.