For the purpose of testing the performance of a cloud storage volume, I recently came across the xfs_mkfile command.

This command creates a file called 30GigFile.out that is 30 GB in size:

xfs_mkfile 30720m 30GigFile.out

What I do is simply test the timing of how long it takes using the following:

date; xfs_mkfile 30720m 30GigFile.out; date

The Linux man page simply state that xfs_mkfile will "create an XFS file". The file is padded with zeroes by default.


Other commands to create temporary files that can be used are (but not ideal for performance testing; you'll see why when you run them; because they instantaneously create the file):

fallocate -l 30G 30GigFile.out
dd if=/dev/zero of=30GigFile.out bs=1 count=0 seek=30G