Is a tool available to check the integrity of copied files?

Colin Law clanlaw at gmail.com
Fri Apr 14 21:21:47 UTC 2023


On Fri, 14 Apr 2023 at 22:17, Ralf Mardorf via ubuntu-users
<ubuntu-users at lists.ubuntu.com> wrote:
>
> Hi,
>
> I've done some googling for "does linux diff compare data using a cache"
> to figure out what's going on. The first diff of 10 GiB of
> data copied from a SATA3 SSD to an USB 2 stick connected to an USB 3
> port took around a minute, right after the copy finished. A second diff
> needed 3 seconds. Both returned exit status 0.
>
> It's impossible to read 10 GiB of data in 3 seconds from an USB 2 stick.
> Does diff use cached data instead of comparing the "real" files line by
> line?

You could unmount the stick and mount it again. Then do the diff. In
fact if you want to be certain you should power down the stick and
power it up again, otherwise it may be cached in RAM on the stick
rather than being read from the flash.

Colin



More information about the ubuntu-users mailing list