如何让磁盘配额满
我遇到的情况是,当超出磁盘配额时,我必须测试 mv(1) 命令。
谁能让我知道创建这个的步骤..我的意思是如何在普通的 Unix 测试机器上使磁盘配额满。
谢谢。
I am in a situation where i have to test mv(1) command while disk quota is exceeded.
Can anyone let me know the steps to create this.. i mean how can i make disk quota full on normal Unix test machine.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
其中 count 是您必须填写的 MB 数:)
Where count is the number of MB you have to fill :)
要么使用操作系统和文件系统提供的任何配额工具设置一个非常小的配额,要么通过创建大文件(例如使用 dd )来填充文件系统,直到超出或非常接近配额。
Either set a very small quota using whatever quota tools your OS and filesystems offer, or just fill up the filesystem by creating large files (using
dd
for example) until the quota is exceeded or very close to that.我也有兴趣进行“磁盘已满”测试。 (我编写了一些对磁盘满场景敏感的 Java 代码,但我需要对其进行测试。)
为了扩展 Noufal Ibrahim 的想法#2,我做了一些研究,发现了设置和拆卸循环设备挂载所需的所有命令。这将允许您创建一个小型的临时安装座。您可以填充它并进行“磁盘已满”测试。
我的命令适用于 Debian Linux。您的路径可能会略有不同。
这是脚本:
I am also interested in doing "disk full" testing. (I wrote some Java code that is sensitive to disk full scenarios, but I need to test it.)
To expand upon Noufal Ibrahim's idea #2, I did some research and found all the necessary commands to setup and teardown a mount for loop device. This will allow you to create a tiny temporary mount. You can fill it and do "disk full" testing.
My commands are for Debian Linux. Your paths may vary slightly.
Here is the script: