mkswap
linux
Set up a Linux swap area on a device or in a file. Note: `path/to/file` can either point to a regular file or a swap partition.
More info →Options (5)
-c, --checkbooleanCheck a partition for bad blocks before creating the swap area
Example:
sudo mkswap {{[-c|--check]}} {{path/to/file}}-L, --labelbooleanSpecify a label for the partition (to allow `swapon` to use the label)
Example:
sudo mkswap {{[-L|--label]}} {{label}} {{/dev/sdXY}}-U, --uuidbooleanUse the specified UUID
Example:
sudo mkswap {{[-U|--uuid]}} {{clear|random|time|UUID_value}}-s, --sizebooleanSet up a swap file (for btrfs, see `tldr btrfs filesystem` instead)
Example:
sudo mkswap {{[-s|--size]}} {{file_size}} {{[-F|--file]}} {{path/to/swapfile}}-F, --filebooleanSet up a swap file (for btrfs, see `tldr btrfs filesystem` instead)
Example:
sudo mkswap {{[-s|--size]}} {{file_size}} {{[-F|--file]}} {{path/to/swapfile}}Examples (5)
Specify a label for the partition (to allow `swapon` to use the label)
made by @shridhargupta | data from tldr-pages