This section explains how to activate a swap partition on a local disk that has already been labelled. The C5 2.1 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 C5 system, label the partition as a swap partition using disklabel. See Section 5.2.2, “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.
Procedure 6.8. Preparing and Activating a Swap Partition
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 |
Make sure the partition you intend to use for swap has been correctly labelled using disklabel. See Section 5.2.2, “Using disklabel to Label a Disk”.
The partition you intend to use for swap should be labelled as type swap.
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.
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 Section 8.4, “Creating and Activating a Swap Partition”.