addswap.sh                                               ver :0.2

Swaps are normally run off partitions. However, there are certain
situations,  where, there may be a requirement of  adding swap to
a running linux box, to avert an out of swap space situation. The
situation where this comes handy is:

o UMSDOS installs where you are running the whole system  from an
  UMSDOS (viz DOS/ Windows partition without re-partitioning)

o Low memory computers (32 mb or less) where situation has arisen
  when more swap space is needed than that was originally catered
  for.
  
The method for creating a swap file is written  within the script
itself, and no further explanation is necessary.

Type in: addswap.sh howto

There are only two things that you need to take care of:

1. DO NOT forget to edit the script and insert the exact location
   of the swap file created by you on top of the program.
   
2. In case you enable the swap file through fstab then ensure the
   following:
   
   a) The partition holding the swap file is placed  ahead of the
      /path/swapfile command within /etc/fstab.
      
   b) Ensure that in your shutdown scripts, swapoff for this swap
      file is done BEFORE the partition  holding the swap file is
      unmounted.

Usage: addswap.sh  [option] 

The [option] could be:

start OR on   ... both synonymous, to enable swap file
stop  OR off  ... to disable the swap file
restart       ... this is merely a stop followed by on. Used for
                  testing purposes.
howto         ... HOW-TO create a swap file

NOTE : This program runs as "root" only (even su will not work).
Since starting and stopping  devices like swap is purely a  root
function, user modes have been disabled.

USM Bish <bish@nde.vsnl.net.in>
URL: http://personal.vsnl.com/bish/
