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
second command
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 What's block size?
|
||||
|
|
|
First command uses 512 byte blocks, whereas the second uses 1MB blocks. Actually a 4kB blocksize will do the trick in most cases as the disk uses 4kB blocksize on hardware level. What happens in the first case is the following (simplified):
... replacing a 4kB block requires 8 reads from disk and 8 writes to disk. I guess you get the image for what happens when you increase block size to 4kB or larger (preferably multiple of 4kB) and how that increases speed. It doesn't have to read the disk any more, because entire blocks are written. On top of that speed up, it is quite likely that the PC is now delivering data fast enough to the disk, that it can probably write consecutive block one after the other, without having to wait for the rotating platter to do a full revolution until the right block appears under the heads. |
|||
|
|
|
Argument |
|||
|
|