Skip to content

Instantly share code, notes, and snippets.

@lostandfound
Last active August 25, 2017 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lostandfound/fde141a0fefeb16aac27267c8b8a559c to your computer and use it in GitHub Desktop.
Save lostandfound/fde141a0fefeb16aac27267c8b8a559c to your computer and use it in GitHub Desktop.
スワップファイルを作成して、Swap領域のサイズを512MBに増やす
#!/bin/sh
# スワップファイルを作成して、Swap領域のサイズを512MBに増やす
# source http://qiita.com/na0AaooQ/items/278a11ed905995bd16af
# スワップファイルの作成
sudo dd if=/dev/zero of=/swapfile1 bs=1M count=512
# スワップファイルの所有権変更
sudo chmod 600 /swapfile1
# スワップファイルの確認
sudo ls -l /swapfile1
# スワップファイルのフォーマット
sudo mkswap /swapfile1
# スワップファイルの有効化
sudo swapon /swapfile1
# 有効化の確認
sudo swapon -s
# 事後作業
# `/etc/fstab`に以下を追記して起動時に有効化しておくこと。
# ```
# /swapfile1 swap swap defaults 0 0
# ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment