ChorusOS 4.0 File System Administration Guide

5.2 How to Activate a Swap Partition

This section explains how to activate a swap partition on a local disk that has already been labelled. The ChorusOS 4.0 product supports a single swap partition on a local disk, unlike earlier releases that supported swap over NFS.

In order to use a swap partition on a ChorusOS system, you must first label the partition as a swap partition using disklabel. After the partition is labelled, you mount a swap directory using the mount command. Finally, you activate the swap partition using the swapon command.


Note -

Swap cannot be deactivated.


After you have performed the procedure once, you can mount and activate the swap partition during system intilization by including the necessary commands in the sysadm.ini file that you build into the system image.

Preparing and Activating a Swap Partition
  1. Make a directory on the target to use as the mount point for the swap partition unless you have already done so:


    $ rsh target arun /bin/ls swap_dir
    started aid = 22
    /swap_dir: No such file or directory
    $ rsh target arun /bin/mkdir swap_dir
    
  2. Make sure the partition you intend to use for swap has been correctly labelled using disklabel.

    The partition you intend to use for swap should be labelled as type swap.

  3. Mount the swap directory:


    $ rsh target mount -t swap block_special_file swap_dir
    

    Where block_special_file represents the partition you labelled as type swap.

  4. Activate the swap partition using the swapon(1M) command:


    $ rsh target swapon swap_dir