LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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

INSTALL

sudo apt install mount
copy
sudo apk add util-linux-misc
copy
nix profile install nixpkgs#mount
copy

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)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid