Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Sol 8: Run "/tmp" in RAM (not swap, and not hdd)

Hey Gang,

Weird question.  This is in relation to a customer’s requirement...so although there are probably far better ways of doing this...for the moment, I need to know how to do it this way.

I would like to set a Solaris 8 (02/02) system so the "/tmp” dir is mounted to RAM (I.E. as if it were mounted to a Windows ramdrive.)  It would be acceptable to mount it directly...OR have it mount to swap (like normal) but set swap to RAM only (no hard drive access at all.)

This can be done through configuration editing, scripts during/after boot...whatever.

Thanks!
M
0
Mike R.
Asked:
Mike R.
3 Solutions
 
PsiCopCommented:
You need the File System type "tmpfs"

See --> man tmpfs

You create and mount it using mount

See --> man mount
0
 
Mike R.Author Commented:
OK...what was throwing me off was the fact that the examples for both tmpfs and mount -F tmpfs mention swap.  We don't want the /tmp dir to touch the hard drive...however, as Solaris can run without swap, I am assuming that if swap space on the drive is not designated at all (I.E. "swap -l" responds with no swap enabled) then the command "mount -F tmpfs swap /tmp" will result with the /tmp dir being held completely in RAM.

Is this correct?

Thanks!
M
0
 
wesly_chenCommented:
Hi,

   As my understanding, /tmp is "RAM+swap partition" on Solaris 8 by default (check /etc/vfstab, swap mount as tmpfs).
So if you don't have any swap partition, then /tmp should be RAM only.

Wesly
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Mike R.Author Commented:
Great...thanks makes sense (you are right about the mounting in the vfstab.)  I will give this a shot Monday and see how we end up!

Thanks!
M
0
 
NukfrorCommented:
You can run a Solaris server without phsyical swap - but I wouldn't suggest it.  A tmpfs file system actually lives on top of what is known as anonymous memory which is part RAM (this is variable and changes constantly) and physical swap.

By default, /tmp is mounted on top of swap - sounds like the system your are talking about was setup with /tmp physically mounted on a partition.  This is fine but can cause performance issues for temporary files - hopefully /tmp is being used for temporary files.  Some folks setup /tmp on physical partitions cuz they didn't can /tmp to eat up all swap space - which by default it can.  This can easily be limited in /etc/vfstab.
0
 
Mike R.Author Commented:
I have not had a chance to really "test" the configuration...but so far, everything seems to be fine with /tmp mounted normally to a tmpfs, but having no physical swap.  I agree with Nukfror, that running without physical swap is not recommended-and can lead to issues-but, for this particular install, it was a requirement.

It looks like I am not really going to be able to run the system through it paces for a while (things have started to pile up) so I am going to assign points and will re-visit the issue as a new question if it becomes necessary.

Thanks for all the help and input!
M
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now