Calculate checksum while writing
Instead of reading through the whole file to calculate the checksum, then reading through the whole file again to write the disk, you can instead calculate the checksum while streaming the file in to write to the disk. You should only have to read the file once.. unless there is a good reason that you want to have the checksum before starting to write to the disk. If all you want the checksum for is to verify that the disk can be read back in correctly later it seems to me that it would be perfectly fine to just calculate the checksum as it's being read the first time.