Show Table of Contents
15.2.3. swap ファイルを作成する
swap ファイルを追加します。
手順15.2 swap ファイルの追加
- 新しい swap ファイルのサイズをメガバイト単位で決定してから 1024 をかけてブロック数を確定します。たとえば swap ファイルのサイズが 64 MB の場合、ブロック数は 65536 になります。
- シェルに、以下のコマンドに必要なブロックサイズと等しい
countを付けて入力します。#
dd if=/dev/zero of=/swapfile bs=1024 count=65536 - 次のコマンドで swap ファイルを設定します。
#
mkswap /swapfile - swap ファイルをすぐに有効にします。ただし、起動時に自動的に有効にしません。
#
swapon /swapfile - 起動時に有効にするには、次のエントリーを含めるように
/etc/fstabを編集します。/swapfile swap swap defaults 0 0次にシステムが起動すると新しい swap ファイルが有効になります。
新しい swap ファイルが正常に作成されたかどうかをテストするには、
cat /proc/swaps または free を使って swap 領域を確認します。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.