You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
3.5 KiB

4 years ago
# Synology HDD db
4 years ago
<a href="https://github.com/007revad/Synology_HDD_db/releases"><img src="https://img.shields.io/github/release/007revad/Synology_HDD_db.svg"></a>
4 years ago
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2F007revad%2FSynology_HDD_db&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false"/></a>
### Description
4 years ago
Add your HDD, SSD, SAS and NVMe drives to your Synology's compatible drive database.
4 years ago
The script works in DSM 7 and DSM 6.
#### What the script does:
4 years ago
* Gets the Synology NAS model and DSM version (so it knows which db files to edit).
4 years ago
* Gets a list of the HDD, SSD and NVMe drives installed in your Synology NAS.
4 years ago
* Gets each drive's model number and firmware version.
4 years ago
* Backs up the database file if there is no backup already.
4 years ago
* Checks if each drive is already in the Synology's compatible-drive database.
* Adds any missing drives to the Synology's compatible-drive database.
4 years ago
* Prevents DSM auto updating the drive database.
* Optionally disable DSM's "support_disk_compatibility".
* Reminds you that you may need to reboot the Synology after running the script.
4 years ago
**Planned updates:**
* Detect any connected expansion units and get the model(s) and edit the correct expansion unit db files.
* Or add support for users to specify their expansion unit model(s) as arguments.
* Or maybe use the shotgun approach and update all expansion unit db files.
4 years ago
* Add support for M.2 SATA and NVMe drives on a Synology PCIe card like the M2D17.
4 years ago
4 years ago
### When to run the script
DSM updates wil almost certainly overwrite the drive-compatibility database files so you may need to run the script after every DSM update. You would also have to re-run the script after DSM downloads a newer version of the drive-compatibility database, which can happen between DSM updates. 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.
4 years ago
**Note:** 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 2 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.
* -force or -f to disable "support_disk_compatibility". This should 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".
4 years ago
### Scheduling the script in Synology's Task Scheduler
See <a href=how_to_schedule.md/>How to schedule a script in Synology Task Manager</a>
### Running the script via SSH
4 years ago
4 years ago
You run the script in a shell with sudo or as root.
4 years ago
```YAML
sudo /path-to-script/syno_hdd_db.sh
```
**Note:** Replace /path-to-script/ with the actual path to the script on your Synology.
4 years ago
<p align="leftr"><img src="images/syno_hdd_db2.png"></p>
4 years ago
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.
<p align="leftr"><img src="images/syno_hdd_db.png"></p>
4 years ago
**Credits**
The idea for this script came from a comment made by Empyrealist on the Synology subreddit.
4 years ago
Thanks for the assistance from Alex_of_Chaos on the Synology subreddit.