From: Bruce A. <ba...@gr...> - 2004-01-09 16:55:23
|
Peter, Erik I've spent a few minutes browsing the hdparm source code and reading the ATA specifications. Disks like yours have four power modes. From highest to lowest power they are: ACTIVE IDLE STANDBY SLEEP I am not certain, but I think that these correspond roughly to the following: ACTIVE: disks spinning, heads moving, data being read/written IDLE: disks spinning, heads not moving (parked?), no data being read/written STANDBY: disks not spinning, heads not moving, responds to commands SLEEP: disks not spinning, heads not moving, no response to commands. Device must be reset to get any response. From reading the documentation, it's not clear that the SMART commands necessarily spin up the disks (this is probably vendor-specific). The way that we can find out about the state of the disk, is by using the ATA "CHECK POWER MODE" command. (Note: in the SLEEP state, this command will simply not return - but neither will the current smartd calls!) Else it will return (in the Sector Count register) either: 00h device is in STANDBY mode. 80h device is in IDLE mode. FFh device is in ACTIVE mode or IDLE mode. I think that what is probably needed is another Directive in smartd.conf: '-n' meaning 'no-spin-up'. Possible arguments would be: -n ignore -n standby -n idle The default, if the user does not give this Directive, is -n ignore. The modified smartd logic would be that if '-n standby' or '-n idle' have been given, then before checking the disk status, smartd will give the ATA "CHECK POWER MODE" command. If the user has set '-n idle' then if the disk status is either IDLE or STANDBY, skip checking If the user has set '-n standby' then if the disk status is STANDBY, skip checking This should be easy to implement. I think perhaps only the -n standby option is needed, because I think that in idle mode the disks are already spinning. But this might well be vendor-specific. Peter, could you try and determine if, just after your disk spins down, if it's in idle or standby mode? Erik, it's true that we'd have to add a 'CHECK POWER MODE' command, but it's simple compared to most others. And if a particular OS doesn't want to implement it, they just return -1 for failure of the command, and we proceed as we would if the disk was in ACTIVE mode. Cheers, Bruce > Hi Peter, > > > I have been playing with Smartmontools 5.26. :-) > > > > My second (noisy) hard drive is normally spun down, but Smartmontools > > spun it up at regular 30 minute intervals - until I modified > > /etc/smartd.conf to only look at the main drive. > > > > Could a configuration option be added to /etc/smartd.conf to postpone > > interrogating spun down disks, or only look at those parameters that > > do not require that the disk be spun up, until something else causes > > the disk in question to be spun up? Possibly calling "hdparm -C > > /dev/hdx", or similar from inside Smartmontools could be useful. > > Interesting idea... > > So you'd like smartd to first ask the disk, 'are you currently spinning'? > And if the answer is 'no', then just skip it and move on to the next disk. > > I don't know enough about sleep, standby, and idle modes to know if this > is possible. It may be that *any* command to a spun-down disk causes it > to spin-up, even if that command doesn't require that the platters be > moving. > > But the hdparm -C command suggests otherwise. I'll take a look at the > hdparm code to see how it works, and get back to you about this. If I > provide some guidance, would you be willing to modify/test smartd.c? > > Bruce > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Perforce Software. > Perforce is the Fast Software Configuration Management System offering > advanced branching capabilities and atomic changes on 50+ platforms. > Free Eval! http://www.perforce.com/perforce/loadprog.html > _______________________________________________ > Smartmontools-support mailing list > Sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartmontools-support > > |