tldr/pages/linux/mkswap.md

18 lines
471 B
Markdown
Raw Normal View History

2018-02-12 22:03:12 +00:00
# mkswap
> 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.
> More information: <https://manned.org/mkswap>.
2018-02-12 22:03:12 +00: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:
`sudo mkswap -c {{path/to/file}}`
2018-02-12 22:03:12 +00:00
- Specify a label for the partition (to allow `swapon` to use the label):
2018-02-12 22:03:12 +00:00
`sudo mkswap -L {{label}} {{/dev/sda1}}`