mkswap Command Examples

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 information: https://manned.org/mkswap.

sudo mkswap {{path/to/file}}

sudo mkswap {{[-c|--check]}} {{path/to/file}}

sudo mkswap {{[-L|--label]}} {{label}} {{/dev/sda1}}