mkswap
Set up a Linux swap area on a device or file. toybox
On Linux
Linux
mkswap [-L LABEL] DEVICE
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.
Set up a given swap area
sudo mkswap path/to/fileIdentifyCheck a partition for bad blocks before creating the swap area
sudo mkswap --check path/to/fileIdentifySpecify a label for the partition (to allow swapon to use the label)
sudo mkswap --label label /dev/sdXYIdentifyUse the specified UUID
sudo mkswap --uuid clearIdentifySet up a swap file (for btrfs, see tldr btrfs filesystem instead)
sudo mkswap --size file_size --file path/to/swapfileIdentify