Is there a way for me to see if my hard drive is actually spinning or in sleep mode under Windows 7?
I am looking for answers for both internal and external hard drives; they don't always have a light to indicate their status.
-
External drive : regard the status light. Internal drives will all sleep together, so no utility can be executed. More details are needed for a more meaningful answer.– harrymcMar 13, 2012 at 14:19
-
I have both, internal and external drives. The enclosures I got doesn't have light showing sleep mode. I thought question is very simple and I know how to do it in Linux, but couldn't find software for Win.– PabloMar 13, 2012 at 14:22
-
Here is the link: after Microsoft have removed the sidebar platform... they want you buy window 8 ... :).....pcsupport.about.com/od/windowsvista/tp/vistagadgetssu.01.htm– user218473Sep 13, 2013 at 15:24
6 Answers
The smartctl
command-line utility of smartmontools offers exactly this functionality with the -n
switch.
From the man page:
-n POWERMODE, --nocheck=POWERMODE
[ATA only] Specifies if smartctl should exit before performing any checks when the device is in a low-power mode. It may be used to prevent a disk from being spun-up by smartctl.
It works from a non-elevated terminal even as the only option argument, which makes its use pretty straightforward for internal drives:
> smartctl.exe -n standby d:
smartctl 6.5 2016-05-07 r4318 [x86_64-w64-mingw32-win10] (sf-6.5-1)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
d:: Device is in STANDBY (OS) mode, exit(2)
whereas a spinning drive reports Device is in ACTIVE or IDLE mode
External drives and/or exotic controllers might be more tricky and require you to read up on the -d
switch.
You could run DiskMon which would show all activity on each drive in your system. No entries would suggest that the disk is in sleep mode.
Limited testing here confirms that this would appear to be the case anyway. When trying to access a drive that isn't being listed in the current transactions, there is a delay before the drive shows up in the DiskMon window indicating that it has been spun down.
It's a bit crude I admit!
It's an inelegant solution, but try installing the windows version of hdparm. Then run hdparm.exe -C [drivename]
from the directory it installed to (usually Program Files (x86)
or the like). Using this method, I was able to tell whether my drives were active/idle, or in standby (sleeping and not spinning).
The drive name is a UNIX style device address which is mapped somehow to a Windows drive letter/physical device (/dev/hda
is usually your primary drive, and then /dev/hdb
and so on), but I'm not sure how to determine what UNIX device aliases are available under windows. You can make sure that a given /dev/hd_
alias corresponds to the correct drive by running hdparm.exe -i [drivename]
on the alias, and checking the output to see if the drive parameters match up with what you expect.
It would be nice if there was a graphical and/or native-windows utility to get at this functionality, but I don't know of one.
It's still UNIX-ish, but you could also try playing around with the Windows version of smartmontools, and see if it offers similar functionality in a more usable package. I don't have any experience with that software, though.
-
5smartmontools uses S.M.A.R.T. - but any usage of S.M.A.R.T. on a sleeping drive will wake it up. A case of Catch-22.– harrymcMar 13, 2012 at 16:51
You could use a PowerShell script to get the status of disk drives for which this information is available (not all drives give back this status).
Try this in a Windows PowerShell console (probably run as administrator) :
Get-WMIObject -class Win32_DiskDrive | Select-Object caption,availability
The interesting values for availability can be found here :
3 (0x3) : Running or Full Power
7 (0x7) : Power Off
8 (0x8) : Off Line
13 (0xD) : Power Save - Unknown
14 (0xE) : Power Save - Low Power Mode
15 (0xF) : Power Save - Standby
16 (0x10) : Power Cycle
17 (0x11) : Power Save - Warning
If Win32_DiskDrive does not work for you, other possibilities are Win32_LogicalDisk and Win32_Volume.
If any one of them works, you could also create a script, for example :
$strComputer = "."
$colItems = get-wmiobject -class "Win32_Volume" -namespace "root\cimv2" -computername strComputer
foreach ($objItem in $colItems) {
write-host "Name: " $objItem.Name " Availability: " $objItem.Availability
}
-
7You should have commented here that the availability attribute is always displayed as empty - I think it's probably not implemented by Microsoft. The problem with all the disk-status utilities I was able to find is that they use S.M.A.R.T. which will wake up a sleeping drive, so this is a real conundrum. I think you should contact Microsoft to complain about the availability attribute not working.– harrymcSep 11, 2013 at 18:36
-
1I just tried it on a WS2008 R2 with Powershell 2 and I also get an empty value for Availability– AFractFeb 26, 2017 at 11:18
You could use Uwe Siebers nice freeware FFB - Flush File Buffers.
FFB is a commandline tool which flushes the write cache of one or more storage volumes.
...
Sleeping drives are skipped unless -f is given.
Fail save method: with your ear layed on the drive or the place on the laptop where there drive sits, trigger a drive access. With any mechanical disk, you should clearly hear a spin-up sound if the drive has been in sleep mode.
-
3The goal is probably more to know if/when a HDD is in Sleep mode rather than wake it up...– AFractFeb 26, 2017 at 11:19