mirror of
https://github.com/007revad/Synology_HDD_db.git
synced 2026-04-25 21:55:59 +03:00
[GH-ISSUE #559] The code for removing spaces in the hdmodel variable within the getdriveinfo() function is unreasonable. #204
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Synology_HDD_db#204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MeowPerth on GitHub (Feb 10, 2026).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/559
Using "xargs" will cause spaces between characters in the "hdmodel" parameter to be removed.
Example:
If only removing leading and trailing spaces, it is recommended to use:
@007revad commented on GitHub (Feb 10, 2026):
You make a valid point... but have you ever seen a HDD, SSD or NVMe with multiple spaces between strings in it's model name or firmware version?
@MeowPerth commented on GitHub (Feb 11, 2026):
This situation is indeed quite rare; I have only seen it on hard drives that have had their firmware reflashed by third parties.
@007revad commented on GitHub (Feb 12, 2026):
Fixed in https://github.com/007revad/Synology_HDD_db/releases/tag/v3.6.120
@007revad commented on GitHub (Feb 12, 2026):
That does not work. It does not trim leading and trailing spaces.
But bash parameter expansion does.
@MeowPerth commented on GitHub (Feb 12, 2026):
Sorry, that was my oversight. I missed entering "*" here in the issue; additionally, I have attached my local verification results.

@MeowPerth commented on GitHub (Feb 12, 2026):
Found the cause, using Quote '>' display will cause "*" not to be displayed.😂😂😂
@MeowPerth commented on GitHub (Feb 12, 2026):
Corrected the issue description.
@007revad commented on GitHub (Feb 12, 2026):
Can you try this version before I create a public release.
https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh
@benhwebster commented on GitHub (Feb 13, 2026):
I can verify this works for me.
@MeowPerth commented on GitHub (Feb 13, 2026):
This script runs fine on my NAS. But, it seems that with this version, any option directly runs the script, while version 3.6.119 does not have this issue.

@007revad commented on GitHub (Feb 13, 2026):
I've fixed the getopts issue. Can you try this one:
https://github.com/007revad/Synology_HDD_db/blob/develop/syno_hdd_db.sh
@MeowPerth commented on GitHub (Feb 14, 2026):
Line 120 should be deleted, and then it will run normally.

If using

\, it should only be placed at the end of a parameter and should not break a complete parameter.@007revad commented on GitHub (Feb 14, 2026):
Fixed and released.
https://github.com/007revad/Synology_HDD_db/releases/tag/v3.6.122
@francoism90 commented on GitHub (Feb 14, 2026):
@007revad Thanks for the fix! This seems to fix my missing drive as well:
I don't know where .db.new comes from, but I didn't noticed before it indeed has a space before the drive name.
@MeowPerth commented on GitHub (Feb 14, 2026):
Ok,Thanks.
@007revad commented on GitHub (Feb 14, 2026):
@francoism90
DSM creates the .db.new files when it updates the drive databases.
The Ultrastar HDD should not have space before WUH721816ALE6L4
What does these commands return?
@francoism90 commented on GitHub (Feb 14, 2026):
@007revad
Thanks for looking into this. Maybe it's a Synology bug?
@007revad commented on GitHub (Feb 16, 2026):
With a leading space this looks wrong
" WUH721816ALE6L4": {But because jq found 2 entries DSM should be using the first entry, which does not have the leading space.
DSM does append 5 spaces to the end of drive models (which they have done to try and break this script. But I've never seen a space at the beginning of a drive model before.
What do these commands return?
@007revad commented on GitHub (Feb 16, 2026):
Are you saying the script never found the WUH721816ALE6L4 drive(s) before or it did but the drive still showed as unverfied?
@francoism90 commented on GitHub (Feb 16, 2026):
@007revad That's a good question, I cannot remember if it before. Is there any way to check this?
@007revad commented on GitHub (Feb 19, 2026):
I see the problem.
In v3.6.121 and older the script used to:
WDCfrom start of any model name that includedWDC(note the single space after WDC).In v3.6.122 the script does not do step 2. So because your "
WDC" has 2 spaces after the WDC step 3 is not removing the remaining leading space.Can you try https://github.com/007revad/Synology_HDD_db/releases/tag/v3.6.123 and confirm it fixes the issue.
@francoism90 commented on GitHub (Feb 19, 2026):
@007revad I'll report back late this weekend, thanks for looking into it. :)