2018-02-12 22:03:12 +00:00
|
|
|
# mkswap
|
|
|
|
|
2023-08-19 05:06:31 +01:00
|
|
|
> Set up a Linux swap area on a device or in a file.
|
|
|
|
> Note: `path/to/file` can either point to a regular file or a swap partition.
|
2021-08-16 11:34:01 +01:00
|
|
|
> More information: <https://manned.org/mkswap>.
|
2018-02-12 22:03:12 +00:00
|
|
|
|
2023-08-19 05:06:31 +01:00
|
|
|
- Set up a given swap area:
|
2018-02-12 22:03:12 +00:00
|
|
|
|
|
|
|
`sudo mkswap {{path/to/file}}`
|
|
|
|
|
|
|
|
- Check a partition for bad blocks before creating the swap area:
|
|
|
|
|
2023-08-19 05:06:31 +01:00
|
|
|
`sudo mkswap -c {{path/to/file}}`
|
2018-02-12 22:03:12 +00:00
|
|
|
|
2023-08-19 05:06:31 +01:00
|
|
|
- Specify a label for the partition (to allow `swapon` to use the label):
|
2018-02-12 22:03:12 +00:00
|
|
|
|
2023-08-19 05:06:31 +01:00
|
|
|
`sudo mkswap -L {{label}} {{/dev/sda1}}`
|