4

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?

4

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)
| 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
4

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.

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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