2009年2月5日 星期四

Adding a Swap File on Solaris

This is straight out of the man pages, but I had a hard time finding it the first time that I needed it. If you have a Solaris system that badly needs more swap but you don't have a free swap device available, you can create a file in the file system and add it as additional swap.

  1. Use mkfile to create a file suitable for a local swap area. For example, to create a 1GB swap file:

        /usr/sbin/mkfile 1024m /swap

    where /swap is the name of the file to be used as swap space. Units for the size can be kilobytes (k), blocks (b), or megabytes (m).

  2. Tell the system to start using the file as swap:

        /usr/sbin/swap -a /swap

    Use swap -l to verify that the swap file has been activated. 

    文章摘自http://www.eyrie.org/~eagle/notes/solaris/swap-file.html

沒有留言: