Problem/Justification
The current p7zip (v16.02) included in TrueNAS SCALE is a community fork that has been unmaintained since 2016. It suffers from significant limitations in modern Linux environments, specifically:
-
Incomplete POSIX Support: Users frequently encounter
E_NOTIMPL(Error: Not Implemented) when attempting to use advanced flags like-sni(store security information/permissions) or-snh(store hard links), which are critical for data-consistent backups. -
Wildcard Inconsistency: The exclusion logic (
-xr!) in v16.02 is buggy and often fails to match paths correctly, leading to bloated backups containing temporary or versioning metadata (e.g., Syncthing’s.stversions). -
Performance Gap: It lacks optimizations for modern instruction sets (like the latest AVX2/AES-NI implementations) available in the official 7-Zip Linux port.
Impact
Switching to the official 7zip provides several key benefits:
-
Reliability: Full support for POSIX permissions and symbolic/hard links, ensuring that restored data maintains its original ownership and attributes.
-
Compatibility: Better interoperability with Windows 7-Zip clients, especially when using AES-256 encryption and Header Encryption (
-mhe=on). -
Efficiency: Improved multi-threading performance on modern multi-core CPUs (e.g., Intel 12th/13th Gen).
-
Maintenance: Leverages the upstream maintenance by Igor Pavlov, the original 7-Zip creator.
User Story
A user wants to automate a secure, encrypted backup of their Syncthing data directory to a remote location.
-
The user writes a script using the command
7z a -p -mhe=on -sni -snh backup.7z /mnt/pool/syncthing. -
Unlike the old
p7zip, the process completes successfully withoutE_NOTIMPLerrors, and all folder permissions are preserved. -
The user can then move this
.7zfile to a Windows machine and extract it using the latest 7-Zip GUI, maintaining a seamless cross-platform workflow. -
In a disaster recovery scenario, the user restores the file back to TrueNAS, where all original Linux UIDs/GIDs are perfectly intact, allowing Docker containers to restart without permission issues.
