.\" Copyright (c) 1980, 1991 Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)swapon.8 6.3 (Berkeley) 3/16/91 .\" .\" Sun Dec 27 12:31:30 1992: Modified by faith@cs.unc.edu .\" Sat Mar 6 20:46:02 1993: Modified by faith@cs.unc.edu .\" Sat Oct 9 09:35:30 1993: Converted to man format by faith@cs.unc.edu .\" Sat Nov 27 20:22:42 1993: Updated authorship information, faith@cs.unc.edu .\" Mon Sep 25 14:12:38 1995: Added -v and -p information .\" Tue Apr 30 03:32:07 1996: Added some text from A. Koppenhoefer .\" .TH SWAPON 8 "25 September 1995" "Linux 1.x" "Linux Programmer's Manual" .SH NAME swapon, swapoff \- 使用/關閉用於分頁和交換的檔案和裝置 .SH "總覽 (SYNOPSIS)" .B /sbin/swapon [\-h \-V] .br .B /sbin/swapon \-a [\-v] .br .BI "/sbin/swapon [\-v] [\-p " "priority" "] " " specialfile " ... .br .B /sbin/swapon [\-s] .br .B /sbin/swapoff [\-h \-V] .br .B /sbin/swapoff \-a .br .BI /sbin/swapoff " specialfile " ... .SH "描述 (DESCRIPTION)" .B Swapon 指出 用於 分頁和交換 的 裝置. 一般 在 系統 多使用者執行級 的 初始化檔案 .I /etc/rc 中 呼叫 .B swapon , 使 所有的 交換裝置 生效, 因此 分頁和交換 活動 可以 在 多個 裝置和檔案 之中 進行. 常用的形式有: .TP .B \-h 顯示幫助 .TP .B \-V 顯示版本 .TP .B \-s 顯示交換裝置的使用情況.這個選項需要 .I /proc/swaps (小於 2.1.25 的 核心 可能沒有). .TP .B \-a 使 .I /etc/fstab 中, 所有 標記了 'sw' 的 交換裝置 生效. .TP .BI \-p " priority" 指定 .BR swapon 的 優先順序. 這個 選項 要求 .B swapon 在 1.3.2 或 更高 的 核心 上 編譯 和 使用. .I priority 介於 0 和 32767 之間. 關於 交換優先順序 的 完整 描述 請 參看 .BR swapon (2) . 在 .I /etc/fstab 檔案 中, 交換裝置 的 選項域 裡 加上 .BI pri= value , 用 .BR "swapon -a" 可以 使其 生效. .PP .B Swapoff 禁止 在 指定的 裝置和檔案 上 做 交換, 如果 指定了 .B \-a 選項, .I /etc/fstab 中 所有的 交換裝置 皆被 關閉. .SH "注意 (NOTE)" 別在 包含 空洞(hole) 的 檔案 上 使用 .B swapon . .SH "參見 (SEE ALSO)" .BR swapon "(2), " swapoff "(2), " fstab "(5), " init "(8), " mkswap (8), .BR rc "(8), " mount (8) .SH "檔案 (FILES)" .I /dev/hd?? 標準分頁裝置 .br .I /dev/sd?? 標準 (SCSI) 分頁裝置 .br .I /etc/fstab ascii 格式的 檔案系統 描述表 .SH "歷史 (HISTORY)" .B swapon 命令 源於 4.0BSD. .SH "[中文版維護人]" .B 徐明 .SH "[中文版最新更新]" .BR 2001/11/18 .SH "《中國Linux論壇man手冊頁翻譯計劃》" .BI http://cmpp.linuxforum.net .SH "跋" .br 本頁面中文版由中文 man 手冊頁計劃提供。 .br 中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR