When you create a virtual machine with VirtualBox, you are greeted with two options while creating the virtual disk:

  1. Dynamically allocated
  2. Fixed size

The dynamically allocated just creates a sparse file that grows when the requirements expand.

But the fixed size creates a file that consumes the allocated disk space.

Creating both dynamically allocated and fixed-sized partitions will not take a long amount of time.

What kind of file does the fixed size create? Is it gets written to the disk and increases the total terabytes written SMART count? Can I create such a file that consumes a huge space but takes no time to get created?


I noticed that a newly created very small disk worth 194M has 5 lines of binary data.

I also created a 12G file, which also is mostly empty. But it takes no time to create the 12G file.

1 Answer 1


File data is stored in blocks on the hard drive. Information on which blocks make up a file is stored in meta data about the file. This is what we call a file system.

So to create a 1TB file, the OS only needs to allocate 1TB of worth of blocks. This makes those blocks unavailable to any other file. But the OS does not need to write 1TB unless it is actually given 1TB of data to write. You can see this behaviour with the truncate command.

To extend a file this way, you can either do this at the command line with truncate or programmatically with truncate()

  • +1, but still I just can't figure out how do I create a file like that myself without VirtualBox? truncate --size 10G something?
    – S.Goswami
    Sep 2, 2019 at 6:30
  • 1
    Yes. That will create a 10GB file Sep 2, 2019 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.