Unlocking Synology NAS HDD Compatibility: A Deep Dive into the Synology_HDD_db Script
In the realm of data storage, Synology NAS devices have gained widespread popularity due to their robust performance and extensive features. However, some users encounter compatibility issues with hard drives, which can affect storage efficiency and even pose risks to data security. Today, let’s delve into a powerful tool called the Synology_HDD_db script, designed to address these compatibility challenges.
Getting to Know the Synology_HDD_db Script
The Synology_HDD_db script is a specialized tool for Synology NAS devices, enabling users to add SATA or SAS HDDs, SSDs, and SATA and NVMe M.2 drives to Synology’s compatible drive databases. This includes databases for Synology M.2 PCIe cards and expansion units. The script is compatible with DSM 7 (including DSM 7.2) and DSM 6, offering a comprehensive solution for drive compatibility.
Core Features of the Script
Intelligent Detection and Backup
Upon execution, the script first identifies the Synology NAS model and DSM version to pinpoint the relevant database files for editing. It then detects all HDDs, SSDs, SAS, and NVMe drives installed in the NAS, retrieving their model numbers and firmware versions. Before making any changes, the script checks for existing backups and creates one if none are found, ensuring a safety net for subsequent operations.
Precise Addition and Compatibility Optimization
The script compares the detected drives against Synology’s official compatible drive database. It identifies and adds any drives missing from the database, effectively resolving compatibility issues. Additionally, users can opt to prevent DSM from automatically updating the drive database, safeguarding their custom compatibility settings.
Performance Enhancement and Customization
-
Memory Compatibility Optimization: The script can disable DSM’s memory compatibility checks (for DSM 7.x) and adjust the maximum memory setting to match the actual installed capacity. This is particularly beneficial for users with non-Synology memory, eliminating compatibility warnings and improving system performance. -
Write Optimization: By enabling the write_mostly parameter for internal HDDs, DSM prioritizes reading from internal SSDs. Users can either let the script automatically detect and set internal SSDs as preferred read drives or manually specify particular drives. This feature significantly boosts performance in hybrid storage environments. -
Western Digital Device Analytics (WDDA) Disable: For users with Western Digital (WD) drives, the script can disable WDDA to prevent false warnings about drives over three years old. This function is already enabled by default in DSM 7.2.1 and later.
Enhanced M.2 Device Support
The script activates M2D20, M2D18, M2D17, and E10M20-T1 devices on Synology NAS units that lack official support. For newer NAS models, the Synology_enable_M2_card script may also be required. It checks whether M.2 volume support is enabled and allows the creation of M.2 storage pools and volumes within Storage Manager in DSM 7.2 and later (for models with M.2 slots or PCIe slots). It also supports M.2 drives in PCIe adapters like M2D20, M2D18, M2D17, and E10M20-T1 for DSM 7.2 and above.
IronWolf Health Monitoring Update
For NAS devices with x86_64 CPUs, the script updates IronWolf Health Monitoring (IHM) to version 2.5.1, ensuring compatibility with the latest IronWolf and IronWolf Pro drives. It also attempts to install IHM on “22 series and newer models, though this feature remains untested.
System-Friendly and Auto-Update Capabilities
After running, the script prompts DSM to recheck disk compatibility, often eliminating the need for a reboot (unless M.2 drives are involved). It also includes an auto-update feature that checks for newer script versions and downloads them based on a user-defined age threshold (AGE parameter), ensuring users always have access to the latest features and improvements.
Downloading and Installing the Script
Download Methods
Users can download the latest version of the script in zip format from the GitHub releases page at https://github.com/007revad/Synology_HDD_db/releases. Save the zip file to a designated folder on the Synology NAS, avoiding M.2 volumes to prevent issues during DSM or Storage Manager updates. Extract the file to access the script.
SSH Download
Technically inclined users can download the script via SSH by connecting to their Synology NAS as a regular user and executing the following commands:
-
Navigate to the user’s home directory: cd $HOME
-
Download the script: wget https://github.com/007revad/Synology_HDD_db/archive/refs/heads/main.zip -O syno_hdd_db.zip
-
Extract the script: 7z x syno_hdd_db.zip
-
Access the extracted folder and list files: cd Synology_HDD_db-main && ls -ali
Required Files
Ensure the following files are in the same folder after download and extraction:
-
syno_hdd_db.sh: The main script file containing all core functionalities. -
syno_hdd_vendor_ids.txt: A file listing hard drive vendor IDs for accurate brand identification. -
dtc or a bin folder containing dtc: Required only if the user has E10M20-T1, M2D20, or M2D18 devices that are not officially supported by the NAS.
Running the Script and Parameter Options
When to Run the Script
Since DSM updates may reset the drive compatibility database, it is advisable to rerun the script after any DSM update. For users with DSM auto-updates enabled, setting up a scheduled task to run the script at startup is the best approach. Detailed instructions for creating scheduled tasks can be found in the How to Schedule a Script in Synology Task Scheduler guide (replace with the actual link).
Note that a reboot may be necessary after the first script execution to apply changes.
Parameter Options
The script offers a range of optional parameters to meet diverse user needs:
-
-s, –showedits: Displays modifications made to the _host database and db.new files. This is particularly useful when running the script via shell. -
-n, –noupdate: Prevents DSM from automatically updating the compatible drive database, preserving custom settings. -
-r, –ram: Disables memory compatibility checks in DSM 7.x and adjusts the maximum memory setting to match the installed capacity. This eliminates memory compatibility warnings for non-Synology memory. -
-f, –force: Forces DSM to bypass drive compatibility checks. Use this option only as a last resort, as it may disable data deduplication and firmware updates for Synology drives. -
-i, –incompatible: Marks incompatible drives as supported. Exercise caution with this option. -
-w, –wdda: Disables Western Digital Device Analytics (WDDA) to prevent false warnings for WD drives over three years old. This feature is already disabled in DSM 7.2.1 and later. -
-p, –pcie: Enables volume creation on M.2 drives in unknown PCIe adapters. -
-e, –email: Disables colored text in scheduler email outputs. -
-S, –ssd=DRIVE: Enables write_mostly mode for internal HDDs, prioritizing reads from internal SSDs. Users can let the script auto-detect internal SSDs or manually specify drives (e.g., –ssd=sata1 or –ssd=sata1,sata2). The –ssd=restore parameter resets drives to default settings. -
–restore: Reverts all changes made by the script except those related to the -S or –ssd option. To restore write_mostly settings as well, use –restore –ssd=restore. -
–autoupdate=AGE: Automatically updates the script. AGE specifies the minimum age (in days) a release must be before auto-updating. This is useful for scheduled runs. -
-I, –ihm: Updates IronWolf Health Management to version 2.5.1 for x86_64 CPU-based NAS devices, supporting the latest IronWolf and IronWolf Pro drives. It also installs IHM on “22 series and newer models, though this feature is untested. -
-h, –help: Displays the help message. -
-v, –version: Shows the script version.
Script Execution Examples
-
Running via SSH:
-
Enable SSH and log in to DSM via SSH (refer to How to Enable SSH and Log in to DSM via SSH for instructions). -
Run the script with root privileges in the shell: sudo -s /path-to-script/syno_hdd_db.sh -nr
(replace “/path-to-script/” with the actual script path on the Synology NAS).
-
-
Viewing Changes:
-
To see the script’s modifications to the compatibility database, add the –showedits parameter: sudo -s /path-to-script/syno_hdd_db.sh -nr --showedits
-
Scheduling Tasks in Synology’s Task Scheduler
For automated script execution, users can configure scheduled tasks in the Synology Task Scheduler to run the script at startup. Detailed instructions are available in the How to Schedule a Script in Synology Task Scheduler guide (replace with the actual link).
Troubleshooting Common Issues
File Format Issues
-
Error Messages: /usr/bin/env:‘bash\r’:No such file or directory
or the cursor remains unresponsive. -
Cause: The file uses Mac or Windows line endings. -
Solution: Re-download the latest zip file from https://github.com/007revad/Synology_HDD_db/releases, which uses Unix/Linux-compatible line endings.
Path and Permission Issues
-
Error Message:
No such file or directory
-
Possible Causes:
-
The downloaded zip or rar file is not saved to the Synology NAS folder. -
The zip or rar file is not extracted, and the script is run directly. -
The script path contains spaces and is not enclosed in double quotes. -
The script file lacks executable permissions.
-
-
Solutions:
-
Confirm that the file is saved to the correct Synology NAS folder. -
Extract the downloaded file and ensure the script being run is syno_hdd_db.sh. -
If the path contains spaces, enclose the path and script name in double quotes when executing, e.g., sudo -s "/volume1/my scripts/syno_hdd_db.sh -n"
. -
Set the script as executable: sudo chmod +x "/volume1/scripts/syno_hdd_db.sh"
.
-
Editing vendor_ids.txt
-
Issue: If DSM cannot recognize the brand of NVMe drives, they will appear as “Unknown brand” with “Unrecognized firmware version” in Storage Manager. The script will prompt users to add the missing vendor ID to syno_hdd_vendor_ids.txt. -
Solution: Follow the script’s instructions to add the vendor ID to syno_hdd_vendor_ids.txt, enabling DSM to correctly identify the NVMe drive brand.
Optimizing IronWolf Health Monitoring
IronWolf Health Monitoring (IHM) is a tool designed to monitor the health of Western Digital IronWolf drives. By updating IHM to version 2.5.1 via the Synology_HDD_db script, users can ensure compatibility with the latest IronWolf and IronWolf Pro models. For x86_64 CPU-based NAS devices and “22 series and newer models, the script also attempts to install IHM, though this feature is still under testing.
Contributors and Sponsors
The development of the Synology_HDD_db script is made possible by the collective efforts of numerous contributors and sponsors. From the initial idea sparked by a comment on the Synology subreddit to the technical assistance and suggestions from various experts, every line of code reflects the wisdom of the community. Additionally, the generous support of sponsors provides a solid foundation for the script’s ongoing development and maintenance. We extend our sincere gratitude to all contributors and sponsors.
Conclusion
The Synology_HDD_db script is a versatile tool for addressing hard drive compatibility issues on Synology NAS devices. Its rich feature set and user-friendly design make it an invaluable asset for users seeking efficient, stable data storage solutions. Whether resolving drive recognition issues, optimizing system performance, or enhancing data security, the script delivers exceptional results. However, as with any technical tool, cautious parameter configuration is essential to ensure system stability and data integrity. With continuous advancements in technology, the Synology_HDD_db script is poised to play an even more significant role in the storage landscape, bringing greater convenience and value to users.
In the ever-evolving digital era, data storage demands are growing increasingly complex. The Synology_HDD_db script exemplifies how open-source communities can drive innovation and address user pain points. By leveraging this script, Synology NAS users can overcome compatibility hurdles and unlock the full potential of their storage devices, ensuring seamless data management and storage experiences.