https://askubuntu.com/questions/566745/allocate-swap-after-ubuntu-14-04-lts-installation

----------------------------------------------

40down voteaccepted

First, to create 4,000 MB of swap space:

$ sudo dd if=/dev/zero of=/swapspace bs=1M count=4000
4000+0 records in
4000+0 records out
4194304000 bytes (4.2 GB) copied, 5.92647 s, 708 MB/s

or

$ sudo fallocate -l 4000M /swapspace

Next turn it into a usable swap file:

$ sudo mkswap /swapspace
Setting up swapspace version 1, size = 4095996 KiB
no label, UUID=7d1895e4-7ccf-42c6-979a-51ebddb49e91

Activate it:

$ sudo swapon /swapspace

Confirm active swap spaces:

$ cat /proc/swaps
Filename Type Size Used Priority
/swapspace file 4095996 0 -1

Next, add the following line to /etc/fstab to activate the new swap at boot:

/swapspace none swap defaults 0 0

See also this wiki page: https://help.ubuntu.com/community/SwapFaq

最新文章

  1. 在cwcity空间上安装phpmyadmin
  2. 常见绘图框架-(Charts)
  3. Android 触摸手势基础 官方文档概览2
  4. VMware 11安装Mac OS X 10.11.5虚拟机以及优化心得
  5. Unix 哲学
  6. Axis2 WebService(基于REST风格)
  7. dwz笔记之tree权限扩展
  8. CDOJ 1272 Final Pan's prime numbers
  9. easyui 菜单按钮&提示框
  10. Spring (三)
  11. JS学习一
  12. Mybatis映射文件处理特殊字符【转发】
  13. Oracle-表的字段增加修改删除操作
  14. ThinkPHP中:多个项目共享同一个session问题
  15. 设计模式——桥接模式(C++实现)
  16. git使用.gitignore设置不生效或不起作用的问题
  17. Spring之ORM模块
  18. leetcode46. Permutations 、47. Permutations II、 剑指offer字符串的排列
  19. CEdit使用(Edit Control控件)
  20. openwrt挂载摄像头及视频保存

热门文章

  1. 文件操作-mkdir
  2. docker系列之镜像服务器
  3. vs实用插件
  4. Windows Server 2008 R2+SQL Server 2014 R2升级到Windows Server 2016+SQL Server 2016
  5. RTC-ISL128
  6. Java-对复合类型数据进行排序
  7. 利用Node.js调用Elasticsearch
  8. 大数据学习——sql练习
  9. mysql数据库修改字段类型
  10. 在VS2017中编写Python程序