我有一个将文件写入磁盘的程序。我想在写入的文件系统已满时测试程序的行为。
创建一个小文件系统来测试这个而不必在SAN上订购磁盘设置的最佳选择是什么......我猜Ram磁盘需要重新启动,这不是很好。
您应该使用 /dev/full,因为它只是为此提供的。
/dev/full 是总是满的虚拟设备。
$ echo "Hello world" > /dev/full
bash: echo: write error: No space left on device
Run Code Online (Sandbox Code Playgroud)
见http://en.wikipedia.org/wiki//dev/full