Disable devices and files for paging and swapping
The swapoff command is used to disable specified swap spaces (including swap files and swap partitions). swapoff is actually a symbolic link to swapon, used to turn off the system's swap areas.
swapoff (options) (parameters)
-a: Disable all swap spaces specified in the configuration file "/etc/fstab".
Swap space: Specify the swap space to be deactivated, which can be a swap file or a swap partition. If it is a swap partition, specify the device file corresponding to the partition.
Disable a swap partition:
swapoff /dev/sda2