Difference between revisions of "Manipulating swap space on a running Solaris system"

From Peter Pap's Technowiki
Jump to: navigation, search
(Created page with " == Listing swap files in use == The following command will list all active swap files: swap -l with output looking like this: swapfile dev swaplo blocks ...")
 
(Adding swap space)
Line 28: Line 28:
 
then check it worked with  
 
then check it worked with  
 
      
 
      
   swap -lswapfile              
+
   swap -l
 +
  swapfile              
 
   dev  swaplo blocks  free
 
   dev  swaplo blocks  free
 
   /dev/md/dsk/d10    85,10    16 8389632 8389632
 
   /dev/md/dsk/d10    85,10    16 8389632 8389632

Revision as of 04:23, 26 November 2010

Listing swap files in use

The following command will list all active swap files:

  swap -l

with output looking like this:

  swapfile             dev  swaplo blocks   free
  /dev/md/dsk/d10     85,10     16 8389632 8389632


Adding swap space

So you need more swap temporarily. Here's how:

1. Make a file to add to swap

  mkfile 2g /export/tempfile

This will crate a 2Gb file.

2. Add the file to the swap pool

  swap -a /export/tempfile

then check it worked with

  swap -l
  swapfile             
  dev  swaplo blocks   free
  /dev/md/dsk/d10     85,10     16 8389632 8389632
  /export/tempfile      -       16 6291440 6291440

Delete a swap file

Finished with your temporary swap file. Delete it:

 swap -d /export/tempfile