Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 427  / 1 Year ago, tue, march 14, 2023, 7:57:35

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?


More From » delete

 Answers
1

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.




source


[#33571] Wednesday, March 15, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rhaeams

Total Points: 115
Total Questions: 111
Total Answers: 103

Location: Burundi
Member since Wed, Nov 25, 2020
4 Years ago
rhaeams questions
;