So, say you've completed a full pass of:
dd if=/dev/zero of=/dev/sdX bs=1M
Then, you'd like to make sure the destination has been really zeroed out (ignoring the confirmation messages from dd
and not just polling the start or the end of the device). Assuming that you'd have to read through the whole disk – I'd use this:
dd if=/dev/sdX bs=1M | grep -P '[^\x00]'
However, as this works with piping the stdout, eventually this falls out with an error saying that the operation ran out of memory. So, it's of no use.
Of course, creating a whole image of the entire disk and saving it is not an option. But, perhaps, doing that while somehow being able to skip 0x00 on the fly – that'd be one of the solutions..
Ideas?
Best Answer
There is a device,
/dev/zero
on a linux system that always gives zero when read.So, how about comparing your hard drive with this device:
If all is well with zero-ing out your hard drive it will terminate with:
telling you that the two files are the same until it got to the end of the hard drive. If there is a non zero bit on the hard drive cmp will tell you where it is in the file.
If you hav the
pv
package installed thenwill do the same thing with a progress bar to keep you amused while it ckecks your drive (the EOF will now be on
-
rather thansdX
though).