Determining if a Disk has been Zeroed


#1

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.


#2

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