- Added support for M.2 drives on a PCI card (M2Dxx and E10G18-T1 and future models).
- Improved flags/options checking and added usage help.
- Can now download the latest script version for you (if you have user home service enabled in DSM).
v2.2.18
- Minor shell output formatting fix.
v1.2.17
- Added disable support memory compatibility option --ram or -r
v1.2.16
- Changed to show the script version, Synology model and DSM version on each run to make it easier to debug any user's issues.
v1.2.15
- Now finds your expansion units' model numbers and adds your drives to their db files.
- Now adds your M.2 drives to your M.2 PCI card's db files (supports M2Dxx and E10M20-T1 and future models with similar model names).
- Improved flags/options checking and added usage help (-h or --help) and version info (-v or --version).
- Can now download the latest script version for you (if you have 'user home service' enabled in DSM).
- Now adds 'support_m2_pool="yes"' line for models that don't have support_m2_pool in synoinfo.conf
- To (hopefully) prevent losing your SSH created M2 volume when running this script on models that DSM 7.2 Beta does not list as supported for creating M2 volumes.
- Changed Synology model detection to be more reliable (for models that came in different variations).
- Added removal of " 00Y" from end of Samsung/Lenovo SSDs to fix issue #13.
- Changed Synology NAS model detection to be more reliable (for models that came in different variations and report extra text after model). issue #2 and issue #10
- Changed checking drive_db_test_url setting to be more durable.
- Fixed bug where removable drives were being added to the drive database.
- Fixed bug where "M.2 volume support already enabled" message appeared when NAS had no M.2 drives.
Add your SATA or SAS HDDs and SSDs plus SATA and NVMe M.2 drives to your Synology's compatible drive databases, including your M.2 card and Expansion Unit databases.
The script works in DSM 7 and DSM 6.
#### What the script does:
* Gets the Synology NAS model and DSM version (so it knows which db files to edit).
* Gets a list of the HDD, SSD, SAS and NVMe drives installed in your Synology NAS.
* Gets each drive's model number and firmware version.
* Backs up the database files if there is no backup already.
* Checks if each drive is already in the Synology's compatible-drive database.
* Adds any missing drives to the Synology's compatible-drive database.
* Checks that M.2 volume support is enabled (on supported models).
* Makes DSM recheck disk compatibility so rebooting is not needed (DSM 7 only).
* Reminds you that you may need to reboot the Synology after running the script (DSM 6 only).
* Checks if there is a newer version of this script and offers to download it for you.
* The new version available messages time out so they don't prevent the script running if it is scheduled to run unattended.
**Planned updates:**
* Allow unsupported M.2 drives for use as volumes in DSM 7.2 (for models that supported M.2 volumes).
### Download the script
See <ahref=images/how_to_download.png/>How to download the script</a> for the easiest way to download the script.
### When to run the script
You would need to re-run the script after a DSM update. If you have DSM set to auto update the best option is to run the script every time the Synology boots, and the best way to do that is to setup a scheduled task to run the the script at boot-up.
**Note:** For DSM 6, after you first run the script you may need to reboot the Synology to see the effect of the changes.
### Options when running the script
There are optional flags you can use when running the script:
* --showedits or -s to show you the changes it made to the Synology's compatible-drive database.
* --noupdate or -n to prevent DSM updating the compatible drive databases.
* --m2 or -m to prevent processing M.2 drives.
* --force or -f to disable "support_disk_compatibility". This should only be needed if any of your drives weren't detected.
* If you run the script without --force or -f it will re-eanble "support_disk_compatibility".
* --ram or -r to disable "support_memory_compatibility".
* If you run the script without --ram or -r it will re-eanble "support_memory_compatibility".
If you run the script with the -showedits flag it will show you the changes it made to the Synology's compatible-drive database. Obviously this is only useful if you run the script in a shell.
```YAML
sudo /path-to-script/syno_hdd_db.sh -showedits
```
**Note:** Replace /path-to-script/ with the actual path to the script on your Synology.