Comments (7)
Hi @jk-1
Checking for disk activity state is completely out of the scope of this tool.
I'd suggest to take a look to SCSI response not ok as an starting point to fix the issue with sudo hdparm -C /dev/sdb
.
If you are already using hd-idle
, you can always check disks' spin changes in system log:
$ grep hd-idle /var/log/syslog
Dec 4 00:00:34 enterprise hd-idle[30189]: sda spinup
Dec 4 00:00:34 enterprise hd-idle[30189]: sdc spinup
Dec 4 00:00:34 enterprise hd-idle[30189]: sdb spinup
Dec 4 00:15:34 enterprise hd-idle[30189]: /dev/sdb spindown
Dec 4 00:16:35 enterprise hd-idle[30189]: /dev/sda spindown
Dec 4 00:16:35 enterprise hd-idle[30189]: /dev/sdc spindown
Dec 4 09:30:39 enterprise hd-idle[30189]: sda spinup
Dec 4 09:31:39 enterprise hd-idle[30189]: sdc spinup
Dec 4 09:41:39 enterprise hd-idle[30189]: /dev/sda spindown
Dec 4 09:41:39 enterprise hd-idle[30189]: /dev/sdc spindown
Dec 4 12:00:42 enterprise hd-idle[30189]: sda spinup
Dec 4 12:00:42 enterprise hd-idle[30189]: sdc spinup
Dec 4 12:16:42 enterprise hd-idle[30189]: /dev/sda spindown
Dec 4 12:16:42 enterprise hd-idle[30189]: /dev/sdc spindown
Dec 4 13:06:45 enterprise hd-idle[30189]: sdc spinup
Dec 4 13:16:45 enterprise hd-idle[30189]: /dev/sdc spindown
Dec 4 13:22:48 enterprise hd-idle[30189]: sda spinup
Dec 4 13:22:48 enterprise hd-idle[30189]: sdc spinup
Dec 4 13:22:48 enterprise hd-idle[30189]: sdb spinup
Dec 4 13:33:48 enterprise hd-idle[30189]: /dev/sda spindown
Dec 4 13:33:48 enterprise hd-idle[30189]: /dev/sdc spindown
Dec 4 13:33:51 enterprise hd-idle[30189]: /dev/sdb spindown
You can know the state of any disk by checking the latest state change in the log. In the example above sda
, sdb
and sdc
are all spun down.
from hd-idle.
A good, non-intrusive way to query the spindown state with smartctl is as follows:
sudo smartctl -i -n standby /dev/sdc | grep "ACTIVE\|STANDBY" | awk '{print $4}'
The above either returns "ACTIVE" or "STANDBY".
The "-n" option is essentially preventing the drive from spinning back up if it's in standby mode. The built-in help says:
-n MODE[,STATUS], --nocheck=MODE[,STATUS] No check if: never, sleep, standby, idle (see man page)
from hd-idle.
Hi @jk-1
Checking for disk activity state is completely out of the scope of this tool.
I'd suggest to take a look to SCSI response not ok as an starting point to fix the issue with
sudo hdparm -C /dev/sdb
.If you are already using
hd-idle
, you can always check disks' spin changes in system log:$ grep hd-idle /var/log/syslog
Why saved logs only show when disks are spun up and not also when they're down like the command above? Would be possible to get this?
from hd-idle.
A good, non-intrusive way to query the spindown state with smartctl is as follows:
sudo smartctl -i -n standby /dev/sdc | grep "ACTIVE\|STANDBY" | awk '{print $4}'
The above either returns "ACTIVE" or "STANDBY".
The "-n" option is essentially preventing the drive from spinning back up if it's in standby mode. The built-in help says:
-n MODE[,STATUS], --nocheck=MODE[,STATUS] No check if: never, sleep, standby, idle (see man page)
For some reason this does not work. I have tried several modes but the disk spins up, before the result is displayed.
E.g
sudo smartctl -i -n sleep,0 /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-56-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
Device is in SLEEP mode, exit(0)
sudo smartctl -i -n standby,2 /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-56-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
Device is in SLEEP mode, exit(2)
Before the last row is displayed, disk is spinning again. I have tested this only with WD My Book USB3 disks. They contain WD red disk.
I also tried with different STATUS values (0,2) and without STATUS value without any difference to result.
from hd-idle.
Checking for disk activity state is completely out of the scope of this tool.
I'd suggest to take a look to SCSI response not ok as an starting point to fix the issue with
sudo hdparm -C /dev/sdb
.
Hi adelolmo,
Thank you for the tip: https://github.com/adelolmo/hd-idle/wiki/SCSI-response-not-ok
I tried that:
lsusb
Bus 002 Device 003: ID 1058:25ee Western Digital Technologies, Inc. My Book 25EE
...
and then
cat /sys/module/usb_storage/parameters/quirks
1058:25ee:u
Then plug out and plug in the disk. Unfortunately hdparm still cannot get the disk state.
sudo hdparm -C /dev/sdb1
/dev/sdb1:
SG_IO: bad/missing sense data, sb[]: f0 00 01 00 50 00 81 0a 80 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
drive state is: unknown
from hd-idle.
Hi @jk-1
Checking for disk activity state is completely out of the scope of this tool.
I'd suggest to take a look to SCSI response not ok as an starting point to fix the issue withsudo hdparm -C /dev/sdb
.
If you are already usinghd-idle
, you can always check disks' spin changes in system log:$ grep hd-idle /var/log/syslog
Why saved logs only show when disks are spun up and not also when they're down like the command above? Would be possible to get this?
Please check the documentation to understand how the logs.
from hd-idle.
I won't be able to give you any support on tools like hdparm
or smartctl
.
You should try asking on their project sites: https://sourceforge.net/projects/hdparm/ and https://github.com/mirror/smartmontools
I'm closing this issue, but feel free to keep the conversation active if you need to.
from hd-idle.
Related Issues (20)
- Question. Don't start HDD after suspend and sleep HDD on standby HOT 1
- HDD in external bay not detected anymore HOT 3
- Question / Clarification: How does hd-idle parse options (disks vs. partitions, LUKS, precedence in case of contradictions) HOT 1
- Help understanding how to use the -p power_condition flag for SAS drives HOT 15
- WD Re HDD over USB does not spin down. HOT 23
- Can't spin down my internal WD Blue HDD HOT 5
- HD-Idle command does not seem to get set? HOT 4
- Drive standby instead of sleep. HOT 2
- Logfile won't be generate dataγ HOT 5
- Hook-function to be called after spinning down HOT 2
- Spin up not recognized HOT 2
- Disk spin down not working after scheduled S.M.A.R.T test
- hd-idle task gets out of sync with real disk spindown HOT 11
- logfile hard to read - how can we have spindown/spinup log entries? HOT 1
- Deprecated Key? HOT 2
- Raspberry Pi Install Issues & Running Issues HOT 9
- Feature: Flag for script after spin up HOT 4
- Possible to spin-down based on Schedule? HOT 3
- Logfile won't be created HOT 4
- Nothing after hd-idle command HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hd-idle.