Files corrupt when copying to USB3 attached Storage

  • Up to now, I had several external HDD's in Sabrent USB enclosures. I recently purchased an IcyDock 4 drive USB3 enclosure and have moved my drives over to that enclosure. While the drive was attached to my Mac, I copied quite a few large video (.mkv) files to the drives and they all appear to be fine. Playback on LibreElec is no problem.

    This drive is now attached to my Libreelec 8.2.5 system via USB3 and I have noticed that every large file that I copy over to the Samba mounted shares gets a few corrupted spots causing Libreelec to crash while playing the file back. The files that were copied previously are fine, but any network copied files have corruption.

    This has been tested with several files and always the same results. About every 10-15 minutes of playback, there is a bad spot in the mkv file, which does not exist in the original file.

    Can anyone suggest what might be going on here? Happy to provide logs, traces, etc - just explain what is needed.

    Thanks

  • Ok, I upgraded to the milhouse 06/30 version and did some more testing. Problem is still there and maybe worse.

    This time, I notice that while copying three files to the drive, that it actually merged a few seconds of video from one file into the other in one spot. Other areas were just plain corrupted.

    The problem is intermittent, and video is good throughout out except for maybe 4 or 5 spots (about 15-20 minutes apart) where the video gets corrupted for about 15 seconds worth of video.

  • Good suggestion and I have checked the MD5's of three different (corrupt) video files. They are all different, so definitely a corruption problem, rather than playback.

    This is a new 4 bay (non-raid) external USB3 drive bay from IcyDock. When videos are copied from the Mac to the directly attached USB drives (connected to USB3, via lightning bolt connector on Mac) - I have no corruptions issues.

    When I move the IcyDock drive bay to the LibreElec system and do a network copy, the files are always corrupted in spots. Very intermittent about 10 to 15 (or more) minutes apart. Each corrupted area effects approx 30 seconds of the video.

    • Official Post

    Boot up another Linux distro and connect the drive bay and copy files. If you see similar issues it's likely a problem with the drive bay. If you don't see the same problems it's something freaky with LE, but the challenge will be identifying what. Unless there are error messages in dmesg that correspond to the corruptions there is really nothing to go on, and this is the first time I hear of something like this.

  • USB storage devices not behaving as they should is unfortunately not too uncommon - see the unusual_* files in the linux kernel: linux/drivers/usb/storage at master · torvalds/linux · GitHub

    Please post your dmesg after an error has occurred - there should be some hints in it what went wrong.

    You can then try to enable various quirks, add "usb-storage.quirks=XXXX:YYYY:Z" to the APPEND line in syslinux.cfg and check if they resolve your issues. Details about the available quirks are in the kernel documentation - look for usb-storage.quirks here: The kernel’s command-line parameters — The Linux Kernel documentation

    As a wild guess you could try to disable UAS mode (quirk "u") and/or limit the number of sectors to transfer at a time (quirks "g" or "m").

    so long,

    Hias