Giter Site home page Giter Site logo

Comments (18)

Greg-ATG avatar Greg-ATG commented on May 25, 2024 1

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

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

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

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

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.

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

Outcome:
image

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

image

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

Can you try running it with sudo i instead of sudo

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

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

same outcome when running with sudo -i

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

from synology_hdd_db.

stevenpDU avatar stevenpDU commented on May 25, 2024

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'

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

from synology_hdd_db.

Greg-ATG avatar Greg-ATG commented on May 25, 2024

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

image

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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.

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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)

from synology_hdd_db.

Greg-ATG avatar Greg-ATG commented on May 25, 2024

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!

from synology_hdd_db.

007revad avatar 007revad commented on May 25, 2024

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

v2.1.38 is there now.

from synology_hdd_db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.