[GH-ISSUE #23] ERROR No drives found! #516

Closed
opened 2026-03-11 11:36:26 +03:00 by kerem · 18 comments
Owner

Originally created by @stevenpDU on GitHub (Mar 22, 2023).
Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/23

When running the script, this is my output:

Synology_HDD_db v1.2.17
RS2421rp+ DSM 7.1.1

ERROR No drives found!

I have 11 disks in RAID 6 (Synology £HAT5300-16T) and 1 hot spare (Seagate ST16000NE000-2RW103) in my RS2421rp+

Originally created by @stevenpDU on GitHub (Mar 22, 2023). Original GitHub issue: https://github.com/007revad/Synology_HDD_db/issues/23 When running the script, this is my output: Synology_HDD_db v1.2.17 RS2421rp+ DSM 7.1.1 ERROR No drives found! I have 11 disks in RAID 6 (Synology £HAT5300-16T) and 1 hot spare (Seagate ST16000NE000-2RW103) in my RS2421rp+
kerem 2026-03-11 11:36:26 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@007revad commented on GitHub (Mar 22, 2023):

I'm not sure what happened there. I suspect maybe your drives firmware version may be in /sys/block/<drive>/device/firmware_rev instead of /sys/block/<drive>/device/rev

Can you try the following commands report back what each of them return:

cat /sys/block/sata1/device/model

cat /sys/block/sata1/device/rev

cat /sys/block/sata1/device/firmware_rev

If you don't get anything from 2 or more of those commands let me know what this command returns:

ls -1 /sys/block/sata/device

If it returns nothing then try:

ls -1 /sys/block/sda/device

<!-- gh-comment-id:1480292204 --> @007revad commented on GitHub (Mar 22, 2023): I'm not sure what happened there. I suspect maybe your drives firmware version may be in `/sys/block/<drive>/device/firmware_rev` instead of `/sys/block/<drive>/device/rev` Can you try the following commands report back what each of them return: `cat /sys/block/sata1/device/model` `cat /sys/block/sata1/device/rev` `cat /sys/block/sata1/device/firmware_rev` If you don't get anything from 2 or more of those commands let me know what this command returns: `ls -1 /sys/block/sata/device` If it returns nothing then try: `ls -1 /sys/block/sda/device`
Author
Owner

@stevenpDU commented on GitHub (Mar 23, 2023):

Hello, my outputs are:

ash-4.4# cat /sys/block/sata1/device/model
HAT5300-16T
ash-4.4# cat /sys/block/sata1/device/rev
1402
ash-4.4# cat /sys/block/sata1/device/firmware_rev
cat: /sys/block/sata1/device/firmware_rev: No such file or directory
ash-4.4# ls -1 /sys/block/sata/device
ls: cannot access '/sys/block/sata/device': No such file or directory
ash-4.4# ls -1 /sys/block/sda/device
ls: cannot access '/sys/block/sda/device': No such file or directory

<!-- gh-comment-id:1480844621 --> @stevenpDU commented on GitHub (Mar 23, 2023): Hello, my outputs are: ash-4.4# cat /sys/block/sata1/device/model HAT5300-16T ash-4.4# cat /sys/block/sata1/device/rev 1402 ash-4.4# cat /sys/block/sata1/device/firmware_rev cat: /sys/block/sata1/device/firmware_rev: No such file or directory ash-4.4# ls -1 /sys/block/sata/device ls: cannot access '/sys/block/sata/device': No such file or directory ash-4.4# ls -1 /sys/block/sda/device ls: cannot access '/sys/block/sda/device': No such file or directory
Author
Owner

@007revad commented on GitHub (Mar 23, 2023):

I think I know what happened.

  1. You logged in via SSH as an admin or user.
  2. Ran the script with sudo <script>.sh
  3. The "check for new version" section of the code took longer than 5 minutes to get a reply from github.
  4. sudo expired due to the script being idle for 5 minutes.
  5. The 'get drives' section of the script failed because you no longer had permission to access /sys

I've added a 30 seconds timeout to "check for new version" section of the code to prevent this happening, since v1.2.20

Can you please try the latest version, v1.2.23, here https://github.com/007revad/Synology_HDD_db

<!-- gh-comment-id:1481971492 --> @007revad commented on GitHub (Mar 23, 2023): I think I know what happened. 1. You logged in via SSH as an admin or user. 2. Ran the script with `sudo <script>.sh` 3. The "check for new version" section of the code took longer than 5 minutes to get a reply from github. 4. sudo expired due to the script being idle for 5 minutes. 5. The 'get drives' section of the script failed because you no longer had permission to access `/sys` I've added a 30 seconds timeout to "check for new version" section of the code to prevent this happening, since v1.2.20 Can you please try the latest version, v1.2.23, here https://github.com/007revad/Synology_HDD_db
Author
Owner

@stevenpDU commented on GitHub (Mar 24, 2023):

Hi, I've tested it again (this time with version 1.2.23) and the timeout you've mentioned isn't the issue.
I'm still getting the same outcome unfortunately.

<!-- gh-comment-id:1482512226 --> @stevenpDU commented on GitHub (Mar 24, 2023): Hi, I've tested it again (this time with version 1.2.23) and the timeout you've mentioned isn't the issue. I'm still getting the same outcome unfortunately.
Author
Owner

@stevenpDU commented on GitHub (Mar 24, 2023):

Outcome:
image

<!-- gh-comment-id:1482530483 --> @stevenpDU commented on GitHub (Mar 24, 2023): Outcome: ![image](https://user-images.githubusercontent.com/128604316/227488153-8e48012f-c953-4667-bb3b-1f23bda72cd5.png)
Author
Owner

@stevenpDU commented on GitHub (Mar 24, 2023):

image

<!-- gh-comment-id:1482531613 --> @stevenpDU commented on GitHub (Mar 24, 2023): ![image](https://user-images.githubusercontent.com/128604316/227488483-4aeb9097-76c0-4f87-9242-b1c2395d14bc.png)
Author
Owner

@007revad commented on GitHub (Mar 24, 2023):

Can you try running it with sudo i instead of sudo

sudo i /volume1/DCAUD01/_script_synology/syno_hdd_db.sh

<!-- gh-comment-id:1482540685 --> @007revad commented on GitHub (Mar 24, 2023): Can you try running it with sudo i instead of sudo `sudo i /volume1/DCAUD01/_script_synology/syno_hdd_db.sh`
Author
Owner

@stevenpDU commented on GitHub (Mar 24, 2023):

same outcome when running with sudo -i

<!-- gh-comment-id:1482643230 --> @stevenpDU commented on GitHub (Mar 24, 2023): same outcome when running with sudo -i
Author
Owner

@007revad commented on GitHub (Mar 24, 2023):

I wonder if they're incorrectly being detected as removable drives which would cause the script to skip them.

Can you run the following command:
sudo cat "/sys/block/sata1/removable"

And this command:
sudo for d in /sys/block/*; do hdmodel=$(cat "$1/device/model") && echo "$cardmodel"; done

<!-- gh-comment-id:1482703319 --> @007revad commented on GitHub (Mar 24, 2023): I wonder if they're incorrectly being detected as removable drives which would cause the script to skip them. Can you run the following command: `sudo cat "/sys/block/sata1/removable"` And this command: `sudo for d in /sys/block/*; do hdmodel=$(cat "$1/device/model") && echo "$cardmodel"; done`
Author
Owner

@stevenpDU commented on GitHub (Mar 24, 2023):

First command:
sudo cat "/sys/block/sata1/removable"
1

Second command:
sudo for d in /sys/block/*; do hdmodel=$(cat "$1/device/model") && echo "$cardmodel"; done
-sh: syntax error near unexpected token `do'

<!-- gh-comment-id:1482742953 --> @stevenpDU commented on GitHub (Mar 24, 2023): First command: sudo cat "/sys/block/sata1/removable" 1 Second command: sudo for d in /sys/block/*; do hdmodel=$(cat "$1/device/model") && echo "$cardmodel"; done -sh: syntax error near unexpected token `do'
Author
Owner

@007revad commented on GitHub (Mar 25, 2023):

It's weird that cat /sys/block/sata1/removable returned 1 for you. For me it returns 0, and only USB or eSATA drives return 1.

For some reason sudo is causing an error in for ... do ... done. Thankfully I can run the command without sudo.

This should list all your drives:
for d in /sys/block/[sh][ad]*; do hdmodel=$(cat "$d/device/model") && echo "$hdmodel" "$d"; done

This should list if DSM thinks your drives are removable:
for d in /sys/block/[sh][ad]*; do removable=$(cat "$d/removable") && echo "$removable" "$d"; done

<!-- gh-comment-id:1483629945 --> @007revad commented on GitHub (Mar 25, 2023): It's weird that `cat /sys/block/sata1/removable` returned 1 for you. For me it returns 0, and only USB or eSATA drives return 1. For some reason sudo is causing an error in for ... do ... done. Thankfully I can run the command without sudo. This should list all your drives: `for d in /sys/block/[sh][ad]*; do hdmodel=$(cat "$d/device/model") && echo "$hdmodel" "$d"; done` This should list if DSM thinks your drives are removable: `for d in /sys/block/[sh][ad]*; do removable=$(cat "$d/removable") && echo "$removable" "$d"; done`
Author
Owner

@007revad commented on GitHub (Mar 25, 2023):

I've released a new version, v1.2.24, to fix your issue.

<!-- gh-comment-id:1483652369 --> @007revad commented on GitHub (Mar 25, 2023): I've released a new version, v1.2.24, to fix your issue.
Author
Owner

@Greg-ATG commented on GitHub (Apr 13, 2023):

It appears this issue occurs for any RS2421RP+ (we're running DSM6 and see internal drives with "removable = 1")

image

<!-- gh-comment-id:1507246722 --> @Greg-ATG commented on GitHub (Apr 13, 2023): It appears this issue occurs for any RS2421RP+ (we're running DSM6 and see internal drives with "removable = 1") ![image](https://user-images.githubusercontent.com/130684415/231813627-e05c0f90-000f-42a8-b3ca-7d0e0cb58b4d.png)
Author
Owner

@007revad commented on GitHub (Apr 17, 2023):

Thanks @Greg-ATG

I actually have a comment to myself in the script that says "Some DSM 7 RS models return 1 for internal drives!". It sounds like RS models return 1 for internal drives in both DSM 7 and DSM 6.

I added the removable drive check to prevent adding USB drives to the .db files to resolve an issue someone had. I'll find their issue and see if I can solve their issue another way.

<!-- gh-comment-id:1510951546 --> @007revad commented on GitHub (Apr 17, 2023): Thanks @Greg-ATG I actually have a comment to myself in the script that says "Some DSM 7 RS models return 1 for internal drives!". It sounds like RS models return 1 for internal drives in both DSM 7 and DSM 6. I added the removable drive check to prevent adding USB drives to the .db files to resolve an issue someone had. I'll find their issue and see if I can solve their issue another way.
Author
Owner

@007revad commented on GitHub (Apr 18, 2023):

The latest version of syno_hdd_db no longer checks if "removable = 1". It's using a different method to check if a block device is a USB drive or not.

# $1 is /sys/block/sata1 or sys/block/sda etc
usb=$(grep $(basename -- "$1") /proc/mounts | grep usb | cut -d" " -f1-2)
<!-- gh-comment-id:1512395951 --> @007revad commented on GitHub (Apr 18, 2023): The latest version of syno_hdd_db no longer checks if "removable = 1". It's using a different method to check if a block device is a USB drive or not. ``` # $1 is /sys/block/sata1 or sys/block/sda etc usb=$(grep $(basename -- "$1") /proc/mounts | grep usb | cut -d" " -f1-2) ```
Author
Owner

@Greg-ATG commented on GitHub (Apr 18, 2023):

Can you confirm which version this is fixed on? I'm still seeing "No drives found" on v2.1.37.

Thanks for your work on this!

<!-- gh-comment-id:1513204207 --> @Greg-ATG commented on GitHub (Apr 18, 2023): Can you confirm which version this is fixed on? I'm still seeing "No drives found" on v2.1.37. Thanks for your work on this!
Author
Owner

@007revad commented on GitHub (Apr 18, 2023):

Oops. I forgot to pull the changes from develop to main.

v2.1.38 is there now.

<!-- gh-comment-id:1513773679 --> @007revad commented on GitHub (Apr 18, 2023): Oops. I forgot to pull the changes from develop to main. v2.1.38 is there now.
Author
Owner

@Greg-ATG commented on GitHub (Apr 18, 2023):

That did it! Our disk is now being detected correctly.

<!-- gh-comment-id:1513823271 --> @Greg-ATG commented on GitHub (Apr 18, 2023): That did it! Our disk is now being detected correctly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_HDD_db#516
No description provided.