Script for verification of Data corruption

Hi,

I am from File system back ground and doing File system testing on Linux, I need script that scirpt that create the different multiple types of .txt, device file and then copy to mount point /mnt/ dir and then verify the created files and copied files, if created files and copied files are same, then it means no data corruption.

thanks in advance
Manish

u can use diff command as well. if output of this command is nothing then both files are same

Hi Rohon,

Thanks, if I have to fill in dir /data/ with multiple files? How I will do it using the script and then data whole data I have to copied to /mnt/ mount point and then I have to do diff or sdiff to compate the files.

Do you have md5 command in your system?

it will save time if your data files are big.

find /OrigPath -type f -exec md5 {} \; |sort > md5.orig.file
find /Backpath -type f -exec md5 {} \; |sort > md5.backup.file
diff md5.orig.file md5.backup.file

Agreed rdcwayx - if no md5 you can also use (in order of preference) md5sum, cksum, sum.

cksum and sum are pretty dodgy and my give false positives they only calculate 16 bit checksums, but being POSIX you are most likley to have one of these.