diff --git a/CHANGES.txt b/CHANGES.txt index 47eced7..b321e47 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +v3.6.109 +- Added -I, --ihm option to update IronWolf Health Management to 2.5.1 to support recent model IronWolf and IronWolf Pro drives. + - For NAS with x86_64 CPUs only. + - Installs IronWolf Health Management on '22 series and newer models that don't have IronWolf Health Management (untested). + v3.5.108 - Prevent error message if /tmpRoot exists but does not contain /usr/syno/bin/synosetkeyvalue and /etc.defaults/synoinfo.conf. Issue #411 diff --git a/README.md b/README.md index 390a4e7..ace41d2 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ #### What the script does: * Checks that M.2 volume support is enabled (on models that have M.2 slots or PCIe slots). * Enables creating M.2 storage pools and volumes from within Storage Manager in DSM 7.2 and later **(newer models only?)**. * Including M.2 drives in PCIe adaptor cards like M2D20, M2D18, M2D17 and E10M20-T1 for DSM 7.2 and above **(schedule the script to run boot)**. +* Optionally update IronWolf Health Monitor to v2.5.1 to support recent model IronWolf and IronWolf Pro drives. **(NAS with x86_64 CPUs only)**. + * Installs IronWolf Health Management on '22 series and newer models that don't have IronWolf Health Management **(untested)**. * 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.** * Reminds you that you may need to reboot the Synology after running the script. @@ -103,6 +105,41 @@ ### Options when running 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 + -I, --ihm Update IronWolf Health Monitor to 2.5.1 to support + recent model IronWolf and IronWolf Pro drives + -h, --help Show this help message + -v, --version Show the script version + + -s, --showedits Show edits made to _host db and db.new file(s) + -n, --noupdate Prevent DSM updating the compatible drive databases + -r, --ram Disable memory compatibility checking (DSM 7.x only) + and sets max memory to the amount of installed memory + -f, --force Force DSM to not check drive compatibility + Do not use this option unless absolutely needed + -i, --incompatible Change incompatible drives to supported + Do not use this option unless absolutely needed + -w, --wdda Disable WD Device Analytics to prevent DSM showing + a false warning for WD drives that are 3 years old + DSM 7.2.1 and later already has WDDA disabled + -p, --pcie Enable creating volumes on M2 in unknown PCIe adaptor + -e, --email Disable colored text in output scheduler emails + -S, --ssd=DRIVE Enable write_mostly on internal HDDs so DSM primarily + reads from internal SSDs or your specified drives + -S automatically sets internal SSDs as DSM preferred + --ssd=DRIVE requires the fast drive(s) as argument, + or restore as the argument to reset drives to default + --ssd=sata1 or --ssd=sata1,sata2 or --ssd=sda etc + --ssd=restore + --restore Undo all changes made by the script (except -S --ssd) + To restore all changes including write_mostly use + --restore --ssd=restore + --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 + -I, --ihm Update IronWolf Health Management to 2.5.1 to support + recent model IronWolf and IronWolf Pro drives. + For NAS with x86_64 CPUs only. + Installs IHM on '22 series and newer models (untested) -h, --help Show this help message -v, --version Show the script version ``` diff --git a/bin/dhm_tool b/bin/dhm_tool new file mode 100644 index 0000000..3ce8e45 Binary files /dev/null and b/bin/dhm_tool differ diff --git a/bin/dhm_tool.txt b/bin/dhm_tool.txt new file mode 100644 index 0000000..30e0354 --- /dev/null +++ b/bin/dhm_tool.txt @@ -0,0 +1,12 @@ +stx_ihm from QNAP firmware, renamed dhm_tool for Synology DSM + + SeaDragon_DHMr - Seagate drive utilities + Copyright (c) 2017-2021 Seagate Technology LLC and/or its Affiliates, All Rights Reserved + SeaDragon_DHMr Version: 2.5.1-2_2_3 X86_64 + Build Date: Oct 3 2022 + +MD5 cf67c1d5006913297f85ca7f9d1795ba +SHA-1 163b384afabc491c97f3aa4ee7916601a9a680dd +SHA-256 86dd0e3c5ded507d23dfeb2ca04a2e086c97a86e2ab96dc6fdeab686a8202795 +SHA-384 3d806909d445605787ceb155bc1555e01d02efe324378c9c71e6b53d91bba6bf8dbadef38dd882b43caf8dbd93eaff6c +SHA-512 a2d87d91fd4cc298708946c9a611027dce290ba17a48c65e712b5d7e72ba04c6b5303c90efeb178a8fc690241b405691a15cc88200ab3b28319198df6bd6ad16 diff --git a/syno_hdd_db.sh b/syno_hdd_db.sh index f41837f..e5d43b9 100755 --- a/syno_hdd_db.sh +++ b/syno_hdd_db.sh @@ -29,7 +29,7 @@ # /var/packages/StorageManager/target/ui/storage_panel.js -scriptver="v3.5.108" +scriptver="v3.6.109" script=Synology_HDD_db repo="007revad/Synology_HDD_db" scriptname=syno_hdd_db @@ -70,7 +70,7 @@ Options: Do not use this option unless absolutely needed -w, --wdda Disable WD Device Analytics to prevent DSM showing a false warning for WD drives that are 3 years old - DSM 7.2.1 already has WDDA disabled + DSM 7.2.1 and later already has WDDA disabled -p, --pcie Enable creating volumes on M2 in unknown PCIe adaptor -e, --email Disable colored text in output scheduler emails -S, --ssd=DRIVE Enable write_mostly on internal HDDs so DSM primarily @@ -86,6 +86,10 @@ Options: --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 + -I, --ihm Update IronWolf Health Management to 2.5.1 to support + recent model IronWolf and IronWolf Pro drives. + For NAS with x86_64 CPUs only + Installs IHM on '22 series and newer models (untested) -h, --help Show this help message -v, --version Show the script version @@ -108,8 +112,8 @@ EOF args=("$@") # Check for flags with getopt -if options="$(getopt -o Sabcdefghijklmnopqrstuvwxyz0123456789 -l \ - ssd:,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,help,version,debug \ +if options="$(getopt -o SIabcdefghijklmnopqrstuvwxyz0123456789 -l \ + ssd:,ihm,restore,showedits,noupdate,nodbupdate,m2,force,incompatible,ram,pcie,wdda,email,autoupdate:,help,version,debug \ -- "$@")"; then eval set -- "$options" while true; do @@ -165,6 +169,9 @@ if options="$(getopt -o Sabcdefghijklmnopqrstuvwxyz0123456789 -l \ -p|--pcie) # Enable creating volumes on M2 in unknown PCIe adaptor forcepci=yes ;; + -I|--ihm) # Update IronWolf Health Management + ihm=yes + ;; --autoupdate) # Auto update script autoupdate=yes if [[ $2 =~ ^[0-9]+$ ]]; then @@ -254,6 +261,12 @@ fi model=$(cat /proc/sys/kernel/syno_hw_version) modelname="$model" +# Get CPU platform_name +platform_name=$(/usr/syno/bin/synogetkeyvalue /etc.defaults/synoinfo.conf platform_name) + +# Get CPU arch +arch="$(uname -m)" + # Show script version #echo -e "$script $scriptver\ngithub.com/$repo\n" @@ -268,7 +281,7 @@ smallfixnumber=$(/usr/syno/bin/synogetkeyvalue /etc.defaults/VERSION smallfixnum # Show DSM full version and model if [[ $buildphase == GM ]]; then buildphase=""; fi if [[ $smallfixnumber -gt "0" ]]; then smallfix="-$smallfixnumber"; fi -echo "$model DSM $productversion-$buildnumber$smallfix $buildphase" +echo "$model $arch DSM $productversion-$buildnumber$smallfix $buildphase" # Convert model to lower case @@ -2241,6 +2254,60 @@ if [[ -f "$strgmgr" ]] && [[ $buildnumber -gt 42962 ]]; then fi +# Optionally update IronWolf Health Management +if [[ $arch == "x86_64" ]]; then + if [[ $ihm == "yes" ]]; then + setting="$(/usr/syno/bin/synogetkeyvalue $synoinfo support_ihm)" + if [[ $setting != "yes" ]]; then + # Enable support_ihm + /usr/syno/bin/synosetkeyvalue "$synoinfo" support_ihm "yes" + setting="$(/usr/syno/bin/synogetkeyvalue "$synoinfo" support_ihm)" + if [[ $setting == "yes" ]]; then + echo -e "\nEnabled support IronWolf Health Management." + fi + else + echo -e "\nSupport IronWolf Health Management already enabled." + fi + + if [[ ! -f /usr/syno/sbin/dhm_tool ]]; then + # Install dhm_tool on models without it ('22 series and newer) + # Untested + md5hash="cf67c1d5006913297f85ca7f9d1795ba" + branch="main" + file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool" + # install_binfile + install_binfile dhm_tool "$file_url" /usr/syno/sbin/dhm_tool "a+x" bin/dhm_tool "$md5hash" + else + # Check if dhm_tool needs updating + dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" + if ! printf "%s\n%s\n" "2.5.1" "$dhm_version" | + sort --check=quiet --version-sort >/dev/null ; then + + # Backup existing dhm_tool + backupdb "/usr/syno/sbin/dhm_tool" + + # Update dhm_tool + md5hash="cf67c1d5006913297f85ca7f9d1795ba" + branch="main" + file_url="https://raw.githubusercontent.com/${repo}/${branch}/bin/dhm_tool" + # install_binfile + install_binfile dhm_tool "$file_url" /usr/syno/sbin/dhm_tool "a+x" bin/dhm_tool "$md5hash" + + # Check dhm_tool updated + dhm_version="$(dhm_tool --version | grep "Utility Version" | awk '{print $NF}')" + if [[ $dhm_version == "2.5.1" ]]; then + echo "Updated IronWolf Health Management." + else + echo "${Error}ERROR${Off} Failed to update IronWolf Health Management!" + fi + else + echo "IronWolf Health Management already updated." + fi + fi + fi +fi + + #------------------------------------------------------------------------------ # Finished