Determining the bs value for dd

1

1

I am using an external 1 TB WD hard drive with Advanced Format (4096 bytes sector size). What is the recommended value for the bs option in dd? Should I use dd bs=4096? And if I get this value "wrong" is there any data problem that could appear or is this option only in terms of speed?

Also I am securely wiping the hard drive, could I not fully wipe the drive if I am using the bs option?

Sector size (logical/physical): 512 bytes / 4096 bytes

Paul Haun

Posted 2018-01-24T23:04:35.603

Reputation: 57

Answers

0

A block size between 4096 and 512K should suffice.
A bs smaller than than the physical sector would be horribly slow.
More than 128 times the sector size is also a waste since the ATAPI command set cannot handle such a large transfer.

And if I get this value "wrong" is there any data problem that could appear or is this option only in terms of speed?

If it's too small (i.e. less than the logical sector size), then there could be issues. Otherwise it's a speed optimization.

Also I am securely wiping the hard drive, could I not fully wipe the drive if I am using the bs option?

As long as you use a reasonable value for bs, then there should be no issues.

sawdust

Posted 2018-01-24T23:04:35.603

Reputation: 14 697

"If it's too small (i.e. less than the logical sector size), then there could be issues" – Other than in terms of speed? Can you elaborate? What could they be? – Kamil Maciorowski – 2018-01-25T05:33:57.913

@KamilMaciorowski -- If you use the seek option or an oddball count with a less-than-sector-size bs (i.e. expect dd to perform a read before a write in order to perform partial sector operations), then dd will probably not do what you want. – sawdust – 2018-01-25T23:50:36.063

Do you have any code or link to support this? – Kamil Maciorowski – 2018-01-26T04:47:10.227