Browse Source

Merge pull request #533 from 007revad/main

sync from main
pull/537/head
Dave Russell 2 weeks ago
committed by GitHub
parent
commit
45a999e756
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      .gitattributes
  2. 3
      CHANGES.txt
  3. 2
      README.md
  4. 25
      syno_hdd_db.sh

2
.gitattributes

@ -106,3 +106,5 @@
.gitattributes export-ignore .gitattributes export-ignore
.gitignore export-ignore .gitignore export-ignore
.gitkeep export-ignore .gitkeep export-ignore
.github/ export-ignore
images/ export-ignore

3
CHANGES.txt

@ -1,3 +1,6 @@
v3.6.112
- Bug fix for DSM 7.3 and later where new database files have a space after each : and ,
v3.6.111 v3.6.111
- Added support for M.2 volumes for NVMe drives in PCIe adaptor cards for DSM 7.1.1 - Added support for M.2 volumes for NVMe drives in PCIe adaptor cards for DSM 7.1.1

2
README.md

@ -37,7 +37,7 @@ #### What the script does:
* Or you can tell the script which internal drive(s) DSM should read from. * Or you can tell the script which internal drive(s) DSM should read from.
* Optionally disables Western Digital Device Analytics (aka WDDA) to prevent DSM showing a [warning for WD drives that are 3 years old](https://arstechnica.com/gadgets/2023/06/clearly-predatory-western-digital-sparks-panic-anger-for-age-shaming-hdds). * Optionally disables Western Digital Device Analytics (aka WDDA) to prevent DSM showing a [warning for WD drives that are 3 years old](https://arstechnica.com/gadgets/2023/06/clearly-predatory-western-digital-sparks-panic-anger-for-age-shaming-hdds).
* DSM 7.2.1 already has WDDA disabled. * DSM 7.2.1 already has WDDA disabled.
* Makes DSM allow you to enable TRIM on 3rd party SSDs in 2025+ models. * Makes DSM allow you to enable TRIM on 3rd party SSDs in 2025+ models. Don't use the `-f` or --force` option if you want to enable SSD TRIM.
* Enables M2D20, M2D18, M2D17 and E10M20-T1 if present on Synology NAS that don't officially support them. * Enables M2D20, M2D18, M2D17 and E10M20-T1 if present on Synology NAS that don't officially support them.
* Newer NAS models may also need [Synology_enable_M2_card](https://github.com/007revad/Synology_enable_M2_card) * Newer NAS models may also need [Synology_enable_M2_card](https://github.com/007revad/Synology_enable_M2_card)
* Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots). * Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots).

25
syno_hdd_db.sh

@ -29,7 +29,7 @@
# /var/packages/StorageManager/target/ui/storage_panel.js # /var/packages/StorageManager/target/ui/storage_panel.js
scriptver="v3.6.111" scriptver="v3.6.112"
script=Synology_HDD_db script=Synology_HDD_db
repo="007revad/Synology_HDD_db" repo="007revad/Synology_HDD_db"
scriptname=syno_hdd_db scriptname=syno_hdd_db
@ -1326,6 +1326,16 @@ backupdb(){
} }
compactdb(){
# Compact database file if needed (DSM 7.3 and later)
if grep -q ': ' "$1" && grep -q ', ' "$1"; then
jq -c . "$1" > "$1.compact" && chmod 644 "$1.compact"
jq -c . "$1.compact" > "$1" && chmod 644 "$1"
fi
return 0
}
# Backup host database file if needed # Backup host database file if needed
for i in "${!db1list[@]}"; do for i in "${!db1list[@]}"; do
backupdb "${db1list[i]}" ||{ backupdb "${db1list[i]}" ||{
@ -1341,6 +1351,15 @@ for i in "${!db2list[@]}"; do
done done
# Compact DSM 7.3.2 database files if needed
for i in "${!db1list[@]}"; do
compactdb "${db1list[i]}"
done
for i in "${!db2list[@]}"; do
compactdb "${db2list[i]}"
done
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Edit db files # Edit db files
@ -1515,10 +1534,12 @@ while [[ $num -lt "${#hdds[@]}" ]]; do
# Expansion Units # Expansion Units
for i in "${!eunitdb1list[@]}"; do for i in "${!eunitdb1list[@]}"; do
backupdb "${eunitdb1list[i]}" &&\ backupdb "${eunitdb1list[i]}" &&\
compactdb "${eunitdb1list[i]}" &&\
updatedb "${hdds[$num]}" "${eunitdb1list[i]}" updatedb "${hdds[$num]}" "${eunitdb1list[i]}"
done done
for i in "${!eunitdb2list[@]}"; do for i in "${!eunitdb2list[@]}"; do
backupdb "${eunitdb2list[i]}" &&\ backupdb "${eunitdb2list[i]}" &&\
compactdb "${eunitdb2list[i]}" &&\
updatedb "${hdds[$num]}" "${eunitdb2list[i]}" updatedb "${hdds[$num]}" "${eunitdb2list[i]}"
done done
#------------------------------------------------ #------------------------------------------------
@ -1540,10 +1561,12 @@ while [[ $num -lt "${#nvmes[@]}" ]]; do
# M.2 adaptor cards # M.2 adaptor cards
for i in "${!m2carddb1list[@]}"; do for i in "${!m2carddb1list[@]}"; do
backupdb "${m2carddb1list[i]}" &&\ backupdb "${m2carddb1list[i]}" &&\
compactdb "${m2carddb1list[i]}" &&\
updatedb "${nvmes[$num]}" "${m2carddb1list[i]}" updatedb "${nvmes[$num]}" "${m2carddb1list[i]}"
done done
for i in "${!m2carddb2list[@]}"; do for i in "${!m2carddb2list[@]}"; do
backupdb "${m2carddb2list[i]}" &&\ backupdb "${m2carddb2list[i]}" &&\
compactdb "${m2carddb2list[i]}" &&\
updatedb "${nvmes[$num]}" "${m2carddb2list[i]}" updatedb "${nvmes[$num]}" "${m2carddb2list[i]}"
done done
#------------------------------------------------ #------------------------------------------------

Loading…
Cancel
Save