跑步时,
fallocate -l 10G /path/to/file
Run Code Online (Sandbox Code Playgroud)
我返回以下错误:
fallocate: file: fallocate failed: Operation not supported
Run Code Online (Sandbox Code Playgroud)
使用 dd(if=/dev/zero 或 if=/dev/urandom)创建文件是有效的,但如果我试图创建大文件,大小为数十 GB,则需要几个小时才能完成。
运行 Ubuntu 14.04。使用 ext4 分区,指定文件类型似乎不会改变结果。
在我的 CentOS6 机器上工作正常,只是不是 Ubuntu。