1

Problem: sometimes finder corrupts my files when copying to external ssd.

Reproduction methodology: copy via finder file to external ssd, then check this file

md5 -q ~/Downloads/path/to/source
md5 -q /Volumes/path/to/target

and sometimes hashsum does not match.

I`ve written a bash script to reproduce this problem with terminal cp, and its worked nicely without corrupting files

Script Github Gist

How i can understand what happened with finder and where is the bug?

  • MacOs: 12.3.1
  • Ssd: wd green (not sure about model), Disk utility first aid dont get any error. Ssd format - exFat

PS: I`ve also tested this case on windows copy, no errors for 20+ files.

PPS: Same issue on reddit (if we can solve this - can someone who has reddit account, link this thread for them)

16
  • Can you elaborate on what kind of file you're seeing this issue with? - Is it a JPEG picture, an .docx Word document, or what is it? .... If you're seeing this issue with multiple file types, please mention those that you have seen it occur for.
    – jksoegaard
    May 15, 2022 at 22:16
  • Check the size of the files. It may be because you are copying from APFS to exFat which could change the size of block . To be sure the file is corrupt, copy it back to your Mac and redo the md5.
    – Ptit Xav
    May 15, 2022 at 23:31
  • 2
    @PtitXav No, that's not true. Differences in block sizes will not give different MD5s.
    – jksoegaard
    May 15, 2022 at 23:36
  • ExFAT is likely to be discarding perms, ACLs & other attributes. idk for sure, but that may be affecting it. Try zipping it first.
    – Tetsujin
    May 16, 2022 at 6:21
  • 1
    @Tetsujin metadata doesn't affect a file's checksum. May 16, 2022 at 6:53

4 Answers 4

1

I had exactly the same problem as the OP with files being corrupted by Finder as they were copied to an attached USB disk and started a thread on the Apple Support Community https://discussions.apple.com/thread/253864981 to document and discuss it.

The OP didn't say where their problem files were coming from but my guess is QBitTorrent.

If you follow through this thread https://github.com/qbittorrent/qBittorrent/issues/16843 on Github, it appears to have been caused by an update to QBitTorrent that was not flushing memory mapped files to disk correctly in OSX. Upgrading to the latest QBitTorrent version - 4.4.5 - should fix it.

Yes, it's a really weird problem and the fix seems unrelated, but in this case I think it is the correct answer to the OP's problem. It worked for me.

1
0

Most likely your problems is either caused by (a) a hardware defect, or (b) Finder updating metadata (stored inside your file) on copy.

For (a) this could be caused by problems with the SSD itself and/or the cable connecting it to the computer. There are various checksums in place during such a transfer, but ordinary USB mass storage does not guard against all types of failure, and Finder does not do a full read of the copied file to determine if the copy succeeded without errors.

You could try to rule out (a) by attempting the same copy with a different external disk and cable.

For (b) it is worth noting that some file types store metadata inside the files themselves (most commonly seen by end-users handling videos and photos). It might be that something you're doing triggers Finder to update such a metadata entry. This does not mean that the file is "corrupted" even though it is different than the original - although it might not be what you intended to happen.

7
  • Files really corrupted, my tv shows artifacts on play. (sound stuks, image blocks falling apart). Its not only md5 mismatch. Cable or ssd its ok. Windows copy works fine, terminal cp/cv/rsync also works fine unlike finder copy.
    – dez64ru
    May 16, 2022 at 10:26
  • Maybe this comment will reveal the exact essence of the problem. On mac, source file - its ok, vlc play smoothly. On mac, copy of file on external drive - vlc play stucks. On mac, copied back from ext to internal drive - vlc also play stuck. Tv, copy of file - also stucks.
    – dez64ru
    May 16, 2022 at 11:24
  • Would it be possible for you to upload the original and the corrupted file to a file sharing service so that we can compare? - I.e. the test file I sent you earlier that you say also corrupts (120 MB file as far as I remember)
    – jksoegaard
    May 16, 2022 at 12:17
  • Thanks - quite interesting... almost all of those two files are identical - but near the beginning of the file, the copy has an extra section added that is almost entirely filled with zeroes except for the first ~212 bytes. It doesn't look like it was added by purpose as the resulting file is invalid. An MKV file contains various checksums internally, and they're no longer valid.
    – jksoegaard
    May 16, 2022 at 21:33
0

Just wanted to add that I am also having a very similar issue on a 2018 Mac Mini running macOS 12.0.1. My drives are all formatted as exFAT. I have not tried the Terminal command but going to try that this week.

The issue only started happening recently, maybe a few months ago. I can reproduce the issue on over 6+ drives. I have tried different HDD adapter cables. I have an NVME drive in a USB3 external enclosure that reproduces the problem. Copying from my home Windows machine and my Raspberry Pi 4, everything is fine.

The issue seems to be restricted to copying the files over USB on my Mac. I am using the Finder to drag and drop. The original video files look fine on the Mac, but after copying to an external drive now many have video tearing, sound issues, artifacts, etc. Very rarely some files are fine but it's few and far between.

0

I am also experiencing the same issue on a 2015 15" MBP. Files downloaded to internal SSD are fine with no errors. When I use finder to drag and drop to external HDD I often encounter small segmental errors (image becomes blocky and/or stops whilst file/audio continues to play). I have tested this on 2x HDD and separate USB cables in seperate USB inputs on my MBP and have the same issue suggesting it is not a problem with either the HDD or cables. I have found that restarting the computer sometimes fixes the problem temporarily, however the issue returns if my MBP is left on for extended periods of time. This has happened in MacOS 12.3 and 12.4. I am currently updating to 12.5 in the hope that this fixes the issue.

2
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
    – mmmmmm
    Aug 10, 2022 at 11:18
  • Just to add to this, I have found this thread which seems to be the same issue. It appears to be a problem with Finder corrupting the files when copy and pasting. I have now installed Commander One to handle file transfers until this problem is fixed by apple. discussions.apple.com/thread/253864981?page=1 Aug 10, 2022 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .