Solaris / OpenSolaris Add Swap File

by on May 24, 2009 · 0 comments· LAST UPDATED May 24, 2010

in

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.

References:

  • See man pages swap, and mkfile commands.
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , , ,

Previous Faq:

Next Faq: