Quickly create large file in linux

Usually in linux we need to quickly create large file in which we don’t care much about the content to do some test such as disk I/O test, then we can use:

fallocate -l 10GB test.bin

this system call would create a file with size 10GB named test.bin and contain random content quickly, because it only pre-allocate the space without write anything into it so that the heavy disk I/O is avoided.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: