41
34
will use the entire partition or file if it is omitted.
42
35
Specifying it is unwise -- a typo may destroy your disk.)
46
parameter specifies the page size to use. It is almost always
47
unnecessary (even unwise) to specify it, but certain old libc
48
versions lie about the page size, so it is possible that
50
gets it wrong. The symptom is that a subsequent
52
fails because no swap signature is found. Typical values for
56
37
After creating the swap area, you need the
58
39
command to start using it. Usually swap areas are listed in
66
47
can be there, but it is not a recommended setup. The recommended setup is to
67
48
use a separate partition for a Linux swap area.
69
.B mkswap, like many others mkfs-like utils, erases the first block to remove
70
.B old on-disk filesystems.
51
like many others mkfs-like utils,
52
.B erases the first partition block to make any previous filesystem invisible.
73
56
refuses to erase the first block on a device with a disk
74
label (SUN, BSD, ...) or on a whole disk (e.g. /dev/sda).
57
label (SUN, BSD, ...) and on a whole disk (e.g. /dev/sda).
61
.BR \-c , " \-\-check"
79
62
Check the device (if it is a block device) for bad blocks
80
63
before creating the swap area.
81
If any are found, the count is printed.
64
If any bad blocks are found, the count is printed.
84
Force -- go ahead even if the command is stupid.
66
.BR \-f , " \-\-force"
67
Go ahead even if the command is stupid.
85
68
This allows the creation of a swap area larger than the file
86
69
or partition it resides on.
71
Also, without this option,
90
will refuse to erase the first block on a device with a partition table or on
73
will refuse to erase the first block on a device with a partition table and on
91
74
a whole disk (e.g. /dev/sda).
94
Specify a label, to allow
76
.BR \-L , " \-\-label " \fIlabel\fR
77
Specify a \fIlabel\fR for the device, to allow
99
Specify the page size (in bytes) to use. This option is usually unnecessary,
81
.BR \-p , " \-\-pagesize " \fIsize\fR
82
Specify the page \fIsize\fR (in bytes) to use. This option is usually unnecessary;
101
84
reads the size from the kernel.
104
Specify the uuid to use. The default is to generate a UUID.
107
Specify the swap-space version. The old \-v0 option has become obsolete
108
and now only \-v1 is supported.
110
The kernel has not supported v0 swap-space format since 2.5.22.
111
The new version v1 is supported since 2.1.117.
86
.BR \-U , " \-\-uuid " \fIUUID\fR
87
Specify the \fIUUID\fR to use. The default is to generate a UUID.
89
.BR \-v , " \-\-swapversion 1"
90
Specify the swap-space version. (This option is currently pointless, as the old
92
option has become obsolete and now only
95
The kernel has not supported v0 swap-space format since 2.5.22 (June 2002).
96
The new version v1 is supported since 2.1.117 (August 1998).)
99
Display help text and exit.
101
.BR \-V , " \-\-version"
102
Display version information and exit.
114
105
The maximum useful size of a swap area depends on the architecture and
115
106
the kernel version.
116
107
It is roughly 2GiB on i386, PPC, m68k and ARM, 1GiB on sparc, 512MiB on mips,
117
128GiB on alpha, and 3TiB on sparc64. For kernels after 2.3.3 there is no
108
128GiB on alpha, and 3TiB on sparc64. For kernels after 2.3.3 (May 1999) there is no
120
111
Note that before version 2.1.117 the kernel allocated one byte for each page,
121
112
while it now allocates two bytes, so that taking into use a swap area of 2 GiB
122
113
might require 2 MiB of kernel memory.
124
Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10).
115
Presently, Linux allows 32 swap areas (this was 8 before Linux 2.4.10 (Sep 2001)).
125
116
The areas in use can be seen in the file
118
(since 2.1.25 (Sep 1997)).
130
121
refuses areas smaller than 10 pages.