Thursday, May 3, 2012

Solaris / OpenSolaris Add Swap File

How do I add swap space under Solaris / OpenSolais UNIX operating systems?

You can add the swap space as follows under Solaris UNIX operating systems.

Create A Swap File

Type the following command to create a file using mkfile (1024 Meg swap file):
# mkfile 1024m /disk2/swapfile

Enable Swap Space

To enable it type the following command:
# swap -a /disk2/swapfile
Finally, check your new swap space, enter:
# swap -l

Enable Swap Space File On Boot

Add the following line to /etc/vfstab file:
# vi /etc/vfstab
Append the following entry:
/disk2/swapfile   -   -   swap   -   no   -
Close and save the file.

No comments:

Post a Comment