How to add swap to and Amazon EC2 instance running Ubuntu 12.04 LTS?

后端 未结 5 1903
迷失自我
迷失自我 2021-02-04 19:08

default Ubuntu 12.04 LTS doesn\'t create swap for some reason. Is there \"proper\" way to add it after install?

root@aux3:/root# df -h
Filesystem      Size  Used Avai         


        
5条回答
  •  余生分开走
    2021-02-04 19:41

    Found swapspace daemon that takes care of creating and removing swapfiles on demand. It just needed little tuning to save swapfiles on ephemeral drive.

    This seem to me most elegant solution:

    DEBIAN_FRONTEND=noninteractive apt-get -y install swapspace
    echo 'swappath="/mnt"' >> /etc/swapspace.conf
    service swapspace restart
    

提交回复
热议问题