ChorusOS 5.0 System Administrator's Guide

Activating a Swap Partition

This section explains how to activate a swap partition on a local disk that has already been labelled. The ChorusOS 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, label the partition as a swap partition using disklabel. See "Using disklabel to Label a Disk". After the partition is labelled, mount a swap directory using the mount command. Finally, 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 ls swap_dir
    /swap_dir: No such file or directory
    $ rsh target mkdir swap_dir
    
  2. Make sure the partition you intend to use for swap has been correctly labelled using disklabel. See "Using disklabel to Label a Disk".

    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
    

A detailed example of creating a swap partition is also provided in "Creating and Activating a Swap Partition".