MKSWAP(8)

NAME
mkfs - set up a Linux swap device

SYNOPSIS
/etc/mkswap [ -c ] device size-in-blocks

DESCRIPTION
mkswap sets up a Linux swap area on a device (usually a disk partition). The device is usually of the following form:
    /dev/hda[1-8]
    /dev/hdb[1-8]
    /dev/sda[1-8]
    /dev/sdb[1-8]
The size-in-blocks parameter is the desired size of the file system, in blocks. This information can be determined from the fdisk(8) program. Only block counts strictly greater than 9 and strictly less than 65537 are allowed. However, the current kernel only used the first 16MB of a swap area (this will change at some time in the future). mkswap can also set up swap files, although the file has to be created first. A sequence of commands similar to the following is reasonable for this purpose:
    # dd if=/dev/zero of=swapfile bs=1024 count=8192
    # /etc/mkswap swapfile 8192
    # sync
    # /etc/swapon swapfile
Note that the regular file has to be created before running mkswap on the file, and that the file must not contain any holes (so, using cp(1) to create the file is not acceptable).

OPTIONS

-c  Check the device for bad blocks before creating the file system. If any are found, the count is printed. This option is meant to be used for swap partitions only, and should not be used for regular files! To make sure that regular files do not contain bad blocks, the partition that contains the regular file should have been created with mkfs -c.

SEE ALSO
fsck(8), mkfs(8), fdisk(8)

AUTHOR
Linus Torvalds (torvalds@cs.helsinki.fi)