Mac OS X + SSD tweaks

Came across a pretty cool howto to tweak your SSD on a Mac. Only thing I noticed is setting the hibernate mode to 0 made my mac randomly wake up a few seconds after it went to sleep (and happened most often when closing the lid, less often when clicking the sleep button; randomly closing apps seemed to sometimes fix this problem; usually closing Skype and VLC solved this…) Set it the hibernate mode 7 now (which was the default I think)

yeri$ sudo pmset -g | grep hibernatemode
hibernatemode	7
yeri$ mount
/dev/disk0s2 on / (hfs, local, journaled, noatime)
...
/dev/disk2     256Mi  6.0Mi  250Mi     3%    /private/tmp

I did indeed, as noted in the above howto/blog post, that shutting down is slower. Not that much, just a bit. As I usually don’t shut down, I guess this isn’t much of a problem. However, this additional mount point creates a disk on my desktop (or in finder), which is annoying.

However, this seems fixable with

/Developer/Tools/SetFile -a V /private/tmp/

But, this option seems forgotten after a reboot and has to be started over. Crappy.

So, tried with AppleScript then, created a new script with following content:

quit application "Finder"
tell application "System Events" to ¬
set visible of disk "Volatile HD" to false
delay 0.1
launch application "Finder"

And saved it as “File Format: Application” and “Options: Run Only”. The delay line is needed, as without it, finder doesn’t seem to start/reopen its folders/show desktop icons until  you click its icon again in the Dock. You can change the delay to 1, but that was a bit slow for me; tried a delay of 0.0001 too, but that gave the same issue as not putting in a delay line in at all.

You can just download the script/application here.

Drag the application to the Application folder, and add a start up item for it (System Preferences -> Accounts -> YOU -> Login Items; click the +-button and browse till you find your application). Should do the trick.

I also changed the ramfs disk size to 128Mb instead of 256Mb, as 256Mb seemed a lot for a disk that was using ~10Mb.

3 comments

  1. […] received a question about creating a RAMFS for Mac OS X’ /tmp folder, so I’ll post my reply here as […]

  2. thot says:

    About:

    “/Developer/Tools/SetFile -a V /private/tmp/”
    But, this option seems forgotten after a reboot and has to be started over. Crappy.

    –> you can fix that definitvely by changing ramfs.sh by adding “-o nobrowse ” in the mount line:

    mount -o noatime -t hfs ${ramdisk_dev} ${mount_point}
    becomes:
    mount -o noatime -o nobrowse -t hfs ${ramdisk_dev} ${mount_point}

    bash-3.2# mount |grep tmp
    /dev/disk1 on /private/tmp (hfs, local, noatime, nobrowse)

  3. thot says:

    About the size of RAMFS, you can set 2Gb easily.
    Indeed, the RAM won’t be allocated while you don’t fill /private/tmp

Leave a Reply...