Wednesday, February 24, 2010

Increasing SWAP space in Solaris

Increasing SWAP space is a common task especially when its a requirement to install and run a new application, though its quite trivial, a handy How-to doc is always useful and hence this one.


Assuming that you need to increase swap size in Solaris by 4GB, follow the below procedure.

1. Get the current swap size.

bash-3.00# swap -l

swapfile dev swaplo blocks free

/dev/dsk/c0t2d0s1 31,65 8 16787912 16787912

2. Create a file of size 4G (say swapfile4G)

bash-3.00# mkfile 4g /swapfile4G

bash-3.00#

3. Add the specific file as swap

bash-3.00# swap -a /swapfile4G

bash-3.00#

4. Now the swap -l command should show the new file added as swap


bash-3.00# swap -l

swapfile dev swaplo blocks free

/dev/dsk/c0t2d0s1 31,65 8 16787912 16787912

/swapfile4G - 8 8388600 8388600


Additionally to enable this swap file after system boot, add the following entry in /etc/vfstab.

/swapfile4G - - swap - no -

No comments:

Post a Comment