Easiest way to simulate no free disk space situation?

后端 未结 13 744
执笔经年
执笔经年 2021-02-03 20:11

I need to test my web app in a scenario where there’s no disk space remaining, i.e. I cannot write any more files. But I don’t want to fill my hard drive with junk just to make

13条回答
  •  盖世英雄少女心
    2021-02-03 20:53

    Bottom line; don't do that. Seriously -- there are so many things that go horribly wrong when a volume runs out of space. Unless the volume targeted is not the boot volume and has not one other application writing to it, the behavior as the disk fills will be out of your control anyway.

    If it is the boot drive, the system will quite likely panic or crash upon full disk anyway. Or, if not, it'll behave erratically.

    If you are talking about a data volume, is yours the only app that is writing to it? If any other app is writing, do you know for certain how they might fail?

    Disk space is so dirt cheap these days that you are far better off ensuring that out of disk space will simply never happen. Drop a 2TB drive in and put an alarm in when it reaches 50% capacity. Far cheaper to implement (unless your time is free) and far more reliable.

提交回复
热议问题