How to quickly create large files on a Linux system's hard disk

Source: Internet
Author: User

ddCommands can be easily implemented to create files of the specified size, such as

DD If=/dev/zero of=test bs=1m count=1000

Generates a 1000M test file with full file content 0 ( /dev/zero /dev/zero 0 source for read from)
However, to actually write to the hard disk, the file production speed depends on the hard disk read and write speed, if you want to produce large files, slow

2.
In some scenario, we just want the file system to think that there is a huge file here, but it's not actually written to the hard disk
Then you can

DD If=/dev/zero of=test bs=1m count=0 seek=100000

The file created at this point is 100000MBin file system size, but does not actually occupy block, so the creation speed is equivalent to the memory speed.
Seek has the effect of skipping portions of the specified size in the output file, which achieves the purpose of creating large files, but not actually writing them.
Of course, because you don't actually write to the hard disk, you can create 100G of this type of file on a hard drive with a capacity of only 10G .

How to quickly create large files on a Linux system's hard disk

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.