Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there anyway to find out if a hard drive has spun down? I've been using the following command to spin it down after idle time:

hdparm -S 120 /dev/hdX

However im not sure it's working correctly and was wondering how to check the current power state to see if has correctly powered down.

Thanks

share|improve this question

2 Answers 2

You can find out the power status with the -C flag to hdparm:

hdparm -C /dev/hdX

As explained by man 8 hdparm:

-C

Check the current IDE power mode status, which will always be one of unknown (drive does not support this command), active/idle (normal operation), standby (low power mode, drive has spun down), or sleep‐ ing (lowest power mode, drive is completely shut down). The -S, -y, -Y, and -Z flags can be used to manipulate the IDE power modes.

share|improve this answer
2  
Caution: many people report that hdparm -C wakes up the drive and recommend using smartctl -i -n standby instead. (see serverfault.com/questions/275364/… or serverfault.com/questions/204227/when-hdd-wakes-up) –  Benoit Blanchon Feb 26 '12 at 10:16
    
In testing BOTH hdparm -C and smartclt -i -n standby (Ubuntu Server 14.04.1 LTS) –  STW Nov 10 '14 at 13:04

As I don't have hdparm nor smartctl available on my NAS I checked the /proc as I assumed that it had to be there somewhere, too.

Well, if it's down:

root@NAS:~# cat /proc/d_suspdtime
SuspendingTime = 15
Disk0: STANDBY
Disk1: No_Disk
root@NAS:~# 

If the kitten would go crazy on it:

root@NAS:~# cat /proc/d_suspdtime
SuspendingTime = 15
Disk0: ACTIVE
Disk1: No_Disk
root@NAS:~# 

I also got

root@NAS:/proc# cat /proc/d_suspdtime
SuspendingTime = 15
Disk0: NO_ACTIVE
Disk1: No_Disk
root@NAS:~# 

Guessing from some testing:

  • ACTIVE: the HDD did something within a certain timespan (it doesn't seem to mean that it does something right now)
  • NO_ACTIVE: there was some activity, but in a while it'll be going to standby
  • STANDBY: well, the HDD is in standby

And to be complete on this SuspendingTime is the time in minutes after the HDD should go to standby.

Since I'm no Unix-pro I can't tell if you are supposed to have /proc/d_suspdtime on your system, too (guessing from Google results it may be related to NAS or busybox).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.