0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Linuxのスワップ領域作成

Last updated at Posted at 2023-05-19

例として、1GIBのスワップ領域を作成。

  1. スワップ領域で使用するファイルを作成
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
  1. スワップファイルの権限を変更
sudo chmod 600 /swapfile
  1. スワップ領域の作成
sudo mkswap /swapfile
  1. スワップ領域の有効化
sudo swapon /swapfile
  1. 起動時にスワップ領域をマウントするように設定するために、設定ファイルを開く
sudo vim /etc/fstab
  1. 5で開いた設定ファイルの末尾に追加
/swapfile swap swap defaults 0 0
  1. vimを閉じて、再起動
sudo reboot
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?