
参考链接:http://superuser.com/questions/28414/moving-the-swapfiles-to-a-dedicated-partition-in-snow-leopard
这里注意的是,新的swap文件的路径必须存在。
$ 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/ &&/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
重启就可以了。




近期评论