Should I symlink my /private/var/vm dir to another volume in OS X Lion?

4

1

So I just installed an SSD in my MBP and have been a bit concerned about running out of disk space. I noticed that /private/var/vm holds an 8.6 gb sleepimage file as well as swap files. I'd be much happier if they existed on my old (regular) HDD which is also still inside my machine as well.

I can't think of anything that would really go wrong with this, but can someone tell me whether or not I'll totally screw up my computer by symlinking /private/var/vm -> /Volumes/OldDrive/private/var/vm?

I read in this superuser post that if the target disk isn't mounted at the time that the swap files are being created, then it could "fake it" (so to speak) and create a directory "/Volumes/OldDrive", forcing my actual drive to be mounted at "/Volumes/OldDrive 1".

steve

Posted 2011-09-20T06:46:06.240

Reputation: 141

Answers

0

It looks like an app called Xupport from Applicorn should set this up in the correct way (trusting the developer to have worked this out - you could always ask them): http://www.applicorn.com/xupport/help/Manuals/English/pgs/optimization.html . However, the rest of their site, including the download, appears to be down now. You'd also want to check it'll work for Lion, though it seems unlikely the swap setup would have changed much.

PS: Your SSD will last longer if you move swap off it too.

tog22

Posted 2011-09-20T06:46:06.240

Reputation: 725

Intriguing... Though the site being down (still) is not particularly reassuring. – steve – 2011-12-05T22:41:26.443

Yeah.. if you ever do work it out, or want to discuss the swap issue, let me know via my (still standing) question http://superuser.com/questions/364204/safe-to-use-ssd-to-boot-oses-mainly-os-x-which-has-trim-issues

– tog22 – 2011-12-06T12:04:16.733

0

Multiple aspects to this one question …

A separate volume for external page files

You should not prefer a symbolic link.

… whether or not I'll totally screw up my computer …

Not totally, but if dynamic_pager can not write when required to your chosen volume, then sooner or later the operating system will almost certainly misbehave in ways that will be disruptive to your use of the Mac.

Instead of an unmanaged symbolic link with the risk of misbehaviour:

  • prefer to manage the behaviour of dynamic_pager

Links

dynamic_pager_wrapper source from dynamicpagerwrapper – performance wrapper for /sbin/dynamic_pager on OSX

In Ask Different: How can I move virtual memory swap files to a different drive or partition? (2010-09-12) – that's a more recent version (from the same person) of the question that's linked from your opening post.

A separate volume for sleepimage

Aim to not use the same separate volume that you use for external page files.

Manageability

Whilst there are accepted approaches to managing the behaviour of dynamic_pager (wait for a path), the timing of creation of sleepimage may be less easy to manage.

Impact

If force is applied to a restart or shut down, or if the kernel panics, and if then sleepimage is not written to your chosen volume, and if that volume was also intended for external swap files:

  • misbehaviour of the operating system may be not immediately easy to predict or detect
  • cleaning up may be unexpectedly time consuming.

Graham Perrin

Posted 2011-09-20T06:46:06.240

Reputation: 1 147

so considering I have exactly 2 physical volumes, (1 ssd, 1 old spinning rust), what exactly would you recommend WRT sleepimage & paging? Just leave everything on the new SSD? Or perhaps I should symlink my home dir to the old drive and leave? – steve – 2013-05-03T23:27:27.783

You might benefit from a separate volume for external swap files, but I should not prefer to use a symbolic link. Prefer the approach given in the linked question. – Graham Perrin – 2013-05-04T08:34:10.020

0

sleepimage can be referenced at an alternate location. I put a 2nd SSD in and changed pmset, and now sleepimage is going up to 6G SSD instead of factory 3G. It's a little quicker. :)

sudo pmset -a hibernatefile /Volumes/HD2/var/vm/sleepimage

pmset -g | grep "hibernatefile"
hibernatefile        /Volumes/HD2/var/vm/sleepimage

Working like a charm on 10.10.3

The AlieN

Posted 2011-09-20T06:46:06.240

Reputation: 1