Opened 9 years ago

Last modified 8 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 9 years ago.
Screen capture showing disks spun-up
Ticket #513.log (6.3 KB ) - added by Francisco Guindos 9 years ago.
smartctl log of the three times it is used in my test
Ticket #513.pdf (252.6 KB ) - added by Francisco Guindos 9 years ago.
test report with chronogram
TestStandby.cmd (716 bytes ) - added by Francisco Guindos 8 years ago.
Script I use to test the bug
TestStandby.log (2.3 KB ) - added by Francisco Guindos 8 years ago.
Log file with a few comments

Download all attachments as: .zip

Change History (14)

by Francisco Guindos, 9 years ago

Attachment: smartctl -n standby.png added

Screen capture showing disks spun-up

comment:1 by Francisco Guindos, 9 years ago

Keywords: windows added

comment:2 by Christian Franke, 9 years ago

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 by Francisco Guindos, 9 years ago

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 by Francisco Guindos, 9 years ago

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

comment:5 by Christian Franke, 9 years ago

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 by Francisco Guindos, 9 years ago

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.

by Francisco Guindos, 9 years ago

Attachment: Ticket #513.log added

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

by Francisco Guindos, 9 years ago

Attachment: Ticket #513.pdf added

test report with chronogram

comment:7 by Christian Franke, 9 years ago

Milestone: undecided

comment:8 by Christian Franke, 8 years ago

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

comment:9 by Francisco Guindos, 8 years ago

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).

by Francisco Guindos, 8 years ago

Attachment: TestStandby.cmd added

Script I use to test the bug

by Francisco Guindos, 8 years ago

Attachment: TestStandby.log added

Log file with a few comments

Note: See TracTickets for help on using tickets.