SWAPON(8) SWAPON(8) swapon, swapoff - swapon [] [-...] swapoff [-va] [-...] swapon , '. -. -L -U uuid UUID. swapon, , , ' , ' . swapoff ' . -a, ' ' ( /proc/swaps /etc/fstab). -a, --all All devices marked as "swap" in /etc/fstab are made available, except for those with the "noauto" option. Devices that are already being used as swap are silently skipped. See the FSTAB CONFIGURATION section for more details. -T, --fstab fstab mount(8). , strverscmp(3); , <<.>> .fstab, . . , , initramfs chroot, . -d, --discard[=] ' , '. SSD, . ' : --discard=once ' swapon; --discard=pages ' , . , . /etc/fstab discard, discard=once discard=pages. -e, --ifexists , . , , nofail /etc/fstab. -f, --fixpgsz ( mkswap) ', . mkswap(8) . -L , . ( /proc/partitions.) -o, --options ' fstab . : swapon -o pri=1,discard=pages,nofail /dev/sda2 , . -p, --priority '. -1 32767. . . swapon(2), ' . pri= /etc/fstab, swapon -a. , Linux ' . -s, --summary ' . cat /proc/swaps. , --show, . --show[=...] ' . . --help, . --output-all . --annotate[=when] Adds an annotation to each column header name. Such an annotation can be shown as a tooltip by terminals that support this feature. The optional when argument can be always, never, or auto. If the argument is omitted, it defaults to auto, which means that annotations will only be used when the output goes to a terminal. --noheadings --show. --raw --show . --bytes ( ') --show . -U uuid , uuid. -v, --verbose . -h, --help . -V, --version . FSTAB CONFIGURATION The command swapon --all reads configuration from /etc/fstab (or from a file specified by the --fstab command line option). Only fstab entries with the filesystem type (3rd field) set to "swap" are relevant. The option --options accepts values in the same form as can be specified in the fourth field in fstab. The first field (source) Specify the swap source. If the source is a regular file, it is addressed by an absolute path. If the swap is a block device, it can be addressed by device path, swap area tags LABEL= or UUID= (see mkswap(8) for more details), or by partition tags like PARTLABEL= or PARTUUID=. The second field (target) Unused by swapon, the recommended convention is to use "none". The third field (type) Requires "swap" as the filesystem type. The fourth field (options) It is formatted as a comma-separated list of options. All unknown options are silently ignored. If options are unnecessary, the recommended convention is to use "defaults". The options specified in fstab extend or overwrite settings specified on the swapon command line. Supported swap options: noauto Ignore entry when swapon --all is given. nofail , . discard[=policy] Enable swap discard. The supported settings are discard, discard=once, or discard=pages. For more details, see the --discard command line option. pri=priority Specify the priority of the swap device. For more details, see the --priority command line option. The fifth field Unused by swapon, the recommended convention is to keep it empty. The sixth field Unused by swapon, the recommended convention is to keep it empty. swapoff , 2.36: 0 2 ', ' (OOM) 4 B(2) 8 ' swapoff(2) ( '...) 16 32 swapoff --all 64 swapoff --all swapoff --all 0 ( ), 32 ( ) 64 ( , ). + 2.36 , 0 <<>> . LIBMOUNT_DEBUG=all libmount. LIBBLKID_DEBUG=all libblkid. /dev/sd?? /etc/fstab ASCII ' , . , Btrfs. like cp(1) truncate(1) . swapon. , fallocate(1), , . ' XFS , Linux 4.18. ' dd(1) /dev/zero. Btrfs ' Btrfs , Linux 5.0 nocow. . btrfs(5), . Since version 2.41, the command mkswap --file can create a new swap file with the nocow attribute. NFS ' NFS . swapon ' (, S1SUSPEND, S2SUSPEND, ...). , , . swapon ' 4.0BSD. swapoff(2), swapon(2), fstab(5), init(8), fallocate(1), mkswap(8), mount(8), rc(8) swapon util-linux, Linux . util-linux 2.42 2026-04-01 SWAPON(8)