zoukankan      html  css  js  c++  java
  • 扩展交换空间

    交换空间太小,使用dd的方式扩展2G空间。

    ubuntu@ubuntu-42:/usr/local/tomcat$ free -h

                       total        used        free      shared  buff/cache   available

    Mem:           7.6G        6.0G        855M         13M        765M        1.3G

    Swap:          2.0G        2.0G        2.9M

    ubuntu@ubuntu-42:/usr/local/tomcat$ sudo dd if=/dev/zero of=/home/swap bs=1024 count=2048000   #示意扩展2G的空间。

    ubuntu@ubuntu-42:/usr/local/tomcat$ sudo mkswap /home/swap

    ubuntu@ubuntu-42:/usr/local/tomcat$ sudo swapon /home/swap

    ubuntu@ubuntu-42:/usr/local/tomcat$ free -h

                       total        used        free      shared  buff/cache   available

    Mem:           7.6G        6.0G        131M         13M        1.5G        1.4G

    Swap:          4.0G        2.0G        2.0G

    如果在原有基础上再次扩展,会报错:

    $ sudo dd if=/dev/zero of=/home/swap bs=1024 count=2048000

    dd: failed to open '/home/swap': Text file busy

    解决:需要先关闭swap,再重新分配,即执行

    $ sudo swapoff -a

    结束。

  • 相关阅读:
    jqueryUI弹出框问题
    spring data jpa分页
    解决eclipse编辑js和html卡的问题
    web.xml添加编码过滤器
    Apache SolrCloud安装
    搭建zookeeper集群
    html页面读取PDF小案例
    .NET 使用Process调用7_zip解压文件
    .NET 中三种正确的单例写法
    Git 笔记
  • 原文地址:https://www.cnblogs.com/liusingbon/p/12851127.html
Copyright © 2011-2022 走看看