# Hard disk keeps waking up; Trying to find cause

## Cyker

Hi,

I've set all my HD's to (hdparm) -S241, but they never seem to spindown.

When I force a sleep on them with "hdparm -y", they goto sleep, but then spin up a short while later.

(As an aside, I noticed that sometimes, the spinups seem to coincide with then I log out, but only one drive spins up. If I log in and out three times, all the drives spin back up in sequence with each log-out! This doesn't seem to be an 'always' thing, and might just be co-incidence.)

With /dev/hda and /dev/hdd, I do not expect them to stay off for long as hda is boot and root, while hdd is var and tmp (home is stored on an sd? RAID5 array, which would be a lost cause for sleepmode, SATA not supporting such things notwithstanding!  :Wink: )

What gets my proverbial goat, is that /dev/hdc spins up at all.

It's not mounted ANYWHERE, and doesn't have swap space or anything!

All it holds is a single 160GB partition that contains the old /home backup!!

So I'm trying to track down what might spin it up. Here's my rc-update show, just for starters:

```
rc-update show

             apache2 |      default                  

            bootmisc | boot                          

             checkfs | boot                          

           checkroot | boot                          

               clock | boot                          

         consolefont | boot                          

            ddclient |      default                  

          fancontrol |      default                  

             hddtemp |      default                  

              hdparm |      default                  

            hostname | boot                          

             keymaps | boot                          

          lm_sensors |      default                  

               local |      default nonetwork        

          localmount | boot                          

             modules | boot                          

             net.br0 |      default                  

            net.eth0 |      default                  

            net.eth1 |      default                  

              net.lo | boot                          

            netmount |      default                  

           rmnologin | boot                          

               samba |      default                  

              smartd |      default                  

                sshd |      default                  

           syslog-ng |      default                  

             urandom | boot                          

              xinetd |      default
```

My immediate thoughts were lm_sensors, smartd and hddtemp. lm_sensors doesn't seem to touch the disks, and both smartd and hddtemp seem well-behaved and won't prod the disk if it's sleeping (They just report that it is sleeping).

For kicks, I put hdc into full off-line mode (hdparm -Y).

The system seemed to run fine, and both smartctl and hddtemp would report that SMART info was not available.

However, dmesg was filled with stuff like this:

```
hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hdc: dma_intr: error=0x04 { DriveStatusError }

ide: failed opcode was: unknown

hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hdc: dma_intr: error=0x04 { DriveStatusError }

ide: failed opcode was: unknown

hdc: recal_intr: status=0x51 { DriveReady SeekComplete Error }

hdc: recal_intr: error=0x04 { DriveStatusError }

ide: failed opcode was: unknown

hdc: dma_intr: status=0x51 { DriveReady SeekComplete Error }

hdc: dma_intr: error=0x04 { DriveStatusError }

ide: failed opcode was: unknown

hdc: DMA disabled

hdd: DMA disabled

ide1: reset: success

```

The last part is when I told the drive to wake back up (And I had to send "hdparm -d1" both drives to re-enable DMA because the kernel can only wake up an off-line drive resetting the whole IDE bus)

So, clearly something is accessing my un-mounted drive, but what?!

Any other leads/suggestions would be most welcome at this point!!

----------

## bLUEbYTE84

Hey,

In you BIOS, check two things:

- APM should be disabled in BIOS (let Linux manage it)

- Look for 'wakeup timer' or something along the lines. Try disabling them, PCI card activity, port activity etc. might be causing this behavior, possibly in combination with the above.

----------

## Cyker

Hey, thanks!

I got a chance to boot everyone off the server and tried it; So far so good.

If hdc is still sleeping tomorrow I think it'll qualify as a success  :Smile: 

There is one annoying side-effect 'tho - The system won't power off unless I hold down the power button for force it to turn off now!

It won't even do it if I try and turn it off at the GRUB menu...

I have to say, this Asus A8N32-SLi board is not very well made... They've gone after lots of big checkbox features, but squandered on lots of the little details  :Sad: 

It's a pity 939 boards are so hard to get hold of new now... I'd really like to replace it with something that runs cooler and has e.g. working software fan speed controls!

----------

## Cyker

Well, the drive is still sleeping like a baby  :Mr. Green: 

It seems ironic and rather counter intuitive that APM stops powersaving stuff from working, but that's PCs for you  :Wink: 

Thanks again for the hint!

----------

## bLUEbYTE84

 *Cyker wrote:*   

> Well, the drive is still sleeping like a baby 
> 
> It seems ironic and rather counter intuitive that APM stops powersaving stuff from working, but that's PCs for you 
> 
> Thanks again for the hint!

 

No problem, glad it worked  :Smile:  I think you will be able to solve power button issue (if you see it as an issue). But what I know is it is an ACPI thing, not APM.

----------

## drescherjm

I have the same problem. I want to completely shut off hda which is not the boot drive and it is not mounted anywhere and it does not appear in fstab however it keeps spinning back up. I don't want to use a utility to keep putting it back to sleep after this as the drive is a > 4 years old and I am not sure how many more stop start cycles it will take before it dies... I guess its time to check my bios settings for apm and hopefully that will fix this as the drive makes more noise than the other 3 drives in the system combined.

[EDIT]

I had APM turned on in my BIOS. I turned it off put the drive in sleep and it has been there for around 30 minutes so its looking good. Ahh, silence... I can not believe that single drive was causing all that noise.

[/EDIT]

----------

## drescherjm

Nope its back on. I am almost ready to pull the power connector on the drive. I guess I have to check for a wakeup timer in my bios. BTW, the motherboard is a TYAN Thunder K8W.

[EDIT] 

I could not find any wakeup timer in my bios. Also my actual bios does not match my manual for the power management section. I disabled smartd for both ide drives with the hopes of that being the cause of the spinup.

[/EDIT]

----------

## padoor

i have similar problem of hard disk keeps reading/searching or something to that effect evenafter kde loaded fully.

i invoke parted and quit

then the hard disk stops and woorks normally.

i have 2 installations of gentoo in 2 different partitions with different profiles.

both do the same thing with hard disk.

i feel read ahead setting in the kernel has something to do with this problem.

i did not get a reply for my questioon of hdd behaviour of this kind in another thread.

if parted settles the seek /search for something in the hdd what can it be?

after this stops once with parted it works  fine untill next boot up. and continues the same thing again.

----------

## kernelOfTruth

if you don't need it, disable hald or even dbus for the time you're sending your hdd to sleep / your drives are sleeping,

things waking my hdds up were:

- hald (+ gnome-related stuff) / dbus

- installing grub

- parted

- emerging other stuff which needs to look through hdds

hope this helps ...

----------

## drescherjm

Its about 12 hours later and I it looks like disabling smart monitoring has stopped the noisy (but not mounted) hard drive from waking up as it is still on standby.

```

# hdparm -C /dev/hda

/dev/hda:

 drive state is:  standby

```

Thanks guys for your suggestions. I will take a look at them as the other 3 drives are spinning.

 *Quote:*   

> i feel read ahead setting in the kernel has something to do with this problem. 

 

I just checked as I thought that I was setting all drives to have a readahead of 4MB but it was only for sda and sdb.

----------

## bLUEbYTE84

Just an idea: System log daemon is a likely cause, too. I don't use one, personally. KDE system with hal USEFLAG but neither hal or dbus running, I can report that once it goes to sleep, it really does  :Wink: 

----------

