Tag: synology

  • rsync: File name too long (36) when moving data towards Synology NAS

    Likely this is because your filenames are too long, over 255 bytes. However, if you have enabled encryption on your shares in Synology, that limit is lowered to 143 bytes, which is much easier to hit.

    Longer explanation

    eCryptfs, which Synology uses for encrypted shares, must keep encrypted filenames within the underlying filesystem’s 255-byte limit, but encryption adds padding and metadata and then expands further due to Radix-64 Uuencoding. Because these transformations increase size significantly, the original plaintext-filename is limited to about 143 bytes to ensure the final encoded name never exceeds 255 bytes. The recommendation of the developers of eCryptfs actually suggests a limit of 140 bytes.

    I specifically noticed this problem when moving around data from an encrypted TrueNAS setup to an encrypted Synology share via rsync+ssh. Because TrueNAS uses ZFS’ encryption feature, it does not have this constraint.

    Special attention required when copying with rsync -v

    When copying with rsync -v, the output is very verbose and it is easy to miss copy errors due to long filenames. Taking this further, there is a high chance for data loss when no special attention is applied. If you need to rsync -v, make sure to also do a second run without -v to really only see the errors listed.

    Solution 1

    Create a new share without encryption and copy over all files with the tool of your choice. Then merge your data towards the Synology NAS’ unencrypted share.

    Solution 2

    Shorten your filenames.