2018-02-15 01:30:27 +05:30
|
|
|
# swapon
|
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
> Enable devices and files for swapping.
|
|
|
|
> Note: `path/to/file` can either point to a regular file or a swap partition.
|
2025-03-28 16:06:49 +02:00
|
|
|
> More information: <https://manned.org/swapon.8>.
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
- Show swap information:
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
`swapon`
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
- Enable a given swap area:
|
2018-02-15 01:30:27 +05:30
|
|
|
|
|
|
|
`swapon {{path/to/file}}`
|
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
- Enable all swap areas specified in `/etc/fstab` except those with the `noauto` option:
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2025-03-28 16:06:49 +02:00
|
|
|
`swapon {{[-a|--all]}}`
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
- Enable a swap partition by its label:
|
2018-02-15 01:30:27 +05:30
|
|
|
|
2023-08-19 06:06:31 +02:00
|
|
|
`swapon -L {{label}}`
|