V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zjsxwc
V2EX  ›  程序员

阿里云连硬盘都要超卖吗?

  •  
  •   zjsxwc ·
    zjsxwc · 2018-12-06 14:16:41 +08:00 · 1183 次点击
    这是一个创建于 1961 天前的主题,其中的信息可能已经有所发展或是发生改变。

    感觉是阿里云超卖我小鸡的硬盘了,df 看到我还剩下 21G 硬盘,但是 php 写文件老是报错硬盘容量不足,然后我执行 dd if=/dev/zero of=./swapfile bs=1M count=20480 后再把这个 swapfile 删掉后就不报容量不足错了,应该和虚拟机一样扩硬盘容量容易,删硬盘空间难吧,建议小鸡用户都没事跑些 dd 命令吧。

    第 1 条附言  ·  2018-12-06 16:26:36 +08:00
    不是硬盘容量问题( cannot create temp file for here-document: No space left on device ),导致的,而是 inode 不够的原因,

    In most cases (obviously not in your case) the reason will be that you are running out of iNodes.

    To check this run df -i:

    Filesystem Inodes IUsed IFree IUse% Mounted on
    [...]
    25600 25600 0 100% /foo
    Here you can see the use of iNodes is 100%.

    Bad news is, according to https://superuser.com/questions/585641/changing-max-inode-count-number-in-ext3-filesystem-in-cent-os you need to re-create your file system with the -i option in order to increase the number of inodes.
    第 2 条附言  ·  2018-12-06 16:35:46 +08:00
    使用 du /|sort -k1 -n 命令找到垃圾文件最多的那个目录,然后删除那个目录就行了
    第 3 条附言  ·  2018-12-06 16:52:35 +08:00
    vim /etc/systemd/journald.conf
    ```
    MaxRetentionSec=1month
    MaxFileSec=1month
    ```

    systemctl restart systemd-journald
    www5070504
        1
    www5070504  
       2018-12-06 17:15:41 +08:00
    超配么
    zjsxwc
        2
    zjsxwc  
    OP
       2018-12-06 17:46:04 +08:00 via Android
    结贴,不是阿里云问题,是我自己的问题,在 append 里已经说明原因。
    bclerdx
        3
    bclerdx  
       2018-12-06 21:01:16 +08:00 via Android
    @zjsxwc 垃圾文件占用了吧?
    zjsxwc
        4
    zjsxwc  
    OP
       2018-12-06 22:10:13 +08:00 via Android
    @bclerdx 是的 journald 日志太多导致,超出了文件系统 ext4 最大允许的数目,汗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1006 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:02 · PVG 03:02 · LAX 12:02 · JFK 15:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.