Hi
In my use case I want to be able to plug in a HDD, do something with it, then physically remove. But also had a RAID array, so if (never needed) a disk failed could replace. Like I said, this system is off more than on these days…
I found some info on what start HDDs when they are idle
Mar 16 17:52:42 ASR5600G smartd[1136]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 127 to 128
Mar 16 17:52:42 ASR5600G smartd[1136]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 165 to 166
Mar 16 17:52:42 ASR5600G smartd[1136]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 129
Mar 16 17:52:42 ASR5600G smartd[1136]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 131 to 129
Mar 16 17:52:42 ASR5600G smartd[1136]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 129
Mar 16 17:52:48 ASR5600G hd-idle[1117]: spinup: sda
Mar 16 17:52:48 ASR5600G hd-idle[1117]: spinup: sdb
Mar 16 17:52:48 ASR5600G hd-idle[1117]: spinup: sdc
Mar 16 17:52:48 ASR5600G hd-idle[1117]: spinup: sdd
Mar 16 17:57:48 ASR5600G hd-idle[1117]: spindown: sda
Mar 16 17:57:48 ASR5600G hd-idle[1117]: spindown: sdb
Mar 16 17:57:48 ASR5600G hd-idle[1117]: spindown: sdc
Mar 16 17:57:48 ASR5600G hd-idle[1117]: spindown: sdd
Mar 16 18:22:42 ASR5600G smartd[1136]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 128 to 129
Mar 16 18:22:42 ASR5600G smartd[1136]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 130
Mar 16 18:22:42 ASR5600G smartd[1136]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 130
Mar 16 18:22:42 ASR5600G smartd[1136]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 130
Mar 16 18:22:44 ASR5600G chronyd[1350]: Source 2a02:3d8:1::1:2 replaced with 2a01:3f7:3:1::1
Mar 16 18:22:48 ASR5600G hd-idle[1117]: spinup: sda
Mar 16 18:22:48 ASR5600G hd-idle[1117]: spinup: sdb
Mar 16 18:22:48 ASR5600G hd-idle[1117]: spinup: sdc
Mar 16 18:22:48 ASR5600G hd-idle[1117]: spinup: sdd
Mar 16 18:27:48 ASR5600G hd-idle[1117]: spindown: sda
Mar 16 18:27:48 ASR5600G hd-idle[1117]: spindown: sdb
Mar 16 18:27:48 ASR5600G hd-idle[1117]: spindown: sdc
Mar 16 18:27:48 ASR5600G hd-idle[1117]: spindown: sdd
And so on.
smartd looks the culprit.
~> systemctl list-units --type service
...
smartd.service loaded active running Self Monitoring and Reporting Technol>
~> sudo smartd -D
...
-n MODE No check if: never, sleep,N],q], standby,N],q], idle,N],q]
I understand I should add “-n idle” in the command.
BTW I don’t know the difference between sleep, standby and idle
This is where I need your help, I don’t know how to do.
I found more info here
-n POWERMODE,N],q] [ATA only] This ‘nocheck’ Directive is used to prevent a disk from being spun-up when it is periodically polled by smartd. ATA disks have five different power states. In order of increasing power consumption they are: ‘OFF’, ‘SLEEP’, ‘STANDBY’, ‘IDLE’, and ‘ACTIVE’. Typically in the OFF, SLEEP, and STANDBY modes the disk’s platters are not spinning. But usually, in response to SMART commands issued by smartd, the disk platters are spun up. So if this option is not used, then a disk which is in a low-power mode may be spun up and put into a higher-power mode when it is periodically polled by smartd.
Note that if the disk is in SLEEP mode when smartd is started, then it won’t respond to smartd commands, and so the disk won’t be registered as a device for smartd to monitor. If a disk is in any other low-power mode, then the commands issued by smartd to register the disk will probably cause it to spin-up.
The ‘-n’ (nocheck) Directive specifies if smartd’s periodic checks should still be carried out when the device is in a low-power mode. It may be used to prevent a disk from being spun-up by periodic smartd polling. The allowed values of POWERMODE are:
never - smartd will poll (check) the device regardless of its power mode. This may cause a disk which is spun-down to be spun-up when smartd checks it. This is the default behavior if the ‘-n’ Directive is not given.
sleep - check the device unless it is in SLEEP mode.
standby - check the device unless it is in SLEEP or STANDBY mode. In these modes most disks are not spinning, so if you want to prevent a laptop disk from spinning up each time that smartd polls, this is probably what you want.
idle - check the device unless it is in SLEEP, STANDBY or IDLE mode. In the IDLE state, most disks are still spinning, so this is probably not what you want.
Maximum number of skipped checks (in a row) can be specified by appending positive number ‘,N’ to POWERMODE (like ‘-n standby,15’). After N checks are skipped in a row, powermode is ignored and the check is performed anyway.
When a periodic test is skipped, smartd normally writes an informal log message. The message can be suppressed by appending the option ‘,q’ to POWERMODE (like ‘-n standby,q’). This prevents a laptop disk from spinning up due to this message.
Both ‘,N’ and ‘,q’ can be specified together.
So, question: What is the state of the HDD when hd-idle spindown it? ‘OFF’, ‘SLEEP’, ‘STANDBY’, ‘IDLE’?
Should I add the following lines (at the end?) of /etc/smartd.conf?
DEFAULT -n idle
/dev/sda
/dev/sdb
/dev/sdb
/dev/sdd
Hi
Looks like you need to add a number in there as well to skip N checks. Test and review the results
I don’t understand what happen, could you explain?
Code bellow:
- 1 smartd conf.
- 2 journalctl; spindown after 300s (5mn), spinup every 30mn. Look at the timestamp.
- 3 HDD are standby; I can confirm, no sound, no vibration at all. Look at the timestamp.
~> cat /etc/smartd.conf
...
DEFAULT -n idle,100,q
/dev/sda
/dev/sdb
/dev/sdb
/dev/sdd
~> sudo journalctl -b -u hd-idle.service -u systemd-suspend.service -u smartd.service
[sudo] password for root:
-- Logs begin at Mon 2022-03-14 17:46:44 GMT, end at Sat 2022-03-19 10:53:28 GMT. --
Mar 19 09:52:08 localhost systemd[1]: Started hd-idle disk spindown service.
Mar 19 09:52:08 localhost hd-idle[1119]: hd-idle starting in nodaemon mode
Mar 19 09:52:08 localhost hd-idle[1119]: disk: sdd timeout: 300
Mar 19 09:52:08 localhost hd-idle[1119]: disk: sdc timeout: 300
Mar 19 09:52:08 localhost hd-idle[1119]: disk: sdb timeout: 300
Mar 19 09:52:08 localhost hd-idle[1119]: disk: sda timeout: 300
Mar 19 09:52:08 localhost hd-idle[1119]: default timeout: 0
Mar 19 09:52:08 localhost systemd[1]: Starting Self Monitoring and Reporting Technology (SMART) Daemon...
Mar 19 09:52:08 localhost smartd[1138]: smartd 7.0 2019-05-21 r4917 [x86_64-linux-5.16.13-lp153.3.g9251332-default] (SUSE RPM)
Mar 19 09:52:08 localhost smartd[1138]: Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
Mar 19 09:52:08 localhost smartd[1138]: Opened configuration file /etc/smartd.conf
Mar 19 09:52:08 localhost smartd[1138]: Drive: DEVICESCAN, implied '-a' Directive on line 32 of file /etc/smartd.conf
Mar 19 09:52:08 localhost smartd[1138]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], opened
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], WDC WD40EFRX-68N32N0, S/N:WD-WCC7K1URKCCA, WWN:5-0014ee-264ba7edb, FW:82.00A82, 4.00 TB
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], found in smartd database: Western Digital Red
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1URKCCA.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb, type changed from 'scsi' to 'sat'
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], opened
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], WDC WD40EFRX-68N32N0, S/N:WD-WCC7K3FP1KRD, WWN:5-0014ee-2b936f586, FW:82.00A82, 4.00 TB
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], found in smartd database: Western Digital Red
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], state read from /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K3FP1KRD.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc, type changed from 'scsi' to 'sat'
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], opened
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], WDC WD40EFRX-68WT0N0, S/N:WD-WCC4E1XXZ0TY, WWN:5-0014ee-20de6e65f, FW:82.00A82, 4.00 TB
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], found in smartd database: Western Digital Red
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], state read from /var/lib/smartmontools/smartd.WDC_WD40EFRX_68WT0N0-WD_WCC4E1XXZ0TY.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd, type changed from 'scsi' to 'sat'
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], opened
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], WDC WD40EFRX-68N32N0, S/N:WD-WCC7K1LDVZ6H, WWN:5-0014ee-2109636f0, FW:82.00A82, 4.00 TB
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], found in smartd database: Western Digital Red
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], state read from /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1LDVZ6H.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/nvme0, opened
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/nvme0, Samsung SSD 980 1TB, S/N:S649NX0RC29102M, FW:2B4QFXO7, 1.00 TB
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/nvme0, is SMART capable. Adding to "monitor" list.
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/nvme0, state read from /var/lib/smartmontools/smartd.Samsung_SSD_980_1TB-S649NX0RC29102M.nvme.state
Mar 19 09:52:08 localhost smartd[1138]: Monitoring 4 ATA/SATA, 0 SCSI/SAS and 1 NVMe devices
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 156 to 157
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 164 to 165
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 178 to 179
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 131 to 130
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], previous self-test completed with error (read test element)
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 131 to 130
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1URKCCA.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K3FP1KRD.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdc [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68WT0N0-WD_WCC4E1XXZ0TY.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/sdd [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1LDVZ6H.ata.state
Mar 19 09:52:08 localhost smartd[1138]: Device: /dev/nvme0, state written to /var/lib/smartmontools/smartd.Samsung_SSD_980_1TB-S649NX0RC29102M.nvme.state
Mar 19 09:52:08 localhost systemd[1]: Started Self Monitoring and Reporting Technology (SMART) Daemon.
Mar 19 09:57:38 ASR5600G hd-idle[1119]: spindown: sda
Mar 19 09:57:39 ASR5600G hd-idle[1119]: spindown: sdb
Mar 19 09:57:39 ASR5600G hd-idle[1119]: spindown: sdc
Mar 19 09:57:39 ASR5600G hd-idle[1119]: spindown: sdd
Mar 19 10:22:08 ASR5600G smartd[1138]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 128
Mar 19 10:22:08 ASR5600G smartd[1138]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 128
Mar 19 10:22:08 ASR5600G smartd[1138]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 129
Mar 19 10:22:08 ASR5600G smartd[1138]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 130 to 129
Mar 19 10:22:10 ASR5600G hd-idle[1119]: spinup: sda
Mar 19 10:22:10 ASR5600G hd-idle[1119]: spinup: sdb
Mar 19 10:22:10 ASR5600G hd-idle[1119]: spinup: sdc
Mar 19 10:22:10 ASR5600G hd-idle[1119]: spinup: sdd
Mar 19 10:27:10 ASR5600G hd-idle[1119]: spindown: sda
Mar 19 10:27:10 ASR5600G hd-idle[1119]: spindown: sdb
Mar 19 10:27:10 ASR5600G hd-idle[1119]: spindown: sdc
Mar 19 10:27:10 ASR5600G hd-idle[1119]: spindown: sdd
Mar 19 10:52:08 ASR5600G smartd[1138]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 128 to 129
Mar 19 10:52:08 ASR5600G smartd[1138]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 130
Mar 19 10:52:08 ASR5600G smartd[1138]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 129 to 130
Mar 19 10:52:10 ASR5600G hd-idle[1119]: spinup: sda
Mar 19 10:52:10 ASR5600G hd-idle[1119]: spinup: sdb
Mar 19 10:52:10 ASR5600G hd-idle[1119]: spinup: sdc
Mar 19 10:52:10 ASR5600G hd-idle[1119]: spinup: sdd
~> sudo hdparm -C /dev/sda /dev/sdb /dev/sdc /dev/sdd && date
/dev/sda:
drive state is: standby
/dev/sdb:
drive state is: standby
/dev/sdc:
drive state is: standby
/dev/sdd:
drive state is: standby
Sat 19 Mar 10:54:27 GMT 2022
Could you explain this?
Is there a way to add hdparm drive state in journalctl or if not to have another log with smartd and hdparm together (script)?
BTW, hdparm says drive state is standby, this is not idle. Should I change smartd.conf to standby?
Changes to default configuration:
**erlangen:~ #** diff /.snapshots/373/snapshot/etc/smartd.conf /etc/smartd.conf
24c24
< DEFAULT -d removable -s (S/../.././03|L/../(01|02|03|04|05|06|07)/7/01)
---
> DEFAULT -d removable -s (S/../.././03|L/../(01|02|03|04|05|06|07)/7/01) **-n standby**
**erlangen:~ #**
Both services work as expected. The following shows tests are executed when disk is active/idle and are skipped when drive is in standby mode:
**erlangen:~ #** journalctl -b -u smartd.service -u hd-idle.service --since 14:28
Mar 19 14:28:33 erlangen systemd[1]: Starting Self Monitoring and Reporting Technology (SMART) Daemon...
Mar 19 14:28:33 erlangen smartd[816]: smartd 7.2 2021-09-14 r5237 [x86_64-linux-5.16.14-1-default] (SUSE RPM)
Mar 19 14:28:33 erlangen smartd[816]: Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
Mar 19 14:28:33 erlangen smartd[816]: Opened configuration file /etc/smartd.conf
Mar 19 14:28:33 erlangen smartd[816]: Drive: DEVICESCAN, implied '-a' Directive on line 32 of file /etc/smartd.conf
Mar 19 14:28:33 erlangen smartd[816]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda [SAT], opened
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda [SAT], CT2000BX500SSD1, S/N:1944E225C2B1, WWN:5-00a075-1e225c2b1, FW:M6CR030, 2.00 TB
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda [SAT], found in smartd database: Crucial/Micron Client SSDs
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.CT2000BX500SSD1-1944E225C2B1.ata.state
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sdb, type changed from 'scsi' to 'sat'
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sdb [SAT], opened
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sdb [SAT], WDC WD40EZRX-22SPEB0, S/N:WD-WCC4E2FYXSNV, WWN:5-0014ee-262d2e71e, FW:80.00A80, 4.00 TB
Mar 19 14:28:33 erlangen smartd[816]: Device: /dev/sdb [SAT], found in smartd database: Western Digital Green
Mar 19 14:28:33 erlangen hd-idle[29799]: spinup: sdb
Mar 19 14:28:36 erlangen hd-idle[29799]: spindown: sdb
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/sdb [SAT], state read from /var/lib/smartmontools/smartd.WDC_WD40EZRX_22SPEB0-WD_WCC4E2FYXSNV.ata.state
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/nvme0, opened
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/nvme0, Samsung SSD 970 EVO Plus 2TB, S/N:S4J4NX0R834197L, FW:2B2QEXM7, 2.00 TB
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/nvme0, is SMART capable. Adding to "monitor" list.
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/nvme0, state read from /var/lib/smartmontools/smartd.Samsung_SSD_970_EVO_Plus_2TB-S4J4NX0R834197L.nvme.state
Mar 19 14:28:42 erlangen smartd[816]: Monitoring 2 ATA/SATA, 0 SCSI/SAS and 1 NVMe devices
Mar 19 14:28:42 erlangen smartd[816]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 65 to 66
Mar 19 14:28:43 erlangen hd-idle[29799]: spinup: sdb
Mar 19 14:28:46 erlangen hd-idle[29799]: spindown: sdb
**Mar 19 14:28:47 erlangen smartd[816]: Device: /dev/sdb [SAT], is in STANDBY mode, suspending checks
**Mar 19 14:28:47 erlangen smartd[816]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.CT2000BX500SSD1-1944E225C2B1.ata.state
Mar 19 14:28:47 erlangen smartd[816]: Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EZRX_22SPEB0-WD_WCC4E2FYXSNV.ata.state
Mar 19 14:28:47 erlangen smartd[816]: Device: /dev/nvme0, state written to /var/lib/smartmontools/smartd.Samsung_SSD_970_EVO_Plus_2TB-S4J4NX0R834197L.nvme.state
Mar 19 14:28:47 erlangen systemd[1]: Started Self Monitoring and Reporting Technology (SMART) Daemon.
**Mar 19 14:32:45 erlangen smartd[816]: Device: /dev/sdb [SAT], is back in ACTIVE or IDLE mode, resuming checks (23 checks skipped) **
Mar 19 14:32:45 erlangen smartd[816]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 180 to 181
Mar 19 14:32:46 erlangen hd-idle[29799]: spinup: sdb
Mar 19 14:33:01 erlangen hd-idle[29799]: spindown: sdb
**Mar 19 14:33:12 erlangen smartd[816]: Device: /dev/sdb [SAT], is in STANDBY mode, suspending checks
**Mar 19 14:33:27 erlangen smartd[816]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 66 to 65
Mar 19 14:33:37 erlangen smartd[816]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 65 to 66
**erlangen:~ #**
I changed /etc/smartd.conf to
DEFAULT -n standby
/dev/sda
/dev/sdb
/dev/sdb
/dev/sdd
- 1 I don’t get the message “smartd[816]: Device: /dev/sdb [SAT], is in STANDBY mode, suspending checks”
- 2 I still get “hd-idle[1128]: spindown: sdX” but they are NOT spinning
- 3 Your smartd version is 7.2 2021-09-14 r5237 [x86_64-linux-5.16.14-1-default] (SUSE RPM)
My version is 7.0 2019-05-21 r4917 [x86_64-linux-5.16.13-lp153.3.g9251332-default] (SUSE RPM)
I can see the newer version as alternate but I don’t know how to update. Could you let me know?
Show what you see:
**erlangen:~ #** zypper lr -uE
# | Alias | Enabled | GPG Check | Priority | URI
---+----------------------+---------+-----------+----------+---------------------------------------------------------------------------------------
5 | Packman | Yes | (r ) Yes | 90 | http://ftp.fau.de/packman/suse/openSUSE_Tumbleweed/
15 | non-oss | Yes | (r ) Yes | 99 | http://download.opensuse.org/tumbleweed/repo/non-oss/
17 | oss | Yes | (r ) Yes | 99 | http://download.opensuse.org/tumbleweed/repo/oss/
24 | update | Yes | (r ) Yes | 99 | http://download.opensuse.org/update/tumbleweed/
2 | BellSoft | Yes | (r ) Yes | 100 | http://yum.bell-sw.com/
3 | Geo | Yes | (r ) Yes | 100 | http://download.opensuse.org/repositories/Application:/Geo/openSUSE_Tumbleweed/
7 | chrome | Yes | (r ) Yes | 100 | http://dl.google.com/linux/chrome/rpm/stable/x86_64
11 | home_kukuk_qmapshack | Yes | (r ) Yes | 100 | https://download.opensuse.org/repositories/home:/kukuk:/qmapshack/openSUSE_Tumbleweed/
12 | jalbum | Yes | ( p) Yes | 100 | http://jalbum.net/download/software/yumrepo/
14 | myrepo | Yes | ( ) No | 100 | dir:/home/karl/Downloads/myrepo
**erlangen:~ #**
**erlangen:~ #** zypper se -s smartmontools
Loading repository data...
Reading installed packages...
S | Name | Type | Version | Arch | Repository
--+---------------+---------+---------+--------+-----------------------
i | smartmontools | package | 7.2-6.2 | x86_64 | Haupt-Repository (OSS)
v | smartmontools | package | 7.2-6.2 | i586 | Haupt-Repository (OSS)
**erlangen:~ #**
Hi
Tumbleweed vs Leap 15.3, use the version from the release
~> zypper lr -uE
Repository priorities in effect: (See 'zypper lr -P' for details)
90 (raised priority) : 1 repository
99 (default priority) : 9 repositories
# | Alias | Name | Enabled | GPG Check | Refresh | URI
---+--------------------------------------+--------------------------------------------------------------+---------+-----------+---------+------------------------------------------------------------------------------
1 | Kernel_stable_Backport | Kernel builds for branch stable (standard) | Yes | (r ) Yes | Yes | https://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/
2 | brave-browser | brave-browser | Yes | (r ) Yes | No | https://brave-browser-rpm-release.s3.brave.com/x86_64/
3 | https-download.opensuse.org-fe382af1 | home:geekositalia | Yes | (r ) Yes | Yes | https://download.opensuse.org/repositories/home:/geekositalia/15.3/
4 | packman | packman | Yes | (r ) Yes | Yes | https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.3/
6 | repo-backports-update | Update repository of openSUSE Backports | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.3/backports/
11 | repo-non-oss | Non-OSS Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
12 | repo-oss | Main Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
14 | repo-sle-update | Update repository with updates from SUSE Linux Enterprise 15 | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.3/sle/
15 | repo-update | Main Update Repository | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.3/oss
16 | repo-update-non-oss | Update Repository (Non-Oss) | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/15.3/non-oss/
~> zypper se -s smartmontools
Loading repository data...
Reading installed packages...
S | Name | Type | Version | Arch | Repository
--+---------------+------------+------------------+--------+-------------------------------------------------------------
v | smartmontools | package | 7.2-150300.8.5.1 | x86_64 | Update repository with updates from SUSE Linux Enterprise 15
i | smartmontools | package | 7.0-6.1 | x86_64 | Main Repository
| smartmontools | srcpackage | 7.2-150300.8.5.1 | noarch | Update repository with updates from SUSE Linux Enterprise 15
Should I stay with v7.0? >>> Should I remove some repos?
Edit:
~> zypper lr -uEP
# | Alias | Name | Enabled | GPG Check | Refresh | Priority | URI
---+--------------------------------------+--------------------------------------------------------------+---------+-----------+---------+----------+------------------------------------------------------------------------------
4 | packman | packman | Yes | (r ) Yes | Yes | 90 | https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.3/
1 | Kernel_stable_Backport | Kernel builds for branch stable (standard) | Yes | (r ) Yes | Yes | 99 | https://download.opensuse.org/repositories/Kernel:/stable:/Backport/standard/
2 | brave-browser | brave-browser | Yes | (r ) Yes | No | 99 | https://brave-browser-rpm-release.s3.brave.com/x86_64/
3 | https-download.opensuse.org-fe382af1 | home:geekositalia | Yes | (r ) Yes | Yes | 99 | https://download.opensuse.org/repositories/home:/geekositalia/15.3/
6 | repo-backports-update | Update repository of openSUSE Backports | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/update/leap/15.3/backports/
11 | repo-non-oss | Non-OSS Repository | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
12 | repo-oss | Main Repository | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
14 | repo-sle-update | Update repository with updates from SUSE Linux Enterprise 15 | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/update/leap/15.3/sle/
15 | repo-update | Main Update Repository | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/update/leap/15.3/oss
16 | repo-update-non-oss | Update Repository (Non-Oss) | Yes | (r ) Yes | Yes | 99 | http://download.opensuse.org/update/leap/15.3/non-oss/
Hi
I would stick with the version 7.0 from the release…
I was on the way to update because I think there is a bug.
Have a look at my posts #25 and #27, the info returned “spinup” is wrong (disk is in fact spundown)
Should I report a bug?
As I want to monitor the disks activity, Is there a way to log smartd, hd-idle and hdparm together to get a real behaviour?
“journalctl -b -u smartd.service -u hd-idle.service” does exactly this, see post #26.
In post #26, I can see smartd, hd-idle but not hdparm. hdparm is the only to report exact spinup/spindown disks state.
See post #25 in CODE.
I want to see the 3 with timestamp.
Nope. smartd.service correctly reports state when invoked with “-n standby”, see bold lines in post #26.
Yes I can see it but
~> cat /etc/smartd.conf
...
DEFAULT -n standby
/dev/sda
/dev/sdb
/dev/sdb
/dev/sdd
~> sudo journalctl -b -u hd-idle.service -u systemd-suspend.service -u smartd.service
...
Mar 20 09:58:21 localhost smartd[1139]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 158 to 157
Mar 20 09:58:21 localhost smartd[1139]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 134 to 127
Mar 20 09:58:21 localhost smartd[1139]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 134 to 127
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdc [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 179 to 178
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 135 to 127
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdd [SAT], SMART Prefailure Attribute: 3 Spin_Up_Time changed from 162 to 163
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 134 to 128
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1URKCCA.ata.state
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdb [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K3FP1KRD.ata.state
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdc [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68WT0N0-WD_WCC4E1XXZ0TY.ata.state
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/sdd [SAT], state written to /var/lib/smartmontools/smartd.WDC_WD40EFRX_68N32N0-WD_WCC7K1LDVZ6H.ata.state
Mar 20 09:58:22 localhost smartd[1139]: Device: /dev/nvme0, state written to /var/lib/smartmontools/smartd.Samsung_SSD_980_1TB-S649NX0RC29102M.nvme.state
Mar 20 09:58:22 localhost systemd[1]: Started Self Monitoring and Reporting Technology (SMART) Daemon.
Mar 20 10:03:51 ASR5600G hd-idle[1119]: spindown: sda
Mar 20 10:03:52 ASR5600G hd-idle[1119]: spindown: sdb
Mar 20 10:03:52 ASR5600G hd-idle[1119]: spindown: sdc
Mar 20 10:03:52 ASR5600G hd-idle[1119]: spindown: sdd
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sda [SAT], old test of type S not run at Sun Mar 20 03:00:00 2022 GMT, starting now.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sda [SAT], starting scheduled Short Self-Test.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 127 to 128
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdb [SAT], old test of type S not run at Sun Mar 20 03:00:00 2022 GMT, starting now.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdb [SAT], starting scheduled Short Self-Test.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 127 to 129
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdc [SAT], old test of type S not run at Sun Mar 20 03:00:00 2022 GMT, starting now.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdc [SAT], starting scheduled Short Self-Test.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdd [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 128 to 129
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdd [SAT], old test of type S not run at Sun Mar 20 03:00:00 2022 GMT, starting now.
Mar 20 10:28:22 ASR5600G smartd[1139]: Device: /dev/sdd [SAT], starting scheduled Short Self-Test.
Mar 20 10:28:23 ASR5600G hd-idle[1119]: spinup: sda
Mar 20 10:28:23 ASR5600G hd-idle[1119]: spinup: sdb
Mar 20 10:28:23 ASR5600G hd-idle[1119]: spinup: sdc
Mar 20 10:28:23 ASR5600G hd-idle[1119]: spinup: sdd
Mar 20 10:33:23 ASR5600G hd-idle[1119]: spindown: sda
Mar 20 10:33:23 ASR5600G hd-idle[1119]: spindown: sdb
Mar 20 10:33:23 ASR5600G hd-idle[1119]: spindown: sdc
Mar 20 10:33:24 ASR5600G hd-idle[1119]: spindown: sdd
~> sudo hdparm -C /dev/sda /dev/sdb /dev/sdc /dev/sdd && date
[sudo] password for root:
/dev/sda:
drive state is: active/idle
/dev/sdb:
drive state is: active/idle
/dev/sdc:
drive state is: active/idle
/dev/sdd:
drive state is: active/idle
Sun 20 Mar 10:29:19 GMT 2022
~> sudo hdparm -C /dev/sda /dev/sdb /dev/sdc /dev/sdd && date
[sudo] password for root:
/dev/sda:
drive state is: standby
/dev/sdb:
drive state is: standby
/dev/sdc:
drive state is: standby
/dev/sdd:
drive state is: standby
Sun 20 Mar 10:38:09 GMT 2022
To sum up, look at the timestamps, right now, /etc/smartd.conf with only -n standby lead to disk spinup when smartd start. I don’t want that.
When /etc/smartd.conf has -n standby,N,q (I tried N=30 and 100)
Mar 20 11:23:17 ASR5600G hd-idle[1117]: spinup: sdd
Mar 20 11:28:17 ASR5600G hd-idle[1117]: spindown: sda
Mar 20 11:28:17 ASR5600G hd-idle[1117]: spindown: sdb
Mar 20 11:28:17 ASR5600G hd-idle[1117]: spindown: sdc
Mar 20 11:28:17 ASR5600G hd-idle[1117]: spindown: sdd
Mar 20 11:53:15 ASR5600G smartd[1142]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 126 to 127
Mar 20 11:53:15 ASR5600G smartd[1142]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 127 to 128
Mar 20 11:53:15 ASR5600G smartd[1142]: Device: /dev/sdc [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 127 to 128
Mar 20 11:53:17 ASR5600G hd-idle[1117]: spinup: sda
Mar 20 11:53:17 ASR5600G hd-idle[1117]: spinup: sdb
Mar 20 11:53:17 ASR5600G hd-idle[1117]: spinup: sdc
Mar 20 11:53:17 ASR5600G hd-idle[1117]: spinup: sdd
~> sudo hdparm -C /dev/sda /dev/sdb /dev/sdc /dev/sdd && date
[sudo] password for root:
/dev/sda:
drive state is: standby
/dev/sdb:
drive state is: standby
/dev/sdc:
drive state is: standby
/dev/sdd:
drive state is: standby
Sun 20 Mar 11:54:14 GMT 2022
To sum up, journalctl report false spinup. There is a bug here. I reported it LUKS Disk is in standby and hd-idle reports as spunDown as false · Issue #69 · adelolmo/hd-idle · GitHub
It’s why I want a log with smartd, hd-idle, hdparm with timestamp in the same file.
Not so fast! No false state reported by hd-idle whatsoever on host erlangen:
erlangen:~ # zypper if hd-idle
Loading repository data...
Reading installed packages...
Information for package hd-idle:
--------------------------------
Repository : @System
Name : hd-idle
Version : 1.05-1.29
Arch : x86_64
**Vendor : obs://build.opensuse.org/home:X0F**
Installed Size : 38.4 KiB
Installed : Yes
Status : up-to-date
Source package : hd-idle-1.05-1.29.src
Upstream URL : http://hd-idle.sourceforge.net/
Summary : Spin down external harddisks
Description :
hd-idle is a utility program for spinning-down external disks after a period of idle time. Since most external IDE disk enclosures don't support setting the IDE idle timer, a program like hd-idle is required to spin down idle disks automatically.
erlangen:~ #
The installed version works flawlessly since many years. Install the above version or equivalant for Leap and report.
My version
Information for package hd-idle:
--------------------------------
Repository : home:geekositalia
Name : hd-idle
Version : 1.05-lp153.2.1
Arch : x86_64
Vendor : obs://build.opensuse.org/home:geekositalia
Installed Size : 30.4 KiB
Installed : Yes
Status : up-to-date
Source package : hd-idle-1.05-lp153.2.1.src
Summary : Spin down external harddisks
Description :
hd-idle is a utility program for spinning-down external disks after a period of idle time. Since most external IDE disk
enclosures don't support setting the IDE idle timer, a program like hd-idle is required to spin down idle disks automatically.
from here Leap 15.3
When I try to install 1.05-1.29 Trumbleweed, I get
The install link or file you opened does not contain instructions for openSUSE Leap 15.3.
I don’t know what to do.
@MrNice
Both are the same versions… 1.05. The other numbers are build versions…
Your version is a link to user home:X0F:HSF/hd-idle
https://build.opensuse.org/package/show/home:geekositalia/hd-idle
Both smartd are not the same version;
- smartd 7.0 2019-05-21 r4917 [x86_64-linux-5.16.13-lp153.3.g9251332-default] (SUSE RPM)
- smartd 7.2 2021-09-14 r5237 [x86_64-linux-5.16.14-1-default] (SUSE RPM)
Do you think I could upgrade to 7.2 from here, Leap 15.3?