Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm running different applications for development purposes: Apache, MySQL, Tomcat and a couple of other products. I would like to set up the logging verbosity of all applications to debug, but when doing so, the disk gets a lot of activity.

Therefore I would like to create a RAM disk, for example 512 megabytes and get it mounted at boot time, so I can set the path of the log files to the RAM disk.

I looked into /etc/fstab, but there is a notice that this file is deprecated.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can create and mount a RAM disk with the following Terminal (i.e. shell) command:

diskutil erasevolume HFS+ "diskName" `hdiutil attach -nomount ram://2048`

Where 2048 can be any number and represents the number of 512 byte blocks you want to allocate. So 1,000,000 will get you 512,000,000 bytes. (Of course, you have to leave out the commas.)

So edit the command to your liking and put it in a shell script, then add that shell script to your login items. If you really need to run it at boot instead of when you log in, that is a lot more involved. Either you don't need to do it, because you're not starting Apache etc. before you log in, or you've already done it to get Apache to start before you log in, in which case you can just piggy back on whichever daemon you are starting first.

share|improve this answer

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.