LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 06-10-2009, 06:12 AM   #1
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Rep: Reputation: 67
Harddrive clicks


I know this topic has been covered a bit here already (http://www.linuxquestions.org/questi...laptop-698103/), but I'd like to know what solutions to the problem people have found since it first arose several months ago.

My HD is experiencing the 'clicking' resulting from the spin-down bug connected to powermanagement. I'm already up to nearly 40,000 on the Load_Cycle_Count. It could be worse, but it has only been about four months since I bought the laptop (new). I don't actually recall hearing the clicks with 12.1 which I installed for the first couple of months. Is it possible there's something in 12.2 which has caused the bug to surface?

Issuing hdparm -B 254 /dev/sda works for me, but this needs to be reissued on each reboot and after every pm-suspend (which I have tied to my button event in acpi). But hdparm needs to be run by root so short of permitting it through sudo I can't insert it into a hook in /etc/acpi/acpi_handler.sh.

In any case, I'd like to know if someone has come up with something better than hdparm -B 254 /dev/sda, since this causes the disk to spin permanently, thereby eating up power that might be saved. I could use Ilgar's script (see the link above) which runs smartctl or sync every few seconds to stop the spindowns but again that limits power management.

Here's my HD info:
Code:
ATA device, with non-removable media
        Model Number:       WDC WD1600BEVT-88ZCT0
        Serial Number:      WD-WXEX08UJA900
        Firmware Revision:  11.01A11
        Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5
Thanks for any tips. B.

Last edited by brixtoncalling; 06-10-2009 at 06:13 AM.
 
Old 06-10-2009, 01:49 PM   #2
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Rep: Reputation: 16
This is something I'm also interested in.
 
Old 06-10-2009, 03:12 PM   #3
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by brixtoncalling View Post
Issuing hdparm -B 254 /dev/sda works for me, but this needs to be reissued on each reboot and after every pm-suspend (which I have tied to my button event in acpi). But hdparm needs to be run by root so short of permitting it through sudo I can't insert it into a hook in /etc/acpi/acpi_handler.sh.
Let me take back the statement that sudo would be needed to run hdparm -B 254 /dev/sda inside /etc/acpi/acpi_handler.sh. You don't; commands will be run as root. My script is:

Code:
case "$1" in
  button)
    case "$2" in
      power) /usr/sbin/pm-suspend
             /usr/sbin/hdparm -B 254 /dev/sda
         ;;
#       lid) /usr/sbin/pm-suspend
#        ;;
          *) logger "ACPI action $2 is not defined"
         ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac
And this seems to work. On resume, my count doesn't increase. There are no clicks. All is well... when I run hdparm -I /dev/sda, it returns the result:
Code:
        Advanced power management level: 254
        Recommended acoustic management value: 128, current value: 254
Another related question is that my harddrive seems to be running hot: 51C at the moment and I've observed 58C. I'm new to keeping an eye on these kinds of things so maybe it has always been like this. But could setting things to 254 be causing overheating as well?

Last edited by brixtoncalling; 06-10-2009 at 04:06 PM. Reason: fixed output of hdparm
 
Old 06-10-2009, 03:38 PM   #4
garyg007
Member
 
Registered: Aug 2008
Location: north-east ohio
Distribution: Debian-squeeze/stable;
Posts: 279
Blog Entries: 1

Rep: Reputation: 31
This may or may not be related to the "click of death"; but you might want to do a google search
for "click of death" (without the quotes) --- you'll find some interesting reading,
and it just might be related.

Gary


PS: This might be of interest to some of you
 
Old 06-10-2009, 03:55 PM   #5
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Rep: Reputation: 64
Quote:
My HD is experiencing the 'clicking' resulting from the spin-down bug connected to powermanagement. I'm already up to nearly 40,000 on the Load_Cycle_Count. It could be worse, but it has only been about four months since I bought the laptop (new).
This is what I've got on my eee pc 1000H, which clicks a couple of times a minute:

Code:
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       229407
I think I should be worried?
 
Old 06-10-2009, 04:12 PM   #6
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by mcnalu View Post
This is what I've got on my eee pc 1000H, which clicks a couple of times a minute:

Code:
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       229407
I think I should be worried?
Very worried. I'm just happy I caught mine while it was still only at ~40,000 cycles.
 
Old 06-11-2009, 02:16 PM   #7
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Sorry, but this solution does not work for me. So 'hdparm -B 255 /dev/hda' does not work.

The only solution that works is listed here:

http://www.linuxquestions.org/questi...ml#post3413908

What I did is put that in a script called 'cycle' and then I call that on boot, so if for any reason I don't want it to stop the cycling, I just 'killall cycle'.

Last edited by H_TeXMeX_H; 06-14-2009 at 12:01 PM.
 
Old 06-11-2009, 04:37 PM   #8
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
Did you try hdparm -B 255 /dev/hda?
 
Old 06-11-2009, 05:03 PM   #9
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 398

Rep: Reputation: 64
Well hdparm -B 254 /dev/sda worked a charm for me - but now I've got a hd in its old age

Code:
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231024
Thu Jun 11 19:47:59 BST 2009
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231026
Thu Jun 11 19:48:55 BST 2009
# hdparm -B 254 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0xfe (254)
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
Thu Jun 11 19:49:32 BST 2009
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
Thu Jun 11 19:51:37 BST 2009
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
Thu Jun 11 19:52:30 BST 2009
# smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
#smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
Thu Jun 11 20:05:16 BST 2009
# !sm
smartctl -a /dev/sda | grep Load_Cycle_Count && date
193 Load_Cycle_Count        0x0022   001   001   000    Old_age   Always       -       231027
Thu Jun 11 22:01:55 BST 2009
 
Old 06-11-2009, 05:17 PM   #10
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 930

Rep: Reputation: 96
I think those Old_age indicators are not so important but you're at the threshold value, that's what counts (so yes, you're in trouble, just like I am ). As for the hdparm solution, it's known that it doesn't work for all HDDs.

Edit: Also, I've realized that calling sync is not as effective as calling smartctl. In that other thread I've mentioned these two options but calling smartctl seems to be the only guaranteed way.

When my disk parks its head after a long time (like when I suspend or kill this script) it makes a high pitch beep-like sound, like the beeps of those old digital watches. That might be another indication of the coming death .

Last edited by Ilgar; 06-11-2009 at 05:27 PM.
 
Old 06-13-2009, 01:38 AM   #11
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Original Poster
Rep: Reputation: 67
I've played around with adding the -S option to hdparm, but with mixed success.
hdparm -B 127 -S 20 /dev/sda, for example, causes the drive to spindown after about 5 seconds of inactivity, whereas it should be waiting a minute. In fact, it doesn't matter what time value I pass. The drive always spins down after 5 seconds. I also tried different values for -B but no combination of the two does what I would like.

Ultimately, I placed a hdparm -B 254 /dev/sda in rc.local and adjusted my /etc/acpi/acpi_handler.sh as above to ensure that I avoid this problem. But for power saving, I would have liked to have my disk spin down after some period of inactivity when I'm on battery but I haven't found a way of doing it.
 
Old 06-13-2009, 10:50 PM   #12
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 30
Quote:
Originally Posted by brixtoncalling View Post
Issuing hdparm -B 254 /dev/sda works for me, but this needs to be reissued on each reboot and after every pm-suspend (which I have tied to my button event in acpi). But hdparm needs to be run by root so short of permitting it through sudo I can't insert it into a hook in /etc/acpi/acpi_handler.sh.
I understand that if you're using pm-suspend to do suspension/hibernation, then you should use /etc/pm/sleep.d to setup any scripts to run on suspension or resuming. This way it will work no matter how you call pm-suspend.

I have this one (in /etc/pm/sleep.d/90-hdparm):
Code:
#!/bin/sh

# pm-utils hook to handle suspend/resume properly for hdparm

. "${PM_FUNCTIONS}" || . "${FUNCTIONS}"

do_hdparm()
{
	# Fix aggressive power saving.
    /sbin/hdparm -B 240 /dev/sda
}


case "$1" in
	hibernate|suspend)
        exit 0
		;;
	thaw|resume)
        do_hdparm
		exit $?
		;;
	*) exit $NA
		;;
esac
 
Old 06-14-2009, 10:24 AM   #13
BrZ
Member
 
Registered: Apr 2009
Distribution: Slackware
Posts: 505

Rep: Reputation: 84
Quote:
Originally Posted by brixtoncalling View Post
I placed a hdparm -B 254 /dev/sda in rc.local and adjusted my /etc/acpi/acpi_handler.sh as above to ensure that I avoid this problem. But for power saving, I would have liked to have my disk spin down after some period of inactivity when I'm on battery but I haven't found a way of doing it.
My disk have this 'feature' and use same setup on notebook, with the acoustic on max. But this not prevent the numbers increasing, just slow the process...

The disc spinning down to save energy is annoying to me, so I just keep running and sacrifice some time on battery. Wireless drains a lot of power on my hardware and I get used to manually turn the chip off.
 
Old 06-14-2009, 10:31 AM   #14
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by BrZ View Post
My disk have this 'feature' and use same setup on notebook, with the acoustic on max. But this not prevent the numbers increasing, just slow the process...
The same things happens for me, it doesn't matter what parameters I use for hdparm, either 254 or 255, it either doesn't do anything or slows down the cycling some ... obviously not good enough. The only working solution was posted in a different thread, as I indicated earlier. That solution actually works, there absolutely no cycling as long as that script is running, it's basically just a wake-up script that prevents the drive from sleeping. I guess maybe to optimize it one can use hdparm to slow the cycling, and then the script can use a longer sleep time between waking the drive.
 
Old 06-14-2009, 11:42 AM   #15
BrZ
Member
 
Registered: Apr 2009
Distribution: Slackware
Posts: 505

Rep: Reputation: 84
Quote:
Originally Posted by H_TeXMeX_H View Post
... there absolutely no cycling as long as that script is running, it's basically just a wake-up script that prevents the drive from sleeping. I guess maybe to optimize it one can use hdparm to slow the cycling, and then the script can use a longer sleep time between waking the drive.
Thanks, found it:

Code:
#!/bin/bash

while [ 1 ]
do
smartctl -d ata -a /dev/sda | grep Load_Cycle_Count
sleep 3
done
 
  


Reply

Tags
acpi, hdparm, slackware, smartctl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto clicks Raakh Linux - Newbie 9 10-12-2008 03:03 AM
Fedora Core 6 won't recognize second internal harddrive or usb harddrive Rockgod1969 Linux - Hardware 14 01-26-2007 02:03 AM
random mouse clicks SuSE 9.3 MichaelLange Linux - Hardware 3 03-09-2006 06:10 PM
Installing linux on 2nd harddrive(dual boot) windows on seperate harddrive lysol Linux - Software 25 08-03-2004 10:33 AM
Need to replace full harddrive with new, larger harddrive pearlr Linux - Newbie 1 01-02-2004 01:59 PM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration