# My harddrive clicks on shutdown

## widremann

Basically, when I shut down Gentoo, right as everything turns off, the hard drive makes a loud twangy click.  It's almost as if it isn't being spun-down before the entire machine is shut down.  This doesn't happen under Windows, nor does it happen under Ubuntu or Knoppix.  Only Gentoo.  Every kernel I use does this, so it must be some setting somewhere.  I just don't know where.  My fear is that this will damage the harddrive, so I want to get it fixed.

I have a T43 and here is my kernel .config: http://www.unc.edu/~feiner/kernel-config.txt

----------

## widremann

bump

----------

## yabbadabbadont

It just sounds like it is parking the heads.  Don't know why the other OS's don't.

----------

## Yui

I would compare the different hdparm configs between ubuntu and gentoo.

 *Quote:*   

> hdparm /dev/hda
> 
> hdparm -i /dev/hda

 

Maybe it's that   :Rolling Eyes: 

----------

## widremann

 *Yui wrote:*   

> I would compare the different hdparm configs between ubuntu and gentoo.
> 
>  *Quote:*   hdparm /dev/hda
> 
> hdparm -i /dev/hda 
> ...

 

I have a SATA drive, so hdparm -i /dev/sda gives me some IOCTL error (as is usual for SATA).

In any case, the head parking should NOT be this loud.  It's a pretty loud twang.

----------

## widremann

I redirected the output of sdparm /dev/sda and sdparm -i /dev/sda to a file in both Gentoo and Ubuntu (shown below).  There is a significant difference in the output of sdparm -i between Ubuntu and Gentoo, but I have no idea how to go about fixing that:

Gentoo:

```
/dev/sda: ATA       HTS541080G9AT00   MB4I

Read write error recovery mode page:

  AWRE        1

  ARRE        1

  PER         0

Caching (SBC) mode page:

  WCE         1

  RCD         0

Control mode page:

  SWP         0

    /dev/sda: ATA       HTS541080G9AT00   MB4I

Device identification VPD page:

  Addressed logical unit:

    id_type: vendor specific [0x0],  code_set: ASCII

 00     20 20 20 20 20 20 4d 50  42 34 4c 41 58 36 4a 37          MPB4LAX6J7

 10     47 52 47 4d                                         GRGM            

    id_type: T10 vendor identification,  code_set: ASCII

      vendor id: ATA     

      vendor specific: HTS541080G9AT00                               MPB4LAX6J7GRGM
```

Ubuntu: 

```
    /dev/sda: ATA       HTS541080G9AT00   MB4I

Read write error recovery mode page:

  AWRE        1

  ARRE        1

  PER         0

Caching (SBC) mode page:

  WCE         1

  RCD         0

Control mode page:

  SWP         0

    /dev/sda: ATA       HTS541080G9AT00   MB4I

Device identification VPD page:

  Addressed logical unit:

    id_type: vendor specific [0x0],  code_set: ASCII

 00     4c 69 6e 75 78 20 41 54  41 2d 53 43 53 49 20 73    Linux ATA-SCSI s

 10     69 6d 75 6c 61 74 6f 72                             imulator
```

----------

## yabbadabbadont

Perhaps different kernel modules (or driver if it is built in on gentoo) are being used?

----------

## Yui

Well, I just realised that my hd make a lot of noise too when it shutdown. Maybe it's because the shutdown end too quickly after unmounting the drives. But well, I don't known were I can put a sleep for testing if it's that  :Smile: 

----------

## Mickael

Hi,

 *yabbadabbadont wrote:*   

> It just sounds like it is parking the heads.  Don't know why the other OS's don't.

 

it is.

i 've got this problem too. The first solution was described by widan in which we learn how to modify the acpi_power_off() function. So, go here :

```
 vi /usr/src/linux/drivers/acpi/sleep/poweroff.c
```

 and modify th script like this :

 *Quote:*   

> 
> 
> .....
> 
> ....
> ...

 

but for me it doesn't work. So I've changed some option inside /etc/init.d/shutdown.sh :

```
#Version originale

#opts="-hdp"

#[[ ${RC_DOWN_INTERFACE} == "yes" ]] && opts="${opts}i"

#Version teste

opts="-h"

[[ ${RC_DOWN_INTERFACE} == "yes" ]] && opts="${opts}i"

```

This solution seems to be worked, but i don't have a poweroff. To conclude i think my problem come from to the poweroff function when she is called with the halt function. The poweroff argument come too early, she doesn't wait the end of the halt function. My English is very ugly so excuse me and i hope you'll understand.

EDIT : if somebody is able to transpose the function "wait a bit" to the function poweroff when i do a shutdown   :Wink: 

----------

## EricHsu

Hi all, 

I just got my dell D820 for several weeks, with some efforts, almost everything works but the SATA disk:

Whenever I "# shutdown -h now" or "# hibernate" to turn off the power, at the end of the power off process, I hear a pretty loud ticking noise from the harddisk. But with windows shutdown, there's no such noise.

I've been searching the internet and forums trying to figure out what's wrong with the kernel's sata support:

 http://www.linuxforums.org/forum/linux-laptops/32791-hard-disk-cries-when-shutting-down-my-laptop.html

 https://launchpad.net/bugs/67810

 http://bugzilla.kernel.org/show_bug.cgi?id=7674

It seems like a kernel bug that the kernel doesn't park the disk's head properly before power off?

Here is my lspci -vv of the SATA part (I've loaded the ata_piix module properly):

```

00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 01) (prog-if 80 [Master])

        Subsystem: Dell Unknown device 01cc

        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- 

        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-

        Latency: 0 

        Interrupt: pin B routed to IRQ 17

        Region 0: I/O ports at <ignored>

        Region 1: I/O ports at <ignored>

        Region 2: I/O ports at <ignored>

        Region 3: I/O ports at <ignored>

        Region 4: I/O ports at bfa0 [size=16]

        Capabilities: [70] Power Management version 2

                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold-)

                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

```

and the harddisk model from dmesg:

```

$ dmesg | grep TOSHIBA

scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA MK8034GS AH30 PQ: 0 ANSI: 5

```

I would like to know for sure:

 is this really a kernel bug or is it because I missed something in my kernel config? (seems that not much people have such problem here in this forum...)

 I have windows dual boot, there's no such "bad hard" parking noise - is it just because linux handle's the head parking differently? and the most important thing is - is this parking behavior harmful to my disk?

TIA!

----------

## thuk

Hi There,

I have a D820 as well.  I hear a 'tick' noise as well when I shut down, but I don't run Windows, so can't verify whether this happens in that OS as well.  Are you sure it is the hard drive?  I can't tell where the noise comes from;  you must have good hearing to pinpoint it  :Wink:  It could be a 'click', or a 'clock', maybe not a 'tick'.  My desktop also makes a similar noise when it shuts down and always has, no matter what OS I use. I always assumed it was the power supply.  I've had the desktop for a long long time and the D820 for about 5 months now, and have had no troubles with hard disks in either.  Maybe we shouldn't worry too much - it's probably something mundane and harmless.  There are lots of D820 configs on http://www.linux-laptop.net/, have you compared your config to those?  As far as I remember, none of the articles on D820s linked from there mentioned this problem. 

Cheers,

thuk

----------

## beatryder

I have a D620, and I also hear that noise. I think its just fine. What you are hearing is the head parking itself.

When power is removed from the coil that is used to move the head, it "Snaps" back into a safe position, usually the center of the plater.

Unless a drive fitness test fails on it, or you get SATA errors or it slows down a great deal, I would not be overly concerned concerned.

----------

## thuk

Good to know beatryder, thanks for the info.

Cheers,

thuk

----------

## EricHsu

Hi thuk & beatryder,

thank a lot for you guys' replies  :Smile: 

OK, what makes me concern so much is that the "tick" or "click" noise is so clear (kinda high pitch... like what we'd hear from the PC disk when the power suddenly cuts off and the PC stops running), not as the normal/low disk data reading/seeking noise.

As beatryder said, it could be the disk head "Snaps" back to the safe position, however, why doesn't Windoze make such noise when it shuts down my computer? Maybe it spins down(?) the disk and park the disk head "gently" but linux just cuts the power and let the disk park the head itself?

As a temporarily solution, each time I have to reboot to grub, then press the power button the shutdown the laptop, by doing this, there's no such clicking noise, that makes me suspect that the linux kernel cut off the power too early before the disk properly parks the head, then the clicking noise is the "emergent parking" of the disk...

Could anyone knows more about the harddisk and the shutdown process explain more to me? Thanks a lot!

----------

## everolth

Hi,

Ever since I installed Gentoo on my new laptop when I shut down my computer I can hear a very ugly noise (like a squeak) coming, presumably from my hard disk. I have found this: https://launchpad.net/ubuntu/+source/linux-source-2.6.17/+bug/67810

These people using ubuntu seem to be going through the same thing.

This only happens to me when shutting down, but not when rebooting, so what I am currently doing is rebooting the computer, booting windows xp and shutting down the computer with windows...

My computer is a dell inspiron 9400, with a core 2 at 2ghz and a 160GB 5400 RPM SATA Hard Drive. I have had this problem with the gentoo-sources 2.6.19 kernels and with the new 2.16.20 also.

Is this actually a kernel bug or am I missing something? Does anyone else have the same problem?

Thanks in advance

----------

## desultory

Merged topics "Dell D820 SATA disk shutdown ticking noise" and "Hard disk noise when shutting down".

----------

## beatryder

 *EricHsu wrote:*   

> Hi thuk & beatryder,
> 
> thank a lot for you guys' replies 
> 
> OK, what makes me concern so much is that the "tick" or "click" noise is so clear (kinda high pitch... like what we'd hear from the PC disk when the power suddenly cuts off and the PC stops running), not as the normal/low disk data reading/seeking noise.
> ...

 

That noise is the exact noise I hear when turning mine off. If you are really worried, run a fitness test on it.

----------

## everolth

Hi,

Apparently this has been finally fixed. Look at http://bugzilla.kernel.org/show_bug.cgi?id=7674 at the end.

What I don't know is when we will get a kernel with all of these patches. Hope it is soon. It is so annoying to press the power button by mistake and have the computer shutting down with the noise or having to restart each time I want to turn off the computer.

Carlos

----------

## MartyMcFly

I was getting used to my hard disk making a strong "tack" noise when shutting down Gentoo (like when you force a turn off by pressing and holding the power button). I wasn't worried about it, until I read this:

http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg158222.html

And then, this:

http://linux-ata.org/shutdown.html

Now I'm a little bit worried about damaging the HD  :Sad: 

Is there some kind of fix in Gentoo, before the 2.6.22 kernel is in stable state?

Thanks.

----------

## warrawarra

The links you supplied list a few temporary fixes that you can try.

Look for that folder or file they say holds the key and make it 0 as they say in the link.

Or like the link states upgrade the kernel to past 2.6.22 hopefully the -rc8 or above as lower have a  few bugs still at the last time I checked.

It would damage you hd over time but as cheap as they are now it might be worth it to get a new one when yours start to get a bit buggy.

Newegg.com

If you want to check the drive :

http://www.ultimatebootcd.com/

Download and use the hd tools in there to test it .

I would also recommend to check your power supply and make sure you have enough power for the HD as lack of power or AC dipping or spiking can also damage the drive.

Should use about 10W or close to 1 Amp maybe a bit more.

http://www.tomshardware.com/2007/05/15/the_spring_hard_drive_guide/

Hope this helps.

----------

## MartyMcFly

Thanks for your answer!

I've checked out and "manage_start_stop" (under /sys/class/scsi_disk/h:c:i:l/) does not exist... and I don't know what to do next... I'm no shutdown( :Cool:  maintainer  :Razz:  What should I do with this?

Buying a new disk is not an option for me (at least not for now). Unfortunately, here in Argentina disks are not that cheap  :Sad:  But I think that my disks are still OK, (and I intend to keep them that way!) My power supply is delivering enough power, so that won't be a problem.

----------

## warrawarra

Okay I am using 2.6.22-rc2 from sabayonlinux 3.4loop2b ,  version 3.4 final not out yet.

Lets compare files / notes might find a fix for this.

I have no locking sound but I am using sata hd's.

/sys/modules/libata/parameters/spindown_compat/

have a few files here:

File  = what is inside

noacpi = 1 

atapi_dmadir = 0

atapi_enabled = 1

ata_probe_timeout = 30000

fua = 0

/sys/class/scsi_disk has different folder in it. 2:0:0:0 ?

/sys/class/scsi_disk/2:0:0:0/

Inside this folder :

File name = option inside file

fua = 0

allow_restart = 0

cache_type = write b

stop_on_shutdown = 1

uevent 

uevent = locked file ?

next option

/sys/block/sdX/device/scsi_disk:*/manage_start_stop

mine is linking back to /sys/class/scsi_disk/2:0:0:0/ folder

Not sure but try to check yours against this and try some of them and see what they do.

I have both sata hd and dvdrw and no problems but on 2.6.22-rc2.

Might be a silly setting in one of the files that fixes it.

The uevent file that is locked no idea what it is about or what it is for.

Hope this helps. If all else fails get a copy of sabayonlinux.org , 3.4 final will be out by about 15 june and try it and or copy the files over from the live dvd to your install like the ones above and continue with your current gentoo install. This might fix it.

Hope this helps.

----------

## desultory

Merged the above four posts.

----------

## MartyMcFly

Hmmm, I don't even have many of those files you mention. I guess this is just a kernel problem, because I'm using 2.6.19-gentoo-r5 and you are using 2.6.22-rc2... and you don't have this problem (as the documentation says, kernel 2.6.22 fixes this). I'll just wait until 2.6.22 enters Portage and compile it. An interesting fact is that there are people running Ubuntu that don't have this problem, and their kernels are < 2.6.22.

Thanks desultory  :Smile: 

----------

## loki_val

As y'all can read at https://bugs.gentoo.org/show_bug.cgi?id=174373,

this problem was supposedly fixed in gentoo-sources-2.6.21-r2.

----------

## MartyMcFly

That's really nice!!! I will try it as soon as possible. Thanks.

----------

## MartyMcFly

It's working just fine now, my disks rest down on shutdown  :Smile: 

Thanks!

----------

## MartyMcFly

Hello again. Today I had to login into Windows, and when I turned off the PC I noticed that the HD off-noise is still really quieter when in Windows  :Sad:  I'm not sure whether this is solved or not. Anyone with the same problem out there?

----------

