OS Manuals

/usr/bin/mkswap

Misc binaries for util-linux

From util-linux-misc 2.42.4-r2 (os), captured 2026-11-05 by running mkswap --help (exit 0). permalink

Usage:
 mkswap [options] device [size]

Set up a Linux swap area.

Options:
 -c, --check               check bad blocks before creating the swap area
 -f, --force               allow swap size area be larger than device
 -q, --quiet               suppress output and warning messages
 -p, --pagesize SIZE       specify page size in bytes
 -L, --label LABEL         specify label
 -v, --swapversion NUM     specify swap-space version number
 -U, --uuid UUID           specify the uuid to use
 -e, --endianness=<value>  specify the endianness to use (native, little or big)
 -o, --offset OFFSET       specify the offset in the device
 -s, --size SIZE           specify the size of a swap file in bytes
 -F, --file                create a swap file
     --verbose             verbose output
     --lock[=<mode>]       use exclusive device lock (yes, no or nonblock)
 -h, --help                display this help
 -V, --version             display version

For more details see mkswap(8).
Options (15)
OptionDescriptionSource
-c, --checkCheck the device (if it is a block device) for bad blocks before creating the swap area.help + man
-f, --forceallow swap size area be larger than devicehelp + man
-q, --quietSuppress output and warning messages.help + man
-p, --pagesize SIZESpecify the page size (in bytes) to use.help + man
-L, --label LABELSpecify a label for the device, to allow swapon(8) by label.help + man
-v, --swapversion NUMspecify swap-space version numberhelp + man
-U, --uuid UUIDSpecify the UUID to use.help + man
-e, --endianness valueSpecify the ENDIANNESS to use, valid arguments are native, little or big.help + man
-o, --offset OFFSETSpecify the offset to write the swap area to.help + man
-s, --size SIZESpecify the size of the created swap file in bytes and may be followed by a multiplicative suffix: KiB (=1024), MiB (=10241024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional,…help + man
-F, --fileCreate a swap file with the appropriate file permissions and populated blocks on disk.help + man
--verboseVerbose execution.help + man
--lock modeUse an exclusive BSD lock for the device or file that is operated upon.help + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.