Zero filling (vs one-filling) drives: convention or practical reason?

0

Many tutorials suggest zero-filling a drive to fully erase it for further use, but I have never seen anyone suggest one-filling a drive for any reason. Is this an arbitrary convention, or is there a reason why zero-filling is better than one-filling?

Is one harder on the device physically than the other? Other than security (for which I understand a random fill is better), are there any other possible considerations?

Stonecraft

Posted 2019-02-08T03:54:13.750

Reputation: 279

Thanks, I did find that but it is a slightly different question and is focused on data security. Regarding that question, I would ask whether multiple writes of all ones are functionally identical to multiple writes of all zeros. – Stonecraft – 2019-02-08T04:41:21.397

1Yeah but there was some useful information on how a magnetic drive stores a 1 or a 0 – Moab – 2019-02-08T13:57:51.467

Answers

2

Is one harder on the device physically than the other?

Nowadays many drives internally encrypt data, so all zeros (or all ones) are stored internally as "mixed" values anyway. Therefore it shouldn't matter.

are there any other possible considerations?

I'm a Linux user. From my point of view zeros are extremely easy to get because there is /dev/zero in the OS. Getting all ones is not that easy. It's the only reason to prefer zeros I can think of. And since the easiest way to fill a drive with anything is to use dd, cat or cp (rather than writing your own program), filling with zeros from /dev/zero seems natural.

Zero-filling is easy:

cp /dev/zero /dev/sdX

while one-filling requires some additional work:

</dev/zero tr '\0' '\377' >/dev/sdX

Note the latter can be used to fill the device with any fixed byte value. In this sense all ones are as "hard" to get as any other byte except all zeros.

Kamil Maciorowski

Posted 2019-02-08T03:54:13.750

Reputation: 38 429