# hdparm, hard drive spin down and power-management

## ColinAnderson

I've been trying to solve this problem on and off for the past couple of months, but have come no closer to resolving it.

I have three Seagate Barracuda ST3200822As that I'm trying to have power-down after 20 minutes of non-use.  However, they never spin down without my intervention -- they only remain in the "active/idle" state.  As far as I can tell, no program is using them (os is installed on a 40 gb drive, so this, I think, rules out the possibility of log file entries, etc.).

I can spin them down with hdparm -y /dev/hdx, so I know it's not an issue of hardware/software incompatibility.  As far as I can tell, there's nothing running in cron to keep the drives active either.

I appreciate any help.   :Smile: 

----------

## ColinAnderson

Anyone have any ideas?  I'm becoming desparate!

----------

## El_Goretto

I tried this 2 days ago on my seagate 120go, but  it seems to have done very bad job: during the night, the HD tried to go on sleep state, but immediatly woke up, nearly 2 times per seconde... ouch. And before this, it was making strange noises.

Hum, i had to power off the computer immediatly to avoid further damage, the PC didn't respond either to mouse nor keyboard.... I WONT do this again.  :Sad: 

excuse my english  :Smile: 

----------

## ColinAnderson

I haven't had any problems like that!  Sorry to hear that, however.  I read somewhere the Seagate hard drives also had some sort of hardware-level power-management -- but I don't know how to use that either.

----------

## jsosic

Did you try to disable the Seagate auto-powersaving mode? That's the -Z option. Maybe it's interfering with standby timeout?

try:

# hdparm -ZS time

Also, if you spin off your hard disk with -y option, does it stay turned off or it spins up emediately?

----------

## ColinAnderson

Welll.  When I try to invoke the -Z option, I get the following:

```
colin # hdparm -Z /dev/hdc /dev/hdd /dev/hde

/dev/hdc:

 disabling Seagate auto powersaving mode

 HDIO_DRIVE_CMD(seagatepwrsave) failed: Input/output error

/dev/hdd:

 disabling Seagate auto powersaving mode

 HDIO_DRIVE_CMD(seagatepwrsave) failed: Input/output error

/dev/hde:

 disabling Seagate auto powersaving mode

 HDIO_DRIVE_CMD(seagatepwrsave) failed: Input/output error
```

So how do I fix this?  Maybe if the Seagate auto-powering modes did work I wouldn't have to worry about the standby timeouts.   :Question: 

----------

## jsosic

Well, I never had Seagate HDD so I have no idea...

Why can't you just turn off hard disk with -y option? Maybe to try emerging new version of hdparm?

I think that ext2 or ext3 (maybe both?) parition(s) always write something down on the disk, maybe that's the problem? So you're disk isn't idle at all... I heard this one and I don't know if it's true...

If I were you, I would boot my system off the Gentoo Live cd, and set the sleep option for HDD in 1 minute, and than wait. If the disk turns off, it's not the hdparm or your hard drive's problem. Will you try that?

----------

## ColinAnderson

That's probably a smart thing to do, if not for anything else, to try and help narrow down the number of culprits.  By the way, I'm using the Reiser file system (not version 4 ... yet).   :Wink: 

As to your question, I do turn them off with the -y option -- but what I'm saying is I have to do that manually every time I'm done using the drives -- and that becomes tiresome very quickly.

I'm also thinking about writing a cron script to check for active Samba logons and count time up to 20 minutes or so and then standby the drives.  Kind of a roundabout solution -- but it sounds pretty easy.

----------

