Linux Command Directory
This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
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.
Check for bad blocks before creating the swapspace.
Create a label for use with swapon.
Create an old style swap area.
Create a new style swap area. (The default behavior on newer kernels.)