I have a disk which is perhaps broken. I want to write random data to the disk and later verify the md5 checksum.
I write to the disk like this:
dd if=/dev/urandom of=/dev/sda bs=4M status=progress
How to create the md5 checksum while writing to the disk at the same time? I want to see the md5 checksum of the written random data when dd finishes. Also I want to see the progress while writing to the disk.
I have read this post and I created this command:
pv /dev/urandom >(md5sum) > /dev/sdXXX
The problem is it fills up my whole RAM. I got 32GB RAM.
badblocks -w -s
instead? It does a write to each block followed by a read and a compare and will show progress of the scan. – doneal24 Dec 24 '22 at 20:48