つるながの綴り方

ITインフラ系のネタやTips、趣味としているカーライフなどを中心に日頃メモしておきたいことをしたためています。

swapfileを起動ディスク以外のボリュームに作成する

容量が少なくなってきたため、仮想メモリが作られる場所を、任意のパス(ボリューム)に変更する。
環境:Mac OS X 10.7.3

以下、管理者権限にて

・作業ディレクトリ移動
# cd /System/Library/LaunchDaemons 

・バックアップ
# cp com.apple.dynamic_pager.plist com.apple.dynamic_pager.plist.org

・バイナリから編集可能なXMLファイルに変換
# plutil -convert xml1 com.apple.dynamic_pager.plist 

「com.apple.dynamic_pager.plist 」を編集

・修正前
    <array>
        <string>/sbin/dynamic_pager</string>
        <string>-F</string>
        <string>/private/var/vm/swapfile</string>
    </array>

・修正後
    <array>
        <string>/bin/bash</string>
        <string>-c</string>
        <string>/bin/wait4path /Volumes/ボリューム名/ &amp;&amp; /sbin/dynamic_pager -F /Volumes/..パス.../swapfile</string>
    </array>


最後に、plistをバイナリに戻して再起動

# plutil -convert binary1 com.apple.dynamic_pager.plist 

参考:http://tukaikta.blog135.fc2.com/blog-entry-149.html