Christopher (Drashna) Posted November 27, 2015 Share Posted November 27, 2015 Getting the correct power state of the disk is a little tricky. There are really 2 separate mechanisms that control whether a disk has spun down or not, the OS and the disk's firmware. Here are the tricky parts: The disk's firmware can spin a drive down at any time without the OS's knowledge. But this is typically disabled on new drives. This behavior can be modified under Disk Control in the StableBit Scanner. In order to get the actual power state of the drive we can query it directly, instead of asking Windows. The problem here is that, to Windows, this appears as disk access and it will prevent the OS from ever spinning down the drive. What the StableBit Scanner does by default is it always asks the OS and it never queries the drive directly. This ensures that the OS will spin the drive down correctly. even though we're querying it for the power state. But the issue here is that just because the OS thinks that the drive is active doesn't mean that it's actually spun up. If the disk's firmware has spun down the drive, the OS has no way to know that. The StableBit Scanner deals with this by reporting in the UI that the drive is Standby or Active. Since we can't attempt to query the drive directly without your explicit permission (this will upset Windows' power management), this is the best answer we can give you. The Query power mode directly from disk option, which is found in Disk Settings, is there to work around this shortcoming. When enabled, the StableBit Scanner will attempt to query the power mode directly from the disk. Keep in mind that this can fail if it can't establish Direct I/O to the disk, in which case we fall beck to relying on the OS. The way it works is like this: Query the OS. If the disk has spun down then this must be the case. The disk is in Standby. If the disk is Active (spun up) then we can't trust the OS because the disk firmware could have spun it down. If the user has not explicitly allowed us to query the power mode from the disk, we must assume Standby or Active. If the user has allowed us to query the power mode from the disk, query the power mode. If the query succeeds, set the mode to Active or to Standby (not both, because we know the power state for sure). If the query fails, fall back to the OS and set the mode to Standby or Active. So when should you enable Query power mode directly from disk? When you don't want to use the OS's power management features to spin the disk down. Why would you do this? Pros: You can control the spin down on a per disk basis. You get exact disk power states being reported in the StableBit Scanner with no ambiguity. Avoid disk spin up issues when querying SMART (I will explain below). Cons: Requires Direct I/O to the disk. To the OS (and to any other program that queries the OS) the disk will appear to be always spun up. When the OS spins down a disk it flushes the file system cache prior to spinning it down. This ensures that the disk is not spun up very quickly after that because it needs to write some additional data to it from the cache. When the firmware spins a disk down, this does not happen and there is a chance that the disk will be spun up very quickly after that to perform another write. From my experience, this is not common in practice. What about S.M.A.R.T. queries? In the StableBit Scanner, by default, SMART is queried from WMI first. If Direct I/O is not available then all the SMART data has to come from WMI. Typically this would not spin up a disk. If Direct I/O is possible to the disk then at least some additional SMART data will come from Direct I/O (and if WMI doesn't have the SMART data then all of the SMART data comes from Direct I/O). One potential problem here is that Windows considers any communication with the disk, disk activity. So if you're communicating with the disk to retrieve SMART every couple of minutes then Windows will not spin the disk down. You can avoid this problem in 2 ways: Don't let Windows control your disk spin down and set up a Standby timer in Disk Control (this has the pros and cons as outlined above). Set Throttle queries in Settings -> Scanner Settings -> SMART -> Throttle queries. Set the throttle minutes to something higher than the Windows disk spin down time (which can be examined in Power Options under the Windows Control Panel). The option Only query during the work window or if scanning controls SMART queries and has no effect on power queries. Again, by default power queries do not spin up a disk unless you've manually enabled Query power mode directly from disk (in which case you are effectively saying that you don't want the OS to ever spin down a disk). lvau 1 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.