swapoff Command

Purpose

Deactivates one or more paging spaces.

Syntax

swapoff DeviceName { DeviceName ...}

Description

The swapoff command deactivates one or more paging spaces. The paging spaces are specified by DeviceName.
Note: There is a paging space limit of 64 GB per device.

To be deactivated:

  • The paging space must have been previously activated through the swapon command.
  • There must exist enough space in the remaining paging spaces. The remaining paging device should have enough space to accommodate the current system-wide paging space usage and the npswarn value.
Note: This command is not supported when executed within a workload partition.

Exit Status

Item Description
Value Description
0 Deactivation is successful, the paging state is set to the INACTIVE state.
1 The following message displays:
swapoff: Cannot deactivate paging space DeviceName
2 There is not enough space in the remaining paging spaces, the deactivation is not done and the following message displays:
"swapoff: Cannot deactivate paging space DeviceName :
There is not enough space in the file system."
3 An I/O error occurred on user pages of a paging space, the following message displays:
swapoff: Deactivation of paging space  DeviceName suspended:
I/O errors encountered on user backing pages.

The recommended action is:

  • Check the error log.
  • Deactivate the paging space for the next reboot using the chps command.
  • Reboot the system.
4 An I/O error occurred on system pages of a paging space, the following message displays:
swapoff: Deactivation of paging space DeviceName suspended:
I/O errors encountered on system backing pages.  The system may crash.

The recommended action is:

  • Check the error log.
  • Deactivate the paging space for the next reboot using the chps command.
  • Reboot the system.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.