Linux命令:swapon

激活Linux系统中交换空间

2024-12-31 17:38:39

命令行command

补充说明

swapon命令 用于激活Linux系统中交换空间,Linux系统的内存管理必须使用交换区来建立虚拟内存。

语法

swapon(选项)(参数)

选项

-a:将/etc/fstab文件中所有设置为swap的设备,启动为交换区;
-h:显示帮助;
-p<优先顺序>:指定交换区的优先顺序;
-s:显示交换区的使用状况;
-V:显示版本信息。

参数

交换空间:指定需要激活的交换空间,可以是交换文件和交换分区,如果是交换分区则指定交换分区对应的设备文件。

实例

mkswap -c /dev/hdb4 (-c是检查有无坏块)
swapon -v /dev/hdb4
swapon -s
Filename                                type            Size    Used    Priority
/dev/hda5                               partition       506008 96      -1
/dev/hdb4                               partition       489972 0       -2

评论

静谧以待,您的评论将是点睛之笔

撰写首个评论,启程你的前端奇妙之旅

is a Wiki for programming enthusiasts and professionals, organizing knowledge on programming.

Connect With Me

I have a fair amount of knowledge of Javascript, Typescript, VueJs, and Nuxt. If you have an interesting idea, either open source or paid let's connect.

Sent Mail
© 2024-2025 © . All rights reserved.