参考链接:http://superuser.com/questions/28414/moving-the-swapfiles-to-a-dedicated-partition-in-snow-leopard

这里注意的是,新的swap文件的路径必须存在。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# backup the file
$ cd /System/Library/LaunchDaemons
$ sudo cp com.apple.dynamic_pager.plist{,_bak}

# convert the file to xml
$ sudo plutil -convert xml1 com.apple.dynamic_pager.plist

# modify the file
$ sudo vim com.apple.dynamic_pager.plist

<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>/bin/wait4path /Volumes/Swap/ &amp;&amp;
/sbin/dynamic_pager -F /Volumes/Swap/.vm/swapfile</string>
</array> # replace /Volumes/Swap/.vm/swapfile as your path

# convert the file to binary
$ sudo plutil -convert binary1 com.apple.dynamic_pager.plist

重启就可以了。

知识共享授权条款
本著作Chen, Zai-Chun制作,以知识共享 姓名标示-相同方式分享 4.0 国际 授权条款释出

留言

Jun 29 2011