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.

127 lines
7.4 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>
3 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=views&edge_flat=false"/></a>
4 years ago
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/007revad)
3 years ago
[![committers.top badge](https://user-badge.committers.top/australia/007revad.svg)](https://user-badge.committers.top/australia/007revad)
3 years ago
<!-- [![committers.top badge](https://user-badge.committers.top/australia_public/007revad.svg)](https://user-badge.committers.top/australia_public/007revad) -->
<!-- [![committers.top badge](https://user-badge.committers.top/australia_private/007revad.svg)](https://user-badge.committers.top/australia_private/007revad) -->
4 years ago
<!-- [![Github Releases](https://img.shields.io/github/downloads/007revad/synology_hdd_db/total.svg)](https://github.com/007revad/Synology_HDD_db/releases) -->
4 years ago
### Description
3 years ago
Add your SATA or SAS HDDs and SSDs plus SATA and NVMe M.2 drives to your Synology's compatible drive databases, including your Synology M.2 PCIe card and Expansion Unit databases.
4 years ago
3 years ago
The script works in DSM 7, including DSM 7.2, and DSM 6.
4 years ago
It also has a restore option to undo all the changes made by the script.
4 years ago
4 years ago
#### 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, SAS 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 files 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".
3 years ago
* Optionally disable DSM's "support_memory_compatibility" to prevent <a href=images/ram_warning.png/>non-Synology memory notifications</a>.
4 years ago
* Optionally edits max supported memory to match the amount of memory installed, if installed memory is greater than the current max memory setting.
3 years ago
* Enables M2D20, M2D18, M2D17 and E10M20-T1 if present on Synology NAS that don't officially support them.
4 years ago
* Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots).
4 years ago
* Enables creating M.2 storage pools and volumes from within Storage Manager **(newer models only?)**.
3 years ago
* Including M.2 drives in PCIe adaptor cards like M2D20, M2D18, M2D17 and E10M20-T1 **(need to run script after each boot)**.
* Makes DSM recheck disk compatibility so rebooting is not needed if you don't have M.2 drives (DSM 7 only).
* **If you have M.2 drives you may need to reboot.**
3 years ago
* Reminds you that you may need to reboot the Synology after running the script.
* 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.
4 years ago
4 years ago
### Download the script
4 years ago
See <a href=images/how_to_download.png/>How to download the script</a> for the easiest way to download the script.
4 years ago
3 years ago
Do ***NOT*** save the script to a M.2 volume. The M.2 volume won't be available until after the script has run.
4 years ago
### When to run the script
3 years ago
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 <a href=how_to_schedule.md/>setup a scheduled task</a> 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.
4 years ago
3 years ago
### Options when running the script <a name="options"></a>
4 years ago
There are optional flags you can use when running the script:
3 years ago
```YAML
3 years ago
-s, --showedits Show edits made to <model>_host db and db.new file(s)
-n, --noupdate Prevent DSM updating the compatible drive databases
-m, --m2 Don't process M.2 drives
-f, --force Force DSM to not check drive compatibility
-r, --ram Disable memory compatibility checking (DSM 7.x only),
and sets max memory to the amount of installed memory
-w, --wdda Disable WD WDDA
-e, --email Disable colored text in output scheduler emails.
--restore Undo all changes made by the script
--autoupdate=AGE Auto update script (useful when script is scheduled)
AGE is how many days old a release must be before
auto-updating. AGE must be a number: 0 or greater
-h, --help Show this help message
-v, --version Show the script version
3 years ago
```
4 years ago
4 years ago
**Note:** If you have some Synology drives and want to update their firmware run the script **without** --noupdate or -n then do the drive database update from Storage Manager and finally run the script again with your preferred options.
4 years ago
4 years ago
### Scheduling the script in Synology's Task Scheduler
3 years ago
See <a href=how_to_schedule.md/>How to schedule a script in Synology Task Scheduler</a>
4 years ago
### Running the script via SSH
4 years ago
4 years ago
You run the script in a shell with sudo -i or as root.
4 years ago
```YAML
4 years ago
sudo -i /path-to-script/syno_hdd_db.sh -nr
4 years ago
```
**Note:** Replace /path-to-script/ with the actual path to the script on your Synology.
<p align="leftr"><img src="images/syno_hdd_db1.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.
4 years ago
```YAML
sudo -i /path-to-script/syno_hdd_db.sh -nr --showedits
4 years ago
```
**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**
4 years ago
- The idea for this script came from a comment made by Empyrealist on the Synology subreddit.
- Thanks for the assistance from Alex_of_Chaos on the Synology subreddit.
4 years ago
- Thanks to dwabraxus and aferende for help detecting connected expansion units.
4 years ago
- Thanks to bartoque on the Synology subreddit for the tip on making the script download the latest release from github.
4 years ago
- Thanks to nicolerenee for pointing out the easiest way to enable creating M.2 storage pools and volumes in Storage Manager.
**Donators**
3 years ago
Thank you to the following PayPal donators, GitHub sponsors and hardware donators
| | | | |
|--------------------|--------------------|----------------------|----------------------|
3 years ago
| | | | Matthias Gerhardt |
3 years ago
| Darryl Harper | Mikescher | Matthias Pfaff | cpharada |
3 years ago
| Neil Tapp | zen1605 | Kleissner Investments | Angel Scandinavia |
| bcollins | Peter jackson | Mir Hekmat | Andrew Tapp |
| Peter Weißflog | Joseph Skup | Dirk Kurfuerst | Gareth Locke |
| Rory de Ruijter | Nathan O'Farrell | Harry Bos | Mark-Philipp Wolfger |
| Filip Kraus | John Pham | Alejandro Bribian Rix | Daniel Hofer |
| Bogdan-Stefan Rotariu | Kevin Boatswain | anschluss-org | Yemeth |
| Patrick Thomas | Manuel Marquez Corral | Evrard Franck | Chad Palmer |
| 侯​永政 | CHEN​HAN-YING | Eric Wells | Massimiliano Pesce |
| JasonEMartin | Gerrit Klussmann | Alain Aube | Robert Kraut |
| Charles-Edouard Poisnel | Oliver Busch | anonymous donors | private sponsors |