Wednesday, January 17, 2007

Dev : Swap for Solaris

How do we add extra swap space in Solaris version 5.x? For the ease of most users, follow the steps as below...

1. Log in console as root.
2. In console, type root: /usr > df -k to see the available space and the available swap by typing root: /usr > swap -l in console.
3. Locate a suitable location, create a file for swapping. Eg, to create an empty 1 Gb file call swapfile: root: /usr > mkfile 1g swapfile
4. Add the swapfile to the swap. Eg: root: /usr > swap -a /usr/swapfile (must use absolute path)
5. Edit the /etc/vfstab, add in a new line call /usr/swapfile - - swap - no - to enable the swap file at the next boot.
6. Check your swap again by by typing root: /usr > swap -l in console. You will find that there is a new swap available and you are ready to use it. :)

No comments: