Opened 11 days ago

Last modified 10 days ago

#1381 new enhancement

--nocheck standby is ignored if device does not support power check which causes spin up

Reported by: Marc Gutt Owned by:
Priority: minor Milestone: undecided
Component: smartctl Version: 7.1
Keywords: Cc:

Description

I connected an HDD through USB. The USB controller blocks some hdparm/ATA commands and by that the following:

smartctl -n standby -A /dev/sdg

returns:

CHECK POWER MODE: incomplete response, ATA output registers missing
CHECK POWER MODE not implemented, ignoring -n option

I would prefer that it does not ignore the -n option in such a case to avoid HDD spin up (the reason why -n was used).

This caused a small bug in Unraid:
https://forums.unraid.net/bug-reports/stable-releases/683-usb-hdds-randomly-spin-up-but-status-stays-unchanged-r1091/

But I was able to solve it by changing the command to the "-i" option:

smartctl -n standby -i /dev/sdg

It returns the same "not implemented" error, but it does luckily not spin up the HDD.

Change History (2)

comment:1 Changed 11 days ago by Christian Franke

Component: allsmartctl
Milestone: undecided

Long standing (14+ year old, see r2227) behavior should not be changed as others may rely on it.

We could possibly further enhance the option as
-n POWERMODE[,STATUS1[,STATUS2]].
If STATUS2 is specified and CHECK POWER MODE is not supported, exit immediately with this status.

For example:

  smartctl -n standby,3,5 -x /dev/ice

If device is in STANDBY mode, exit(3). If CHECK POWER MODE is not supported, exit(5). Otherwise proceed as usual.

PS: It depends on drive firmware, USB bridge and OS whether specific pass-through commands spin up the disk. smartctl -i may also spin up and smartctl -A may not.

comment:2 Changed 10 days ago by Marc Gutt

I would prefer:
-n standby
-n standby-force

"force" adds the new "exit(5)" behaviour and would be the short form of "force nocheck even device does not support power check mode". Or "standby-skip" as a short form of "skip on errors".

Note: See TracTickets for help on using tickets.