Get the App
SLTechnology News&Howtos  ›  Servers  › 

Activate swap space using the swapon command of linux

Shulou Source: shulou.com Published: 2022-06-02 19:45:31 10月04日 Update

This article takes a look at activating swap space using linux's swapon command. There is a certain reference value, friends in need can refer to, hope to help you.

The swapon command is used to activate the swap space in the Linux system, and the memory management of the Linux system must use the swap area to establish virtual memory.

Syntax format: swapon [parameters]

Common parameters:

-a set all the devices in the / etc/fstab file to swap, start the switch area-h display help-p set the exchange area priority-s display the use of the exchange area

Reference example

Display the version information of the exchange:

[root@linuxcool] # swapon-v / dev/hdb4

Show the usage of the exchange area:

[root@linuxcool] # swapon-s

Set priority:

[root@linuxcool] # swapon-p 3 / dev/hdb4

Automatically start all SWAP devices:

[root@linuxcool] # swapon-a

Display the help documentation for the swap command:

[root@linuxcool] # swapon-h is a brief introduction to activating swap space using linux's swapon command. Of course, you have to use the above differences in detail before you understand it. If you want to know more, welcome to follow the industry information channel!

Tags: Commands activations spaces references help memory parameters situations systems differences abbreviations values priorities information examples that is commonly used files documents articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno MariaDB Xiaomi vpn