Leaving this as a note to posterity, and possibly to save my own sanity at some future date.

TLDR: Don’t host SAMBA shares on an ExFAT volume.

At the church which I now pastor (wait…when did that happen?!), we use an RPi4 to host a few simple server tasks–among them, a SAMBA share which we use as a local backup for specific media files on our production team. Things had been working well, but last week I tried to back up a few video files which totaled up to around ~90GB, and my Windows 11 laptop kept throwing an error. It would show no progress, hang for a few minutes, and then spit out the following error code:

Cryptic Windows 11 Errors…

“An unexpected error is keeping you from copying the file. If you continue to receive this error, you can use the error code to search for help with this problem.

Error 0x8007003B: An unexpected network error occurred.”

The strange thing is, if I ssh’d into the pi in order to monitor the file transfer…the file size on the pi kept on growing for a few minutes after Windows returned an error and told me it had quit trying! I initially suspected the Windows BITS service, but that line of troubleshooting led nowhere. Network stability was great, and a test with a different network interface from my laptop led to no solution either.

I began digging into the weeds of my SAMBA configuration, and then found something even more baffling: If I created a SAMBA share on the SD card from which the pi was booting, I could transfer those same video files from my Windows laptop to the pi with no issue whatsoever. That did nudge me toward the solution though: What was different about the USB drive which housed my problematic SAMBA share directory? Drumroll, please………………………………………

Turns out, I had formatted the USB disk as ExFAT just in case I ever wanted to pop it out of the Pi and plug it straight into my laptop. After a little more digging, I finally discovered that ExFAT does not support sparse files…which SAMBA seems to require when writing a large file, in order to allocate enough space for the final file size!

I backed up all my data, reformatted the drive as Ext4, fixed a new bug in /etc/fstab, and things now appear to be working properly.

Bottom line: Don’t host SAMBA shares on an ExFAT volume!