Please see the dd command and the output below.
dd if=/dev/null of=./VirtualDisk.img bs=1M count=1024
0+0 records in
0+0 records out
0 bytes copied, 0.000281296 s, 0.0 kB/s
I expected 1024 blocks of size 1MB will be written to the output file. But why is the output file size of VirtualDisk.img 0?
Also, see another example.
dd if=/dev/null of=./VirtualDisk.img bs=1M seek=1024
0+0 records in
0+0 records out
0 bytes copied, 0.000254032 s, 0.0 kB/s
According to the manual, is should skip 1024 blocks of size 1MB from the start of output file. But the generated output file size of VirtualDisk.img is 1073741824 (1MB * 1024). I could see the skipped region was filled with zero.
THis is the dd manual : https://man7.org/linux/man-pages/man1/dd.1.html
To me, the behavior for count
and seek
is different from what the manual says. How should I absorb this behaviour?