Transfer the file, run SHA256 again. Any change indicates corruption.
defer f.Close() err = f.Truncate(50 * 1024 * 1024 * 1024) if err != nil panic(err)
Instead of copying real data, you can generate a sparse or dummy file almost instantly. This avoids wearing out SSDs with unnecessary writes.
Note: This may not work on some network file systems (like NFSv3) or older FS types.
Note: urandom is much slower than /dev/zero.
: Ensure your modem or router doesn't crash or drop packets when pushed to its limits over an extended period.
# Generate a 50 GB file named "testfile.dat" filled with zeros dd if=/dev/zero of=testfile.dat bs=1M count=51200
Transfer the file, run SHA256 again. Any change indicates corruption.
defer f.Close() err = f.Truncate(50 * 1024 * 1024 * 1024) if err != nil panic(err) 50 gb test file
Instead of copying real data, you can generate a sparse or dummy file almost instantly. This avoids wearing out SSDs with unnecessary writes. Transfer the file, run SHA256 again
Note: This may not work on some network file systems (like NFSv3) or older FS types. Transfer the file
Note: urandom is much slower than /dev/zero.
: Ensure your modem or router doesn't crash or drop packets when pushed to its limits over an extended period.
# Generate a 50 GB file named "testfile.dat" filled with zeros dd if=/dev/zero of=testfile.dat bs=1M count=51200