What is a quick and easy way to make a file that is, say, 2 GB in size?
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
The zero-fill method took 38 seconds on an SSD and caused Ubuntu's graphical interface to become unresponsive due to excessive iowait.
fallocate creates large files instantly by directly manipulating the file's allocated disk space:
truncate also works instantly, and creates sparse files which don't use up actual disk space until data is written later on:
|
||||
|
|
|
An easy way would be to use the
Use G in the size argument if you want computer (1024*1024*1024) gigabytes, or GB if you want human (1000*1000*1000) gigabytes. |
|||||||||||
|
|
ftp://ftp.fsf.hu/testfiles/maketestfiles.sh or Seek is the size of the file you want in bytes - 1.
|
|||
|
|