mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-09 15:34:05 +08:00
23 lines
1.3 KiB
HTML
23 lines
1.3 KiB
HTML
<h1 id="swapon">swapon</h1>
|
||
<p>激活Linux系统中交换空间</p>
|
||
<h2 id="补充说明">补充说明</h2>
|
||
<p><strong>swapon命令</strong> 用于激活Linux系统中交换空间,Linux系统的内存管理必须使用交换区来建立虚拟内存。</p>
|
||
<h3 id="语法">语法</h3>
|
||
<pre><code class="language-bash">swapon(选项)(参数)</code></pre>
|
||
<h3 id="选项">选项</h3>
|
||
<pre><code class="language-bash">-a:将/etc/fstab文件中所有设置为swap的设备,启动为交换区;
|
||
-h:显示帮助;
|
||
-p<优先顺序>:指定交换区的优先顺序;
|
||
-s:显示交换区的使用状况;
|
||
-V:显示版本信息。</code></pre>
|
||
<h3 id="参数">参数</h3>
|
||
<p>交换空间:指定需要激活的交换空间,可以是交换文件和交换分区,如果是交换分区则指定交换分区对应的设备文件。</p>
|
||
<h3 id="实例">实例</h3>
|
||
<pre><code class="language-bash">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</code></pre>
|
||
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
|