Android 7.1 uses the dd command to create partitions and files

Create a file called logo.img with a size of 8m
dd if=/dev/zero of=logo.img bs=8m count=1

Create a partition node of 8m
dd if=/dev/zero of=/dev/block/platform/fe330000.sdhci/by-name/logo bs=8m count=1

Use the logo.bmp file to create a logo.img partition image
dd if=/data/logo/logo.bmp of=/data/logo/logo.img count=116224 bs=1

The dd command creates a file of a specified size
Command:

dd if=/dev/zero of=100m.txt bs=100m count=1

A 100m.txt file with a size of 100M*1=100M will be generated in the current directory, and its content is all 0 (because it is read from /dev/zero, /dev/zero is the source of 0) if input
file
of The block size of the output file
bs in bytes count the number of blocks to
be copied

In some scenarios, you just want the file system to think that there is a very large file here, but it does not actually write it to the hard disk

dd if=/dev/zero of=test bs=1M count=0 seek=150000

The displayed size of the created file in the file system is 150000MB, but it does not actually occupy block
seek. The effect of block seek is to skip the part of the specified size in the output file.
The speed of creation is comparable to the speed of memory.

Guess you like

Origin blog.csdn.net/baiyifei2016/article/details/129748067