Opened 4 years ago

Last modified 3 years ago

#513 new defect

Windows spins up and down disk even when ''-n standby'' is used

Reported by: Francisco Guindos Owned by:
Priority: minor Milestone: undecided
Component: all Version: 6.3
Keywords: windows Cc:

Description

When the -n standby flag is used to prevent smartctl (and smartd) spin-up the disk, this condition is detected but, anyway, disk is spun-up.
Tested in Windows 7 SP1 64bits, smartctl 6.3 2014-07-26 r3976

Attachments (5)

smartctl -n standby.png (58.9 KB) - added by Francisco Guindos 4 years ago.
Screen capture showing disks spun-up
Ticket #513.log (6.3 KB) - added by Francisco Guindos 4 years ago.
smartctl log of the three times it is used in my test
Ticket #513.pdf (252.6 KB) - added by Francisco Guindos 4 years ago.
test report with chronogram
TestStandby.cmd (716 bytes) - added by Francisco Guindos 3 years ago.
Script I use to test the bug
TestStandby.log (2.3 KB) - added by Francisco Guindos 3 years ago.
Log file with a few comments

Download all attachments as: .zip

Change History (14)

Changed 4 years ago by Francisco Guindos

Attachment: smartctl -n standby.png added

Screen capture showing disks spun-up

comment:1 Changed 4 years ago by Francisco Guindos

Keywords: windows added

comment:2 Changed 4 years ago by Christian Franke

Keywords: standby sleep removed
Priority: majorminor

Note that the Windows point of view may differ from actual device standby mode because the device has its own standby timer.

Which DiskPowerStatus tool is used here?

Please provide output of smartctl -r ioctl,2 -n standby -i sdX for a sdX which is in standby mode. Use a plain text(!) attachment, avoid screenshots.

comment:3 Changed 4 years ago by Francisco Guindos

You have the reason, yes. Windows (Win 7 SP1 x64) point of view fooled me. When smartctl access the disk in standby, it goes on in standby state but Windows thinks it has been activated. I was a fool believing in Windows. I can only say sorry to bother you and promise not to believe in Windows again.

I used a DiskPowerStatus? program that I wrote myself. I could sent it to you (and I will do if you want to), but now that I saw it only shows the Windows point of view and not the actual device status, I think it is of little value.

I got the log you asked, but I think that now it is not needed.

Having said that, why did I hear the spin ups and downs when I used smartctl or smartd?

I have conected the PC to a watt-meter and open the case to feel the disk spinning on my fingers and now I think I know what is happening: it is a collateral effect caused by a faulty Windows 7.
When a smartctl is used on a disk in standby, Windows mark it as active and, if there is no other activity on it, starts its count down to send it to stand by again. When the count down ends, Windows 7 send to standby a disk that already is in standby and it is done spinning up and immediately down the disk.
It is an odd behaviour of Windows 7 that breaks the really "smart" work of smartctl. I can't check if this is corrected in Windows 8 or 10 and I don't know if you think it worths the effort to code a workaround, but if you take this way, you can count on me as a beta tester. I think the way should be to ask Windows if it thinks disk is in standby (that's the only thing my DiskPowerStatus? does) before asking the actual state to the disk.

comment:4 Changed 4 years ago by Francisco Guindos

Summary: ''smartctl -n standby'' spins-up disksWindows spins up and down disk even when ''-n standby'' is used

comment:5 Changed 4 years ago by Christian Franke

Some RAID capable drivers (like Intel RST) return BusTypeRAID in STORAGE_DEVICE_DESCRIPTOR also for non-RAID drives. In this case, smartctl calls SMART_GET_VERSION to detect device type ATA/SATA. This I/O-control may spin-up the disk (without need). This detection is not done if the device type is specified with -d TYPE option.

Please retry with -d ata option added to smartctl command line. If this fixes the problem, close this ticket to "worksforme".

comment:6 Changed 4 years ago by Francisco Guindos

I tried the -d ata option getting the same result: smartctl does not spin up the disk if it is in standby, but it makes Windows 7 initiate a new disk idle timer, and once timed out, it (Windows) spins up and down the disk.

I attach smartctl logs and a report with a chronogram and my test environment.

Changed 4 years ago by Francisco Guindos

Attachment: Ticket #513.log added

smartctl log of the three times it is used in my test

Changed 4 years ago by Francisco Guindos

Attachment: Ticket #513.pdf added

test report with chronogram

comment:7 Changed 4 years ago by Christian Franke

Milestone: undecided

comment:8 Changed 3 years ago by Christian Franke

Please test whether the problem could be reproduced with a recent build which includes r4283 (see ticket #677).

comment:9 Changed 3 years ago by Francisco Guindos

I have tested a recent version (6.5 2016-05-01 r4314) and I can confirm
that the odd behaviour is still happening, though it is the same defect stated in ticket #677.

I have tested in Windows 7 professional. Right now, I have no Windows 10 computer to test it. I think I will update my systems by july and I will be able to test in this new version of OS. I think it is a fail most due to a Windows bug, so it could not happen in the new version.

I have some news. I run a command line script to test the bug and the commented bug occurs only if I run it in a shell with administrator privileges (Run as administrator), not when run as normal user.

I attach the script I use to test the bug. This uses DiskPowerStatus?.exe, but can run without it. Also, the log (commented).

Changed 3 years ago by Francisco Guindos

Attachment: TestStandby.cmd added

Script I use to test the bug

Changed 3 years ago by Francisco Guindos

Attachment: TestStandby.log added

Log file with a few comments

Note: See TracTickets for help on using tickets.