First command
sudo dd if=/dev/zero of=/dev/sda
second command
sudo dd if=/dev/zero of=/dev/sda bs=1M
I am formatting my pc for 4 hours with first code but it didn't finish.
Is the first code wrong?
What is the difference?
First command
sudo dd if=/dev/zero of=/dev/sda
second command
sudo dd if=/dev/zero of=/dev/sda bs=1M
I am formatting my pc for 4 hours with first code but it didn't finish.
Is the first code wrong?
What is the difference?
The default block size for dd
is 512 Bytes, with the second command you tell dd
to use 1MB block size.
What's block size?
A block is a unit measuring the number of bytes that are read,
written, or converted at one time. Command line options can specify a
different block size for input/reading (ibs) compared to
output/writing (obs), though the block size (bs) option will override
both ibs and obs. The default value for both input and output block
sizes is 512 bytes (the block size of Unix block devices). The count
option for copying is measured in blocks, as are both the skip count
for reading and seek count for writing. Conversion operations are also
affected by the "conversion block size" (cbs).
For some uses of the dd command, block size may have an effect on
performance. For example, when recovering data from a hard disk, a
small block size will generally cause the most bytes to be recovered.
For greater speed during copy operations, a larger block size may be
used. When dd is used for network transfers, the block size may have
an impact on packet size, depending on the network protocol used.