Determining if a Disk has been Zeroed

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

Synopsis:

Tracking progress of dding a disk

Solution:

You should be able to grab the first 128K of a disk and verify there is no data:

# head -c 128000 /dev/sdb|hexdump -C
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
0001f400

or

# head -c 1024 /dev/sdb|od -An -t x1
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*

You can also just print the lines that are not zeroed with:

sudo head -c 1048576 /dev/sde | xxd | grep -v "0000 0000 0000 0000 0000 0000 0000 0000" | less

If there isn’t any data returned then it is zeroized.

For FULL validation - you can use ‘od /dev/xyz | head’ - if you get more than just a couple lines of 0’s then your disk/part isn’t fully blank.

-Albert