• 请不要在回答技术问题时复制粘贴 AI 生成的内容
zjsxwc
V2EX  ›  程序员

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

  •  
  •   zjsxwc ·
    zjsxwc · Dec 6, 2018 · 1588 views
    This topic created in 2741 days ago, the information mentioned may be changed or developed.

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

    Supplement 1  ·  Dec 6, 2018
    不是硬盘容量问题( 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.
    Supplement 2  ·  Dec 6, 2018
    使用 du /|sort -k1 -n 命令找到垃圾文件最多的那个目录,然后删除那个目录就行了
    Supplement 3  ·  Dec 6, 2018
    vim /etc/systemd/journald.conf
    ```
    MaxRetentionSec=1month
    MaxFileSec=1month
    ```

    systemctl restart systemd-journald
    www5070504
        1
    www5070504  
       Dec 6, 2018
    超配么
    zjsxwc
        2
    zjsxwc  
    OP
       Dec 6, 2018 via Android
    结贴,不是阿里云问题,是我自己的问题,在 append 里已经说明原因。
    bclerdx
        3
    bclerdx  
       Dec 6, 2018 via Android
    @zjsxwc 垃圾文件占用了吧?
    zjsxwc
        4
    zjsxwc  
    OP
       Dec 6, 2018 via Android
    @bclerdx 是的 journald 日志太多导致,超出了文件系统 ext4 最大允许的数目,汗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3784 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 10:30 · PVG 18:30 · LAX 03:30 · JFK 06:30
    ♥ Do have faith in what you're doing.