Page 1 of 1
Smartchk - Read HDD/SSD SMART data
Posted: Thu Apr 21, 2022 4:31 pm
by wizard
The Linux smartmontools package contains the command line app smartctl that can read your
hdd/ssd SMART values. These values can reflect the health of the drive. Unfortunately,
manufactures do not adhere to the same standards and results are subject to interpretation
by make and model. The PPM has a gui frontend for smartctl: gsmartcontrol. It requires installing
smartmontools first. On my fossapup64 it did not run out of the box, but could be started
by running /usr/sbin/gsmartcontrol.
Smartchk is a simple alternate gui for smartctl. It is a portable app that contains both 32 bit and 64 bit versions of smartctl. Just unpack it and run LAUNCH from the smartchk directory. Smartchk will display just a few key values and also allow viewing of all the SMART data. The included HELP file will help you interpet the output.
Edit: 220422 wizards rule #4 "If you thinks it's done, it's not"
-down rev'd smartctl to v6.5, works on more Pup versions OOTB.
-added code to use the existing smartctl (smartmontools) if it has been installed from the package manager.
Tested on fossa, bionic, dpup stretch and xenial
NOTE: Drives connected by USB may not work. Otherwise, if nothing is reported your Puppy may
have conflicts with the included smartctl versions. Install smartmontools from the package manager
and try agaIn. Smartchk will automatically use that smartctl version.
wizard
- smartchkssd.png (19.6 KiB) Viewed 2694 times
Re: Smartchk - Read HDD/SSD SMART data
Posted: Thu Apr 21, 2022 11:03 pm
by April
Do you have a MD5 sum or other for this please?
root# ./smartctl64
./smartctl64: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by ./smartctl64)
root# ./smartctl32
./smartctl32: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
root#
Not working at all in Xenialpup64-7.5
EDIT:
With new smartctl64 I was able to get it to run in a terminal but the GUI does not fill the values.
Code: Select all
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 084 064 006 Pre-fail Always - 237122426
3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 094 094 020 Old_age Always - 6572
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 074 060 045 Pre-fail Always - 22836137
9 Power_On_Hours 0x0032 099 099 000 Old_age Always - 1527 (114 228 0)
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 094 094 020 Old_age Always - 6252
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 1
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 060 044 040 Old_age Always - 40 (Min/Max 21/40)
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 13
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 379
193 Load_Cycle_Count 0x0032 092 092 000 Old_age Always - 17734
194 Temperature_Celsius 0x0022 040 056 000 Old_age Always - 40 (0 14 0 0 0)
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 935 (177 42 0)
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 2449141575
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 1450096346
SMART Error Log Version: 1
No Errors Logged
Lotta fun ...Thanks
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 12:30 am
by mikewalsh
@wizard :-
There's a reason you're having to start gsmartctl from the terminal. It's because newer builds are now set-up to check that you're running as a "normal user". The .desktop file doesn't point directly to gsmartctl; instead, it points to a modified 'sudo' script, which does whatever it needs to do in the average mainstream distro, then passes control of gsmartctl over to the "normal user". Needless to say, this doesn't work for us in Puppy!
You can get round this by modifying the .desktop file's 'Exec' line to point directly to 'gsmartctl' instead, followed by the usual 'fixmenus', etc.
I've tried your 'smartchk' portable. Unfortunately, all I get is a set of 'blank' outputs; probably caused by a conflict between your included smartctl files and my own installed stuff from the newer packages detailed below. I'm currently in 32-bit Tahrpup 606.
------------------------------------------
@April :- A few years ago, I re-built the existing gSmartCtl packages for Puppy. As part of doing so, I compiled the then newest version (v6.6) of smartmontools (the 'back-end' for all this), to which had just been added the ability to read external USB HDD/SSD drives, working via the USB 3.0 'bridge card' in use by most of them. It also adds the ability to interpret correctly the output from an SSD's controller chip, and even plays nice with the current generation of NVMe high-speed solid state drives.
'The .desktop file points directly to the gsmartctl binary in /usr/bin, and the 'sudo' script has been omitted, since it doesn't do anything in Puppy except bugger things up..!
There's a build available for Xenialpup64. Just follow the instructions in the thread.
----------------------------------------
The thread can be found over at the old Forum, here:-
https://oldforum.puppylinux.com/viewtopic.php?t=114535
.....and the packages are still available from my Google Drive. Hope that helps some of you.
Mike.
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 12:52 am
by wizard
@mikewalsh
newer builds are now set-up to check that you're running as a "normal user".
That's what I found and did rewrite the .desktop file and made into a .sfs which works on fossapup64. The smartchk pkg is an attempt to make a portable with no deps that works on both 32/64 bit pups.
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 1:36 am
by wizard
@April
Hi April,
Not a checksum issue, I tested on fossa, bionic and dpup stretch. Just tested on xenial and got the same errors, they are the old c compiler gotchas. Extract the attached file, put it in the smartchk directory and that should fix it for xenial 64. Will test some more tomorrow and upload a rev, so check back. Thanks for your help.
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 1:59 am
by wizard
@mikewalsh
conflict between your included smartctl files
Sure your right since I didn't test on anything that old. Look in /usr/sbin, see if you have smartctl, if you do, copy it into the smartchk directory and rename as smartctl32. Alternately you can try downloading smartmontools from the ppm and extract smartctl from there. If you try, let me know if it works.
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 11:40 am
by mikewalsh
@wizard :-
wizard wrote: Fri Apr 22, 2022 1:59 am
@mikewalsh
conflict between your included smartctl files
Sure your right since I didn't test on anything that old. Look in /usr/sbin, see if you have smartctl, if you do, copy it into the smartchk directory and rename as smartctl32. Alternately you can try downloading smartmontools from the ppm and extract smartctl from there. If you try, let me know if it works.
Thanks
wizard
Well, I've done a bit of testing, mate.
In Tahr32 6.0.6 :-
- Tried your suggestion - swapping-in the smartctl from /usr/sbin & re-naming - no joy. (This is my own, compiled v6.6 upgrade.)
- Tried it again with the original from smartmontools via the PPM. Still no joy.
As downloaded from the repos, smartctl is a shared library. As compiled from the smartmontools source code, it comes out as a binary. I thought that might be making the difference, which is why I tried both methods.......but, as you can see, no change.
In Quirky64 'April' 7.0.1 :-
I've had the older gsmartctl-v0.8.5 package installed here. This is a re-packaged Tahr64 build, since Quirky 'April' is essentially Tahrpup-era; the way Barry did these, the devX was only ever a .pet package - I've re-built it as an SFS - and a kernel-source/headers package never existed. It came with a 3-series kernel; these are useless for me on this HP rig, since the audio chip didn't even exist until the early 4-series kernels came out.....which is why most of my Pups are running with substantially newer kernels.
Quirky's currently running Fossapup's k5.4.53 kernel (with fdrv for firmware), so although using the original devX, she now makes use of the Fossapup kernel headers package.
The older v0.8.5 doesn't interpret SSD data correctly, so there's a load of red 'error' entries on the 'Attributes' tab. I had a go at compiling the v6.6 smartmontools source code for it this morning, since this particular Puppy is such a mongrel a package wouldn't really be applicable for any other Pup.
It compiled out very nicely, so I can now read my primary drive's S.M.A.R.T data properly in Quirky..!
Having done this, I tried using the smartctl binary from /usr/sbin in your SmartChk portable.....unfortunately, it's still a no-go.
Question:- What's all that "9P / 5R / 197C" stuff in the launcher? Just curious..!
Mike.
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 6:47 pm
by wizard
rev.220422 available in the first post, will now work on more Pups
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 7:29 pm
by wizard
@mikewalsh
Hi Mike, thanks for the feedback and all the testing. Here's what I've tested with rev.220422
-download tahr 6.0.5 32bit (couldn't find 6.0.6)
-run smartchk = fails
-installed smartmontools from PPM
-run smartchk = OK
New code picks smartctl installed with smartmontools first. This feature should let smartchk work with Pups that conflict with the included smartctl v6.5.
Question:- What's all that "9P / 5R / 197C" stuff in the launcher? Just curious..!
An attempt to compensate for the manufactures (mostly ssd) not adhering to any standards. Smartctl queries the SMART data in the drive and part of it looks like this:
- smarttable.jpg (39.98 KiB) Viewed 2578 times
But, because there are no standards the ID#, ATTRIBUTE_NAME, and even the data format can be different for different drives. UGH!
Code: Select all
#197 Current_Pending_Sector
cps=$($smartctlx -a /dev/$mydrv | awk '/197 C/ {print $NF}')
In this example the first part "$smartctlx -a /dev/$mydrv |" grabs all the data available and sends it to the awk command. Awk looks for the string between the /, in this case, "197 C". So the trick is don't use to little, like just "197" in case the attribute is totally different and don't use to much in case they changed part of the name. The last part "{print $NF}" tells awk to use the last value in the line.
And that my friend is why they need standards. As a result, anything you create will be imperfect.
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 9:07 pm
by Dingo
wizard wrote: Thu Apr 21, 2022 4:31 pm
The Linux smartmontools package contains the command line app smartctl that can read your
hdd/ssd SMART values. These values can reflect the health of the drive. Unfortunately,
manufactures do not adhere to the same standards and results are subject to interpretation
by make and model. The PPM has a gui frontend for smartctl: gsmartcontrol. It requires installing
smartmontools first. On my fossapup64 it did not run out of the box, but could be started
by running /usr/sbin/gsmartcontrol.
Smartchk is a simple alternate gui for smartctl. It is a portable app that contains both 32 bit and 64 bit versions of smartctl. Just unpack it and run LAUNCH from the smartchk directory. Smartchk will display just a few key values and also allow viewing of all the SMART data. The included HELP file will help you interpet the output.
Edit: 220422 wizards rule #4 "If you thinks it's done, it's not"
-down rev'd smartctl to v6.5, works on more Pup versions OOTB.
-added code to use the existing smartctl (smartmontools) that has been installed from the package manager.
Tested on fossa, bionic, dpup stretch and xenial
NOTE: Drives connected by USB may not work. Otherwise, if nothing is reported your Puppy may
have conflicts with the included smartctl versions. Install smartmontools from the package manager
and try agaIn. Smartchk will automatically use that smartctl version.
smartchk220422.tar.xz
wizard
smartchkssd.png
it worked like a charm on my xenialpup64, but is don't shows remaining life
- 2022-04-22-230724_277x53_scrot.png (14.99 KiB) Viewed 2571 times
Code: Select all
smartctl 6.6 2017-11-05 r4594 [x86_64-linux-4.9.58] (local build)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Hitachi/HGST Travelstar Z7K500
Device Model: HGST HTS725050A7E630
Serial Number: TF655AWJ3KYEPT
LU WWN Device Id: 5 000cca 7c5f26f57
Firmware Version: GH2OA560
User Capacity: 500.107.862.016 bytes [500 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 6
SATA Version is: SATA 2.6, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Apr 22 23:19:56 2022 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 45) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 88) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 062 Pre-fail Always - 0
2 Throughput_Performance 0x0004 100 100 000 Old_age Offline - 0
3 Spin_Up_Time 0x0007 222 222 033 Pre-fail Always - 1
4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 1369
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
7 Seek_Error_Rate 0x000a 100 100 000 Old_age Always - 0
8 Seek_Time_Performance 0x0004 100 100 000 Old_age Offline - 0
9 Power_On_Hours 0x0012 083 083 000 Old_age Always - 7661
10 Spin_Retry_Count 0x0012 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1343
191 G-Sense_Error_Rate 0x000a 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 3211300
193 Load_Cycle_Count 0x0012 053 053 000 Old_age Always - 478427
194 Temperature_Celsius 0x0002 214 214 000 Old_age Always - 28 (Min/Max 11/50)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0
223 Load_Retry_Count 0x000a 100 100 000 Old_age Always - 0
240 Head_Flying_Hours 0x0032 087 087 000 Old_age Always - 6131
241 Total_LBAs_Written 0x0032 100 100 000 Old_age Always - 19270156721
242 Total_LBAs_Read 0x0032 100 100 000 Old_age Always - 34760339488
254 Free_Fall_Sensor 0x0032 100 100 000 Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 0 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
Re: Smartchk - Read HDD/SSD SMART data
Posted: Fri Apr 22, 2022 10:58 pm
by wizard
@Dingo
but is don't shows remaining life
2022-04-22-230724_277x53_scrot.png
Based on my limited drive samples remaining life is reported by ID# 177, 202, or 231. Your drive doesn't report those, not surprising since HDD's don't have a life limitation based on write/erase cycles. SSD's on the other hand, have a limited life and each mfg has a spec on Total Terabytes Written, but that is just an estimate. For instance my Micron 960gb ssd's spec says 75 TBW and it currrently has 135 TBW, so not very scientific in that case.
Great job on the feedback, Thanks.
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Sat Apr 23, 2022 7:44 am
by April
@wizard
Usually when you distribute something like this you firstly make an MD5sum ,or SHA etc, of the file and include it to ensure nobody fiddles with it and adds a file in place of it .
I'm sure you know this .
Can I get an md5sum for it please?
Re: Smartchk - Read HDD/SSD SMART data
Posted: Sat Apr 23, 2022 12:53 pm
by wizard
@April
Here it is for smartchk220422.tar.xz
md5sum - 3d27733a2e87891d36aa8df1e292c340
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Sat Apr 23, 2022 9:14 pm
by April
MM. You have done this before yes?
Code: Select all
root# md5sum smartchk220422.tar.xz smartchk220422.tar.xz.md5
3d27733a2e87891d36aa8df1e292c340 smartchk220422.tar.xz
485a3a4a5b18bad36f4feefadc51109a smartchk220422.tar.xz.md5
root#
Re: Smartchk - Read HDD/SSD SMART data
Posted: Sat Apr 23, 2022 10:37 pm
by wizard
@April
A least once
Just downloaded and checked against my original, this is output, looks good to me.
Code: Select all
root# md5sum smartchk220422.tar.xz
3d27733a2e87891d36aa8df1e292c340 smartchk220422.tar.xz
Code: Select all
md5sum smartchk220422.tar.xz smartchk220422.tar.xz.md5
That line from your code is asking for the md5sum for two different files, smartchk220422.tar.xz and also smartchk220422.tar.xz.md5.
The checksum shown for smartchk220422.tar.xz is correct.
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Sun Apr 24, 2022 9:03 am
by April
Yes ,me in blind confusion at times these days . I think it is the " Russians are coming" pressure.
Re: Smartchk - Read HDD/SSD SMART data
Posted: Tue Jun 20, 2023 1:17 am
by MrAccident
I used both GUIs on my old HDD:
Smartchk - said that it's failing.
gsmartcontrol - said that it passed.
How do you interpret that?
Re: Smartchk - Read HDD/SSD SMART data
Posted: Tue Jun 20, 2023 1:44 pm
by wizard
Since I did not author gsmartcontrol I can't tell you what they use as criteria. It may just be a difference in interpretation. Smartchk does give you the option to view the full smart output, you can then look up the parameters on the web and draw your own conclusion.
Thanks
wizard
Re: Smartchk - Read HDD/SSD SMART data
Posted: Wed Jun 21, 2023 12:14 am
by MrAccident
@wizard - I don't think I'll understand any of it . The fact it says it's failing ― I think says it all :-J. But I already got a new, much bigger HDD, because I knew it was old(2013); and will buy another for backup.
Thanks.