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