When a copy of a file is made, the copy is exactly the same as the original (assuming that there were no errors during the copy). This is true whether the file is copied to another location on the same device or to a different device.
The copy might have a different filename, or maybe a different timestamp or different permissions, but the contents are identical.
This can be verified by running some sort of checksum or hashing algorithm (e.g. md5sum
) on the original and the copy.
For example:
$ cp original /tmp/thecopy
$ md5sum original /tmp/thecopy
93d9d61139ff5f1287764f1c1994cbe3 original
93d9d61139ff5f1287764f1c1994cbe3 /tmp/thecopy
Both files have the exact same md5sum. original
was stored on an NVME. /tmp/
is a ramdisk.
It is technically possible for two different files to have the same md5sum
. The probability of that happening is extremely low. md5sum
is mostly "good enough" for many simple purposes, but most people use & recommend stronger hashing methods these days to reduce the probability even further. Here's what sha512sum
has to say about the same-ness of the files.
$ sha512sum original /tmp/thecopy
5ba61d6f2a883c3afebc949b0f0d0a1c020498a1052771de98e6e1bbb42d438a0a53f49f381a2e1311c1bdf82a0cea9de646fc03c529fcb6fca0ab6476badf35 original
5ba61d6f2a883c3afebc949b0f0d0a1c020498a1052771de98e6e1bbb42d438a0a53f49f381a2e1311c1bdf82a0cea9de646fc03c529fcb6fca0ab6476badf35 /tmp/thecopy
again, identical.
What do you mean by "the same"? A perfect clone there is no difference.
– johnf May 21 '21 at 13:21copy
is not the same. That's all the unknown developer said. You can ask him a question yourself maybe he will write you back more, his site is rixstep.com. @cas you read his answer here and he said that it is technically possible withmd5sum
to have 2 different files, despite having the same checksum. The principle should then also apply to other hash algorithms. – johnf May 21 '21 at 14:15cp
has some options to help, but the best forensic move is to start with a bit-for-bit copy of the whole volume, withdd
or similar. – waltinator May 21 '21 at 16:36