.\" 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 .\" .\" Japanese Version Copyright (c) 1997 NAKANO Takeo all rights reserved. .\" Translated Thu Aug 21 1997 by NAKANO Takeo .\" Updated & Modified Thu 7 Oct 1999 by NAKANO Takeo .\" Updated & Modified Wed 14 Jun 2000 by NAKANO Takeo .\" Updated & Modified Wed May 5 13:08:03 JST 2004 .\" by Yuichi SATO .\" Updated & Modified Mon May 9 03:47:14 JST 2005 by Yuichi SATO .\" .TH SWAPON 8 "25 September 1995" "Linux 1.x" "Linux Programmer's Manual" .SH 名前 swapon, swapoff \- デバイスやファイルへのページング、スワッピングを有効 / 無効にする .SH 書式 .B /sbin/swapon [\-h \-V] .br .B /sbin/swapon \-a [\-v] [\-e] .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 説明 .B swapon は、ページング (paging) やスワッピング (swapping) を行うデバイスを 指定するために用いられる。 使用されるデバイスまたはファイルは、 .I specialfile 引き数で指定される。 .BI \-L " label" または .BI \-U " uuid" という形式で、ラベルまたは uuid でデバイスを指定することができる。 .B swapon の呼び出しは、通常システムをマルチユーザ用に初期化するファイル .I /etc/rc で行われる。普通はここですべてのスワップデバイスを有効にし、ページング やスワッピングが複数のデバイスやファイルにまたがってインターリーブ (interleave) 動作できるようにする。 通常は .B swapon \-a の書式で実行されることが多い。 .TP .B \-a .I /etc/fstab 中で ``swap'' マークが付いているスワップデバイスをすべて有効にする。 ただし ``noauto'' オプションが付いているものは除く。 スワップとして既に動作しているデバイスは、黙ってスキップされる。 .TP .B \-e swapon に .B \-a オプションが指定されている場合、 .B \-e オプションが指定されると、存在しないデバイスを黙ってスキップする。 .TP .B \-h ヘルプメッセージを呼び出す。 .TP .BI \-L " label" 指定された .I label のパーティションを使う。 (これを使用するためには .I /proc/partitions にアクセスする必要がある。) .TP .BI \-p " priority" .B swapon の優先度 (priority) を指定する。 このオプションは .B swapon が 1.3.2 以降のカーネル下でコンパイルされ、かつ使用される場合にのみ有効である。 .I priority は 0 から 32767 の間の数値である。 数値が大きいほど優先度が高い。 スワップ優先度の詳細な説明に関しては .BR swapon (2) を見よ。 .I /etc/fstab のオプションフィールドに .BI pri= value を記述すれば、 .B "swapon -a" の際にその値が用いられる。 .TP .B \-s スワップの使用状況をデバイス毎に表示する。 "cat /proc/swaps" と等しい。 Linux 2.1.25 より前では利用できない。 .TP .BI \-U " uuid" 指定された .I uuid のパーティションを使う。 (これを使用するためには .I /proc/partitions にアクセスする必要がある。) .TP .B \-v 詳細に表示する。 .TP .B \-V バージョンを表示する。 .PP .B swapoff は指定したデバイスやファイルのスワッピングを無効にする。 .B \-a フラグが指定された場合には、 .RI ( /proc/swaps または .I /etc/fstab 中の) すべての既知のスワップデバイスやファイルのスワッピングを無効にする。 .SH 注意 ホールのあるファイルに .B swapon を用いるべきではない。 NFS 上の swap は動作しないかもしれない。 .SH 関連項目 .BR swapon (2), .BR swapoff (2), .BR fstab (5), .BR init (8), .BR mkswap (8), .BR rc (8), .BR mount (8) .SH ファイル .I /dev/hd?? 標準のページングデバイス .br .I /dev/sd?? 標準のページングデバイス (SCSI) .br .I /etc/fstab ファイルシステムを ascii で記述した表。 .SH 履歴 .B swapon コマンドは 4.0BSD から導入された。