From 83f9948f0836a19efc0808ca71dc30acce171914 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:25:09 +1100 Subject: [PATCH 1/6] Update syno_hdd_db.sh to v3.6.117 v3.6.117 - Added SSD TRIM warning of possible data loss if non-Synology SSDs or NVMes are in RAID 5, 6 or SHR with more than 3 drives. - See https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list --- syno_hdd_db.sh | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index a1b891a..c1ad6f7 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.116" +scriptver="v3.6.117" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -1107,22 +1107,43 @@ m2_drive(){ fi } +is_ssd(){ + # $1 is sda, sata1 or nvme0 + # Show TRIM warning if SSD or NVMe in RAID 5 or 6 + if ! synodisk --isssd /dev/"$1" >/dev/null; then + # exit code 0 = is not SSD + # exit code 1 = is SSD + + # Ignore Synology SSDs/NVMe drives + brand="$(cat /sys/block/"$1"/device/vendor)" + + if grep -q "$1" /proc/mdstat | grep -E 'raid5|raid6'; then + if [[ $show_trim_warning != "yes" ]] && [[ $brand != "Synology" ]]; then + show_trim_warning="yes" + fi + fi + fi +} + for d in /sys/block/*; do # $d is /sys/block/sata1 etc case "$(basename -- "${d}")" in sd*|hd*) if [[ $d =~ [hs]d[a-z][a-z]?$ ]]; then getdriveinfo "$d" + is_ssd "$d" fi ;; sas*) if [[ $d =~ sas[0-9][0-9]?[0-9]?$ ]]; then getdriveinfo "$d" + is_ssd "$d" fi ;; sata*) if [[ $d =~ sata[0-9][0-9]?[0-9]?$ ]]; then getdriveinfo "$d" + is_ssd "$d" # In case it's a SATA M.2 SSD in device tree model NAS # M.2 SATA drives in M2D18 or M2S17 @@ -1132,11 +1153,13 @@ for d in /sys/block/*; do nvme*) if [[ $d =~ nvme[0-9][0-9]?n[0-9][0-9]?$ ]]; then m2_drive "$d" "nvme" + is_ssd "$d" fi ;; nvc*) # M.2 SATA drives (in PCIe M2D18 or M2S17 only?) if [[ $d =~ nvc[0-9][0-9]?$ ]]; then m2_drive "$d" "nvc" + is_ssd "$d" fi ;; esac @@ -2567,6 +2590,16 @@ if [[ -f /usr/syno/sbin/synostgdisk ]]; then # DSM 6.2.3 does not have synostgd fi fi +# Show TRIM warning if required +if [[ $show_trim_warning == "yes" ]]; then + ding + echo -e "\n${Error}WARNING${Off} Enabling SSD TRIM on drives in RAID 5, 6 or SHR with 3 more drives can" + echo "result in data loss if the SSD/NVMe drives marks trimmed blocks as released." + echo "SSDs that use Method 1 are okay. Do NOT enable TRIM for SSDs that use Method 2." + echo "See Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list here:" + echo "https://tinyurl.com/ssd-trim" +fi + # Show reboot message if required if [[ $dsm -eq "6" ]] || [[ $rebootmsg == "yes" ]]; then echo -e "\nYou may need to ${Cyan}reboot the Synology${Off} to see the changes." From f051eda588672b785537bf87c5d6f011b2915bb5 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:26:08 +1100 Subject: [PATCH 2/6] Update CHANGES.txt for v3.6.117 --- CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index d648531..224ee4b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +v3.6.117 +- Added SSD TRIM warning of possible data loss if non-Synology SSDs or NVMes are in RAID 5, 6 or SHR with more than 3 drives. + - See https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list + v3.6.116 - Moved the "Warn if script located on NVMe volume" code to after the "check for new script version code. Issue #540 - Bug fix for incorrectly warning that the script is located on an NVMe volume when it is on a SHR HDD volume that has, or had, different HDD sizes. Issue #540 From 8e8ba93d8f7eaa8503030067972845399546b86d Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:35:10 +1100 Subject: [PATCH 3/6] Add v3.6.118 changes to CHANGES.txt Updated version history with changes for v3.6.118. --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 224ee4b..224c1b7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +v3.6.118 +- Changed to enable creating M.2 storage pool and volume in Storage Manager after making DSM check disk compatibility. # GitHub issue #441 + v3.6.117 - Added SSD TRIM warning of possible data loss if non-Synology SSDs or NVMes are in RAID 5, 6 or SHR with more than 3 drives. - See https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list From 8ebe2fb58a70a931b9c64f3fe139243e13b18534 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:36:05 +1100 Subject: [PATCH 4/6] Update script to v3.6.118 v3.6.118 - Changed to enable creating M.2 storage pool and volume in Storage Manager after making DSM check disk compatibility. # GitHub issue #441 --- syno_hdd_db.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index c1ad6f7..be2f57a 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.117" +scriptver="v3.6.118" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -2590,10 +2590,18 @@ if [[ -f /usr/syno/sbin/synostgdisk ]]; then # DSM 6.2.3 does not have synostgd fi fi +# Enable creating M.2 storage pool and volume in Storage Manager # GitHub issue #441 +for d in /sys/block/nvme*; do + # $d is /sys/block/nvme0n1 etc + if [[ $d =~ nvme[0-9][0-9]?n[0-9][0-9]?$ ]]; then + m2_pool_support "$d" + fi +done + # Show TRIM warning if required if [[ $show_trim_warning == "yes" ]]; then ding - echo -e "\n${Error}WARNING${Off} Enabling SSD TRIM on drives in RAID 5, 6 or SHR with 3 more drives can" + echo -e "\n${Warning}WARNING${Off} Enabling SSD TRIM on drives in RAID 5, 6 or SHR with 3 more drives can" echo "result in data loss if the SSD/NVMe drives marks trimmed blocks as released." echo "SSDs that use Method 1 are okay. Do NOT enable TRIM for SSDs that use Method 2." echo "See Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list here:" From f4052cde0ed86acb06d1b72eaffb878956c892bb Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:38:50 +1100 Subject: [PATCH 5/6] Update TRIM instructions for RAID configurations --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4e93104..1999988 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ #### What the script does: * 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 SSD TRIM on 3rd party SSDs and NVMes. Don't use the `-f` or --force` option if you want to enable SSD TRIM. - * Do ***NOT*** use TRIM on SSDs in RAID 5, RAID 6 or SHR with 3 or more SSDs unless you are certain your SSDs use [Method 1 mentioned here](https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list). - * Enabling TRIM on SSDs that use [Method 2](https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list) ***can result in data loss*** in RAID 5, RAID 6 and SHR with 3 or more drives. + * Do ***NOT*** use TRIM on SSDs in RAID 5, RAID 6 or SHR with 3 or more SSDs unless you are certain your SSDs use TRIM [Method 1 mentioned here](https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list). + * Enabling TRIM on SSDs that use TRIM [Method 2](https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list) ***can result in data loss*** in RAID 5, RAID 6 and SHR with 3 or more drives. * 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 e3bd37f7432e4a5fd324c8976c27b59a155cdfc8 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Mon, 19 Jan 2026 16:41:23 +1100 Subject: [PATCH 6/6] Update CHANGES.txt for version 3.6.118 --- CHANGES.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 224c1b7..3e36b2e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,5 @@ v3.6.118 -- Changed to enable creating M.2 storage pool and volume in Storage Manager after making DSM check disk compatibility. # GitHub issue #441 - -v3.6.117 +- Changed to enable creating M.2 storage pool and volume in Storage Manager after making DSM check disk compatibility. Issue #441 - Added SSD TRIM warning of possible data loss if non-Synology SSDs or NVMes are in RAID 5, 6 or SHR with more than 3 drives. - See https://kb.synology.com/en-global/DSM/tutorial/Why_is_SSD_TRIM_available_only_for_SSDs_in_the_compatibility_list