When using restic for backups and restores, you may encounter issues where certain files are not restored, accompanied by error messages suggesting filenames are too long, even when they don’t exceed the ext4 filename limit of 255 bytes. This can be confusing and frustrating. If you’re experiencing this problem, it’s worth checking if you chose to encrypt your home directory during the Linux installation process. Many distributions, including Linux Mint, use eCryptfs for home directory encryption. While ext4 allows filenames up to 255 bytes, eCryptfs has a more restrictive limit of 143 characters for filenames.
As a result, files with names longer than 143 characters may fail to restore within the encrypted home directory, even though they’re within the ext4 limits. To resolve this issue, you have two main options:
- Shorten the filenames of the affected files to stay within the 143-character limit.
- Extract the backup outside of your encrypted home directory, where the eCryptfs limitations don’t apply.