Add Swap Space Temporarily in Solaris

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: Solaris system administration  

Sometimes swap space is inadequate, but no free disk slices are available. Until a permanent solution is available, a file can be constructed and added to the swap space.


To make a 250MB addition to swap space using the /var filesystem, run as root:

mkfile 250m /var/newswap
swap -a /var/newswap

The mkfile command makes a file of a specified size. The swap -a command adds the file to the swap space. If you have a free slice, such as /dev/dsk/c0t0d0s5, you can add that to the swap space temporarily with the following command:

swap -a /dev/dsk/c0t0d0s5

These changes are temporary because they will not persist after the system reboots. To make the preceeding two example swap space additions persist after a reboot, place the following lines in the /etc/vfstab file (Be very careful making changes to this file.):

/var/newswap - - swap - no -
/dev/dsk/c0t0d0s5 - - swap - no -

 

8 Comments -


  1. Rav said on December 8, 2008

    thanks ! it saved me while working on soalris box

  2. Anonymous said on August 6, 2009

    Excellent. Thanks that worked.

  3. giis said on March 11, 2010

    thanks

  4. Rajpcr said on July 2, 2010

    thanks,
    good explanation about swap creation..

  5. Badsha Alamgir said on December 22, 2010

    Thanks a lot for this nice post.

  6. Gauravgulati22 said on January 4, 2011

    goood

  7. Lseabela said on July 13, 2011

    My man ……nearly got fired ….easy just ..!! nice!!

  8. Mike said on December 16, 2011

    Thank you! Was working on the cut-over from heck, this helped greatly.

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -