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

add swapspace file on ubuntu.的更多相关文章

  1. How To Add Swap Space on Ubuntu 16.04

    Introduction One of the easiest way of increasing the responsiveness of your server and guarding aga ...

  2. SharePoint Client Add Folder,file to Library

    public void UploadDocument(string siteURL, string documentListName, string documentListURL, string d ...

  3. How to install .deb file in Ubuntu

    if you have a .deb file: You can install it using sudo dpkg -i /path/to/deb/file followed by sudo ap ...

  4. Add a file to a Document Library and update metadata properties in a single method添加文档的方法

    private void AddFileToDocumentLibrary(string documentLibraryUrl, string filename, byte[] file_bytes, ...

  5. [百度空间] ld: add library file reference by path & file name

    By default, -l option will search libraries with lib* prefix in speficied search paths. i.e. 1 ld -o ...

  6. Add task bar to ubuntu

    http://www.howtogeek.com/189819/how-to-add-a-taskbar-to-the-desktop-in-ubuntu-14.04/ sudo apt-get in ...

  7. How can I add files to a Jar file? (or add a file to a zip archive)

    https://stackoverflow.com/questions/12239764/how-can-i-add-files-to-a-jar-file M.java class M{ publi ...

  8. ubuntu add application to launcher

    eg. add sublime text to launcher so as to be found by launcher, docky, etc. add a file sudo gedit /u ...

  9. Add a system call on Ubuntu 13.04(x64) with x86_64

    We added a system call to modify idt table, then programed it in modify_idt.c 1. Put our modify_idt. ...

随机推荐

  1. aggregate和annotate使用

    aggregate和annotate方法的使用场景 Django的aggregate和annotate方法属于高级查询方法,主要用于组合查询,是Django高手们必需要熟练掌握的.当我们需要对查询集( ...

  2. int long long 的范围

    unsigned   int     0-4294967295   (10位数,4e9) int                        -2147483648-2147483647  (10位 ...

  3. git commit 含有中文的代码,提示Warnning:Your console font probably doesn't support Unicode.......

    git 提交代码是会遇到以下问题, git commit 代码时提示: Warning: Your console font probably doesn't support Unicode. If ...

  4. 关于网络IP地址的分类

    一.IP地址的分类 众所周知,IP地址都是以点号.分为4段来表示.不同类的IP前几位的表示含义也不尽相同. 1.A类IP [网络地址] 第一位表示网络地址,且第一个字节的第一位必须以0开头.依据此原则 ...

  5. 【0门槛】PR稿的自我修养

    本文来自网易云社区 作者:巩爽 十一过完,离2018年结束就只剩下85天啦!是不是2016年许下的2017年的梦想,在2018年还没有实现? 做过的项目仿佛都小有成就,可惜只是内部自嗨,想做域外宣传却 ...

  6. Spark——为数据分析处理提供更为灵活的赋能

    本文来自网易云社区 作者:王佳楠 一.概述 现如今在大规模数据处理分析的技术领域中,Hadoop及其生态内的各功能组件占据了绝对的统治地位.Hadoop原生的MapReduce计算框架由于任务抽象简单 ...

  7. 大数据学习——hbase数据库

    Hhbase集群搭建 一 第一步 准备:搭建hadoop集群,搭建zookeeper 二 第二步:上传安装包 解压 1 tar -zxvf  hbase-1.2.1-bin.tar.gz 重命名 2 ...

  8. Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成"

    在iOS上开发视频操作的时候,出现错误: 录制视频错误:Error Domain=AVFoundationErrorDomain Code=-11800 "这项操作无法完成" Us ...

  9. 算法复习——平面分治(hud1007)

    题目: 问题描述 : Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitch ...

  10. Codeforces 894.A QAQ

    A. QAQ time limit per test 1 second memory limit per test 256 megabytes input standard input output ...