LinuxCommandLibrary

swapoff

Disable swap devices and files

TLDR

Disable a swap area

$ sudo swapoff /path/to/swapfile
copy
Disable all swap areas
$ sudo swapoff -a
copy
Disable swap by label
$ sudo swapoff -L swap_label
copy
Disable swap by UUID
$ sudo swapoff -U uuid
copy

SYNOPSIS

swapoff [-va] [specialfile...]

DESCRIPTION

swapoff disables swapping on the specified devices and files. When swapoff is called, all pages that are swapped to the specified areas are swapped back into RAM before the swap area is disabled.

PARAMETERS

-a, --all

Disable all swap areas listed in /proc/swaps
-L label
Disable swap partition with the specified label
-U uuid
Disable swap partition with the specified UUID
-v, --verbose
Enable verbose output
-h, --help
Display help text and exit
-V, --version
Display version information and exit

CAVEATS

Disabling swap requires enough RAM to hold all swapped-out pages. If there is insufficient RAM, swapoff will fail. This can take significant time on heavily used swap areas.

HISTORY

swapoff is part of the util-linux package. It is the counterpart to swapon for disabling swap space.

SEE ALSO

swapon(8), mkswap(8), free(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community