30 ms·
mkfile is standard on Solaris. On Debain use fallocate: $ fallocate -l 128MB /home/user/disk1
by psophis 11y ago
mkfile is standard on Solaris. On Debain use fallocate:
$ fallocate -l 128MB /home/user/disk1
- voidz 11y agothere is also 'truncate'. Especially nice about truncate is the ability to create sparse files. So if you want to test how big a pool would be with three 1TB disks without actually using 3TB of allocated space: 'truncate -s 1T file1.img'. voila, a 1tb file that only takes kilobytes upon creation of a zpool.
- NeutronBoy 11y agoIs there an advantage of using fallocate over say, dd to pipe random or zeroes to a file?
- asimilator 11y agofallocate doesn't do any IO; it's much faster. From the fallocate man page: > For filesystems which support the fallocate system call, preallocation is done quickly by allocating blocks and marking them as uninitialized, requiring no IO to the data blocks. This is much faster than creating a file by filling it with zeros.