Name

mkswap

Synopsis

mkswap [options] device

System administration command. Prepare swapspace on device: a disk partition or a prepared file. This command can create old and new style swap areas. The older style provides backward compatibility with 2.2 kernels, but is less efficient and more limited in size. The mkswap command has some dangerous options we have omitted here. They provide backward compatibility and solutions to problems with older libraries, but can destroy a disk if specified incorrectly.

Options

-c

Check for bad blocks before creating the swapspace.

-L label

Create a label for use with swapon.

-v0

Create an old style swap area.

-v1

Create a new style swap area. (The default behavior on newer kernels.)

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.