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.
Use
mkfileto create a file suitable for a local swap area. For example, to create a 1GB swap file:/usr/sbin/mkfile 1024m /swap1
where
/swapis the name of the file to be used as swap space. Units for the size can be kilobytes (k), blocks (b), or megabytes (m).Tell the system to start using the file as swap:
/usr/sbin/swap -a /swap1
Use
swap -lto verify that the swap file has been activated.- /swap1 - - swap - no - ## add into /etc/vfstab to ensure activation on boot
No comments:
Post a Comment