From fd65f925b1fada6ced24dca0bde18edc0b00620a Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 28 Oct 2025 09:12:30 +1100 Subject: [PATCH 1/5] Update README with TRIM usage instructions Clarified instructions for enabling TRIM on SSDs. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a585ac2..a9f370e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ #### What the script does: * 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). * 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. * 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). From 1e15d4f8c36f75e05aa50f2714b016deb428fce9 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sun, 2 Nov 2025 13:19:45 +1100 Subject: [PATCH 2/5] Add export-ignore for .github directory --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 629298a..8e69af8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -106,3 +106,4 @@ .gitattributes export-ignore .gitignore export-ignore .gitkeep export-ignore +.github/ export-ignore From 10f04df61e77c782e9821576e099c1d4ac74e228 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Tue, 4 Nov 2025 07:56:21 +1100 Subject: [PATCH 3/5] Add images/ to export-ignore in .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 8e69af8..9d42190 100644 --- a/.gitattributes +++ b/.gitattributes @@ -107,3 +107,4 @@ .gitignore export-ignore .gitkeep export-ignore .github/ export-ignore +images/ export-ignore From df778820e68bf08df22b191746efe3a3f1ef3d79 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 5 Dec 2025 07:16:42 +1100 Subject: [PATCH 4/5] Add bug fix for DSM 7.3 database file issue Fixed a bug in DSM 7.3 and later regarding spaces in new database files. --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index e61a022..78cf5aa 100644 --- a/CHANGES.txt +++ b/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 - Added support for M.2 volumes for NVMe drives in PCIe adaptor cards for DSM 7.1.1 From 3206fc60bbfe3188a1e7214731a976aeeeb701f7 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Fri, 5 Dec 2025 07:17:42 +1100 Subject: [PATCH 5/5] Add bug fix for DSM 7.3 database file issue Add compactdb function to optimize database files to fix a bug in DSM 7.3 and later regarding spaces in new database files. --- syno_hdd_db.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index e4d5389..5638efe 100644 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,7 +29,7 @@ # /var/packages/StorageManager/target/ui/storage_panel.js -scriptver="v3.6.111" +scriptver="v3.6.112" script=Synology_HDD_db repo="007revad/Synology_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 for i in "${!db1list[@]}"; do backupdb "${db1list[i]}" ||{ @@ -1341,6 +1351,15 @@ for i in "${!db2list[@]}"; do 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 @@ -1515,10 +1534,12 @@ while [[ $num -lt "${#hdds[@]}" ]]; do # Expansion Units for i in "${!eunitdb1list[@]}"; do backupdb "${eunitdb1list[i]}" &&\ + compactdb "${eunitdb1list[i]}" &&\ updatedb "${hdds[$num]}" "${eunitdb1list[i]}" done for i in "${!eunitdb2list[@]}"; do backupdb "${eunitdb2list[i]}" &&\ + compactdb "${eunitdb2list[i]}" &&\ updatedb "${hdds[$num]}" "${eunitdb2list[i]}" done #------------------------------------------------ @@ -1540,10 +1561,12 @@ while [[ $num -lt "${#nvmes[@]}" ]]; do # M.2 adaptor cards for i in "${!m2carddb1list[@]}"; do backupdb "${m2carddb1list[i]}" &&\ + compactdb "${m2carddb1list[i]}" &&\ updatedb "${nvmes[$num]}" "${m2carddb1list[i]}" done for i in "${!m2carddb2list[@]}"; do backupdb "${m2carddb2list[i]}" &&\ + compactdb "${m2carddb2list[i]}" &&\ updatedb "${nvmes[$num]}" "${m2carddb2list[i]}" done #------------------------------------------------