Skip to content

Improved output - #20

Open
TheRealDevKat wants to merge 20 commits into
mainfrom
improved_output
Open

Improved output#20
TheRealDevKat wants to merge 20 commits into
mainfrom
improved_output

Conversation

@TheRealDevKat

Copy link
Copy Markdown
Owner

No description provided.

@TheRealDevKat

Copy link
Copy Markdown
Owner Author

Output with --basic

=== Checking device: /dev/sda ===
Model Family:   Seagate Exos 7E8
Device Model:   ST8000NM000A-2KE101
Serial Number:  [hidden]

RESULT:         PASS

Full Output

=== Checking device: /dev/sda ===
Model Family:   Seagate Exos 7E8
Device Model:   ST8000NM000A-2KE101
Serial Number:  [hidden]

RESULT:         PASS

Power on hours:
SMART:          8490
FARM:           8490
DIFF:           0

Head Flying Hours:
SMART:          7719
FARM:           8035
DIFF:           316
WARN:  Head Flying Hours differ by more than 10 hours
WARN:  This MAY indicate a fraudulent or tampered drive
WARN:  But can also be due to different measurement methods

Write Power On by Head:
                Min: 10 hrs on Head 9
                Max: 13 hrs on Head 1
                Difference: 3 hrs
                Ratio: 0.30 (Threshold: 30)

@TheRealDevKat

Copy link
Copy Markdown
Owner Author

@PhrozenByte Take a look here

@TheRealDevKat

TheRealDevKat commented Mar 10, 2025

Copy link
Copy Markdown
Owner Author

additional possible values to provide:

  • - assembly date
  • - read/seek error values
  • - Logical Sectors Read/Written (converted to TB with value from Logical Sector Size)
  • - Reallocated Sectors Count

unsure:

  • Spindle Power on Hours
  • Helium Pressure Threshold Tripped
  • High Priority Unload Events (power outage)

@TheRealDevKat

Copy link
Copy Markdown
Owner Author
$ docker run -t --rm --privileged -v /dev:/dev ghcr.io/gamestailer94/farm-check:pr-20 -ns -v /dev/sdb
=== Checking device: /dev/sdb ===
Model Family:   Seagate Exos X16
Device Model:   ST16000NM001G-2KK103
Serial Number:  [hidden]

Basic Check:
RESULT:         PASS

Detailed Values:

Power on hours:
SMART:          2978
FARM:           2978
DIFF:           0

Head Flying Hours:
SMART:          2780
FARM:           2921
DIFF:           141
WARN:  Head Flying Hours differ by more than 10 hours
WARN:  This MAY indicate a fraudulent or tampered drive
WARN:  But can also be due to different measurement methods

Write Power On by Head:
Head 0:         19923 seconds   ~5 hours
Head 1:         8232 seconds    ~2 hours
Head 2:         56697 seconds   ~15 hours
Head 3:         49022 seconds   ~13 hours
Head 4:         24309 seconds   ~6 hours
Head 5:         9101 seconds    ~2 hours
Head 6:         15246 seconds   ~4 hours
Head 7:         6943 seconds    ~1 hours
Head 8:         7347 seconds    ~2 hours
Head 9:         7066 seconds    ~1 hours
Head 10:        74623 seconds   ~20 hours
Head 11:        72136 seconds   ~20 hours
Head 12:        40156 seconds   ~11 hours
Head 13:        24909 seconds   ~6 hours
Head 14:        31115 seconds   ~8 hours
Head 15:        70699 seconds   ~19 hours
Head 16:        51348 seconds   ~14 hours
Head 17:        18416 seconds   ~5 hours
Min:            1 hrs on Head 7
Max:            20 hrs on Head 10
Difference:     19 hrs
Ratio:          19.00 (Threshold: 30)

Additional Information:
INF:   These Values might help determine if a drive is genuine or not
Assembly:       Week 38 of 2023
Reallocated:    0
Power Cycles:   5
Start Stops:    5

Error Rates (Normalized):
Read:           078
Seek:           089

Data:
LBA Size:       512 bytes
Read:           178529900308 sectors (83 TB)
Write:          94241496232 sectors (43 TB)

@PhrozenByte

Copy link
Copy Markdown

I like that, great work ❤️

A few suggestions:

How about adding two helper functions to parse times and sizes? For example, instead of printing the write power on hours in both seconds and hours, the script could print them solely in the most reasonable scale. In your example it should be hours, but for the 437 days we had in #14 it should be months. A common method is allowing for up to three times the next scale, i.e. up to 180 minutes, then up to 72 hours, then up to 90 days, then up to 36 months, lastly years, and always rounding up to the next integer and adding a "<" prefix (this way you don't even need float arithmetic). Same with MB, GB, and TB (up to 3000 MB, up to 3000 GB, lastly TB). Another helper could add thousands separators to large numbers. I don't think the exact values really matter, and if one really needs them, one can always use smartctl.

Power on hours:
SMART:          2978
FARM:           2978
DIFF:           0

WDYT about hiding the diff if it's 0 or 1, and adding an info text?

WARN:  Head Flying Hours differ by more than 10 hours
WARN:  This MAY indicate a fraudulent or tampered drive
WARN:  But can also be due to different measurement methods

This kinda conveys that 10 hours is some "fixed" boundary at which one must assume fraud, but it's actually an arbitrary value (it is, right?). I'd rather just always print the info text, telling that "big differences" (i.e. not settle on a definitive boundary) might be an indicator.

Difference:     19 hrs
Ratio:          19.00 (Threshold: 30)

IMHO this is a little confusing. I'd again remove both the difference and the rather arbitrary treshold, but add a info text instead explaining that - again - "big differences" between the heads possibly indicate fraud or tampering.

Power Cycles:   5
Start Stops:    5

I like to suggest handling this similar to power on hours, i.e. showing both SMART and FARM values, and also adding a little info text that differences between power cycles and start/stops could be a result of enabled power savings mode, but also of fraud. For consumer HDDs the values will usually wildly differ due to aggressive power saving being enabled by default, but it's a whole different story for enterprise HDDs.

Assembly:       Week 38 of 2023

Is the output always inverted now? Because, if it's always inverted, I'd say that it should be dealt with in smartmontools instead. However, I always thought that it's just some drives that show it inverted... But I might be wrong.

Error Rates (Normalized):
Read:           078
Seek:           089

Personally I'm no big fan of normalized values: They are normalized for a full disk lifetime, but I'd expect that most people use your scripts to check new drives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants