码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu add swap

时间:2018-10-11 14:31:09      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:sys   and   add   ls -l   mount   cat   mkswap   creat   ble   

1. create a 1G file for the swap.

  sudo fallocate -l 1G /swapfile

  we can verify that the correct amount of space was reserved by typing:

  ls -lh /swapfile

2. Enabling the Swap File.

  1.Make the file only accessible by typing:

    sudo chmod 600 /swapfile.

       2.Make the file as swap space by typing:

    sudo mkswap /swapfile

  3.Enabling the swap file and allow our system to start utilizing it .

    sudo swapon /swapfile.

  4.Now you can find that the swap space was added by typing:

    free -h / (sudo swapon --show)

  

Ubuntu add swap

标签:sys   and   add   ls -l   mount   cat   mkswap   creat   ble   

原文地址:https://www.cnblogs.com/magicpig666/p/9772003.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!