Open petersulyok opened 8 months ago
Hi @ralequi,
As a temporary workaround I use this code to detect STANDBY state of a HDD:
...
rv.standby_mode = False
SMARTCTL.options = []
SMARTCTL.smartctl_path = smartctl_path
# If sudo command should be used
if sudo:
SMARTCTL.sudo = True
else:
SMARTCTL.sudo = False
# If no check should be applied in standby power mode of an HDD
if nocheck:
SMARTCTL.add_options(["-n", "standby"])
# Check if `smartctl` can be executed.
output = SMARTCTL.info(self.__path)
if not output:
return None
# Check if the disk is in STANDBY mode
if "Device is in STANDBY mode" in output[3]:
rv.standby_mode = True
return rv
# Get SMART data from pySMART.
sd = Device(self.__path)
...
Please confirm this approach or suggest a better one. Thanks.
I've forgotten about this issue.
Let me try some scenarios on my lab.
I would like to check if -n standby
is a requirement and how to known when it is
Hi,
I'm looking for a solution for a situation when I'm checking the state of a hard disk in STANDBY mode (it spun down) and I don't want to wake it up. The typical
smartctl
output is the following:When I use pySMART in this context I got the following output:
How can I detect in
Device()
class if the HDD is in STANDBY mode and the rest of the class is empty? In my mind one or more of the following suggestions would help:powerState
) which can inform the user that the rest of the class is not initializedsmartctl
commandsmartctl
commandAny recommendation for this? Thanks in advance. Peter