|
|
|
|
|
by jasomill
638 days ago
|
|
Simpler: fill the drive with random data, hashing as you go, flush the kernel's buffer cache, hash the entire contents of the drive, and compare. Conceptually, # tee /dev/DEVICE </dev/random | sha256sum
# echo 1 > /proc/sys/vm/drop_caches
# sha256sum /dev/DEVICE
though I wouldn't expect this exact command sequence to work unless tee's buffer size divides /dev/DEVICE's capacity and tee errors out writing past the end of /dev/DEVICE before writing to stdout. |
|
the drive size divided by 4MB, so dd with bs=4M and fixed count
(with oflag=direct you don't even need to drop caches)