一. 相当详细且流程完整,(推荐阅读)

在centos7上新建swap区

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-centos-7

 二. centos官网

转:https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-swap-creating-file.html

5.2.3. Creating a Swap File

To add a swap file:

  1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536.

  2. At a shell prompt as root, type the following command with count being equal to the desired block size:

    dd if=/dev/zero of=/swapfile bs=1024 count=65536
    
  3. Setup the swap file with the command:

    mkswap /swapfile
    
  4. To enable the swap file immediately but not automatically at boot time:

    swapon /swapfile
    
  5. To enable it at boot time, edit /etc/fstab to include the following entry:

    /swapfile swap swap defaults 0 0
    

    The next time the system boots, it enables the new swap file.

  6. After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free.

centos 新建swap区文件的更多相关文章

  1. CentOS 新增swap交换空间

    在centos 6.4 64位系统中安装oracle 10g数据库软件,但由于交换空间过小导致检查不通过: 因此需要增加交换空间的大小. 第一步:在opt目录下新建swap交换文件,并设置其大小为2G ...

  2. centos彻底删除文件夹、文件命令(centos 新建、删除、移动、复制等命令)

    centos彻底删除文件夹.文件命令(centos 新建.删除.移动.复制等命令: 1.新建文件夹 mkdir 文件名 新建一个名为test的文件夹在home下 view source1 mkdir ...

  3. 转发:centos彻底删除文件夹、文件命令(centos 新建、删除、移动、复制等命令)

    http://blog.csdn.net/lpdx111/article/details/16877725 centos彻底删除文件夹.文件命令(centos 新建.删除.移动.复制等命令: 1.新建 ...

  4. CentOS 手动增加、删除swap区

    SWAP是Linux中的虚拟内存,用于扩充物理内存不足而用来存储临时数据存在的.它类似于Windows中的虚拟内存.在Windows中,只可以使用文件来当作虚拟内存.而linux可以文件或者分区来当作 ...

  5. CentOS如何手动增加 删除swap区

    SWAP是Linux中的虚拟内存,用于扩充物理内存不足而用来存储临时数据存在的.它类似于Windows中的虚拟内存.在Windows中,只可以使用文件来当作虚拟内存.而linux可以文件或者分区来当作 ...

  6. 阿里云主机centos7系统创建SWAP区,并启动挂载(适合无SWAP区虚拟化平台)

    以root用户登录建立交换区文件: fallocate -l 2G /swapfile /swapfile //赋予仅root用户的权限,确保安全 mkswap /swapfile swapon /s ...

  7. CentOS(十)--与Linux文件和目录管理相关的一些重要命令②

    在结束了第二期的广交会实习之后,又迎来了几天休闲的日子,继续学习Linux.在上一篇随笔 Linux学习之CentOS(十七)--与Linux文件和目录管理相关的一些重要命令① 中,详细记录了与Lin ...

  8. linux中增加swap分区文件的步骤方法

     一.swap交换分区 Swap分区在系统的物理内存不够用的时候,把硬盘空间中的一部分空间释放出来,以供当前运行的程序使用.那些被释放的空间可能来自一些很长时间没有什么操作的程序,这些被释放的空间被临 ...

  9. 在Centos中导入sql文件的方法

    在Centos中导入sql文件的方法 利用mysql -u root -p进入mysql数据库 对于文件的导入,在Centos下里面的是首先要新建一个和文件相同名字的数据库.例如:mysql>c ...

随机推荐

  1. ASP.NET Core 中的框架级依赖注入

    https://tech.io/playgrounds/5040/framework-level-dependency-injection-with-asp-net-core 作者: Gunnar P ...

  2. C#——性能计数器

    简要Windows性能监视器: 打开Windows性能监视器的步骤如下: 开始→运行→perfmon→确定 在这里我们可以选择添加我们要监控的计数器,比如:cpu使用率.内存使用量等,作为asp.ne ...

  3. Plan Explorer数据库

    Plan Explorer数据库 https://www.sentryone.com/platform/sql-server-performance-monitoring

  4. HTTP协议GET和POST的区别

    from http://blog.csdn.net/whuslei/article/details/6667095 权威点的说明请参考:http://www.cs.tut.fi/~jkorpela/f ...

  5. Godaddy新手教程

    Godaddy新版域名空间管理控制面板使用方法和更换IP与机房问题 http://www.freehao123.com/godaddy-new/ //设置DNS 最新Godaddy绑定域名教程设置DN ...

  6. 在树莓派2上安装 Windows 10

    微软在2015年4月29日发布了树莓派玩家期待已久的 Windows 10 物联网核心预览版(Windows 10 IoT Core Insider Preview Image for Raspber ...

  7. Enable WiX project in Visual Studio 2013

    I have a VS 2012 solution with WiX Installer projects. However, when I open the solution in VS 2013 ...

  8. 再议ASP.NET MVC中CheckBoxList的验证

    在ASP.NET MVC 4中谈到CheckBoxList,经常是与CheckBoxList的显示以及验证有关.我在"MVC扩展生成CheckBoxList并水平排列"中通过扩展H ...

  9. 云服务器 ECS Linux 系统安装图形化桌面 (centos7 ubuntu14)

    基于性能及通用性等因素,默认情况下,阿里云官方公共 Linux 系统镜像不会安装图形化桌面组件.本文简述了常用操作系统图形化桌面安装说明,您可以根据需求进行配置系统. 注意:图形化桌面可能会 显著降低 ...

  10. ios之CABasicAnimation

    博主:最近iOS开发中用到CoreAnimation的framework来做动画效果,虽然以前也用过,但一直没有系统学习过,今天看到一篇非常详细的博文(虽然是日语,但真的写的很好),在此翻译出来供大家 ...