Enabling deduplication on a Synology NAS
Configuring DSM 7.4 storage efficiency on a Btrfs volume, and understanding the risks of an unofficial script with third-party drives.
With DSM 7.4, Synology groups deduplication and compression under the name storage efficiency. On a compatible Btrfs volume, that feature can reduce the space actually used when many data blocks are identical.
This guide first explains the official method, then clearly sets out the risks of a community script aimed at models or drives that DSM does not recognise as compatible.
What deduplication does
File deduplication only removes perfectly identical copies. Block deduplication goes further: it splits the files, compares the blocks and keeps a single copy of each identical block. The files concerned keep pointing to that single block.
The gain is often worthwhile for virtual machines, repetitive backups, system images or several environments sharing the same libraries. It will be small for photos, videos, compressed archives or encrypted data, because their content holds few genuinely identical blocks.
SSD and HDD: two different behaviours
In DSM 7.4, deduplication of a compatible SSD volume is enabled at volume level. For a compatible HDD pool, storage efficiency works as post-processing and is set per shared folder. DSM then offers three modes:
- deduplication and compression;
- deduplication only;
- compression only.
HDD post-processing mainly targets archives and rarely modified data. Deduplication adds computation and can fragment the physical data: schedule it outside busy hours and measure performance before applying it widely.
Checks before enabling
- The volume must use Btrfs, be healthy and have enough free space.
- Enable the detailed storage usage analysis when DSM asks for it.
- Check the exact compatibility of the model, the drives and the DSM version in the Synology documentation.
- For full Btrfs deduplication, plan for at least 16 GB of memory. The reduced mode of the community script announces a 4 GB minimum, but offers fewer functions.
- Make a complete backup before any change, especially if you are considering the unofficial method.
Some data is not processed, in particular encrypted shared folders, Hybrid Share, certain package folders and blocks still referenced by snapshots. A long snapshot retention can therefore limit the observed gain.
Unsupported cases: the community script
The open source project Synology_enable_Deduplication tries to enable the capabilities hidden by DSM on certain models or with third-party drives. The --hdd option adds hard-drive support on compatible DSM versions.
Installing and scheduling the script
- Download the latest Source code archive from the releases of the GitHub repository.
- Extract it into a folder reserved for scripts, for example
/volume1/scripts. - In File Station, open the properties of
syno_enable_dedupe.shand note its real path.
Then open Control Panel → Task Scheduler, then Create → Triggered Task → User-defined script.
Name the task Deduplication, choose the root user and the Shutdown event. Under Task Settings → User-defined script, enter your path followed by --hdd:
/volume1/scripts/syno_enable_dedupe.sh --hdd
Save the task, select it and choose Run once. Read the script output, restart the NAS, then check that the storage efficiency option appears. After each DSM update, check the compatibility of the latest version of the script and run it again if needed.
To restore the original settings, use the --restore option (or -r), then restart:
/volume1/scripts/syno_enable_dedupe.sh --restore
Enabling storage efficiency
After the restart, open Storage Manager → Storage, select the volume, open the three-dot menu, then choose Configure storage efficiency. On an officially compatible configuration, that same setting is available without installing the script.
Select the mode and, on HDD, the shared folders to process. Start with an archive folder, so you can measure the gain and the impact before widening the scope.
A change of mode applies to new writes: data already present keeps its state until it is rewritten. Then start the analyser or the storage efficiency task and follow the space saved in Storage Manager.
Which mode to choose?
- Deduplication only: a good first test for repetitive backups, system images or virtual machines.
- Compression only: relevant for logs, text documents and cold archives that are not yet compressed.
- Deduplication and compression: the highest potential gain, but also the heaviest processing; validate it on a limited scope.
Avoid starting with very busy shares. Pick a representative folder, measure the capacity gained, the response times and the duration of the processing, then widen the scope only if the result is genuinely worthwhile.
In short
The deduplication of DSM 7.4 can be effective when the data holds many identical blocks. On an officially supported configuration, enable it straight from Storage Manager. The community script remains a workaround reserved for users who accept its compatibility and maintenance risks.
Discussion
Comments
No comment yet. Feel free to open the discussion with a question or your own experience.
Signing in keeps the discussion free of spam and avoids publishing your e-mail address.
Sign in to comment →