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 have a script set up to create a RAM Disk at login. But I have now noticed that the RAM Disk (And sometimes other networked disks) get unmounted when I put the laptop to sleep and wake it up again.

Is there any way to stop this?

Mac OS X Snow Leopard 10.6.7 8GB RAM 128GB SSD 2010 13" MacBook Pro

Edit: This may be a known issue with Apple, but it is unknown if it was ever filed with them and if they ever plan on fixing it: http://openradar.appspot.com/8426423

I was using the RAM Disk as a temporary cache for my browsers, whom tend to use upwards of 500MB of space after a few days since cache on an SSD is mostly useless and doesn't boost the speed at all. It just ends up being writes and reads wearing on the SSD that don't need to be. So I wrote a script to create the SSD and required folders and placed symlinks in my Cache folder for my browsers.

It works 100% perfectly until I put the machine to sleep. Then when it wakes up the disk disappears, but somehow the browsers continue working without problems, but there is no indication that they are still writing to RAM or the SSD because no files seem to appear where they should be. If I recreate the RAM Disk, it is blank of course, but Chrome/Firefox/Safari won't start using it until I restart them.

So alternatively, is there a way to run a shell script after the computer wakes up? Maybe I could just recreate the RAM Disk when it wakes up again and hope for the best.

Or maybe I should just scrap the whole thing.

share|improve this question
    
It's not a SandForce-based SSD by any chance is it? –  boehj Jun 24 '11 at 13:54
    
I don't think so. It's a Kingston SSD Now V 128GB. (I don't think it's the + series) –  Jason Anderson Jun 24 '11 at 17:34
    
@boehj - any particular reason you ask? –  cftarnas Sep 16 '11 at 5:29
add comment

3 Answers

I've similar workflows around a ramdisk so I notice the same issue. I check and re-check the Energy preferences to no avail, so I started messing with the hibernatemode in pmset.

Its default is 3 in Snow Leopard & Lion, and it's not a problem until Lion. Now I've change it to 0. The difference is that no system image is written on disk, so that while sleeping, if my MBP ran out of juice, all will be gone but this drawback is negated by Lion's Resume feature.

Now, it seems my ramdisk stays around during/after sleep... See if you notice similar.

share|improve this answer
add comment

I just came across this. It has one section about sleepwatcher which seem to solve your problem.

Hope it helps

share|improve this answer
add comment

Try looking in the Energy Saver pref pane in System Preferences,

A bad solution would to never put your computer to sleep, only your display.

A good solution (don't know if it would work) would be to uncheck "Put the hard disk(s) to sleep when possible"

share|improve this answer
    
I already keep the Hard Disk sleep option off since I have an SSD. I can't tell if it's unmounting at sleep, or after wake because it disappears about a second after the display turns back on. –  Jason Anderson Jun 24 '11 at 17:26
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.