Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't Stop HDD from spinning down!!!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
gentoouser_54
n00b
n00b


Joined: 26 May 2011
Posts: 4

PostPosted: Thu May 26, 2011 5:35 pm    Post subject: Can't Stop HDD from spinning down!!! Reply with quote

Hey, I've had a new install of Gentoo running for a month now on my Asus EEEpc 1015pem, and I'm having a problem with my HDD spinning down constantly.

When on battery power, if the computer is left idle for a very short amount of time ~30seconds (maybe even less), and then the HDD is used, I can hear a high-pitch "winding-up" sound, that sounds like an electric motor starting up.

This concerns me, b/c I do not want my HDD spinning down at all and also b/c I dont not have HDD spindown enabled in gnome-power-manager OR with hdparm. I do have laptop-mode-tools emerged, but I havn't done anything with it and AFAIK it shouldn't be spinning down my disk.


Does anyone know what could be spinning down my HDD so frequently? Or perhaps I'm just tripping out and the HDD's in these EEEpc's just make weird noises that I'm not used to?

Anyone got some insight? Thanks in advance!
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2150

PostPosted: Thu May 26, 2011 6:55 pm    Post subject: Reply with quote

What kind of disk is built-in (`hdparm -iI`)? Maybe it's one of those 'green' drives with spindown programmed in the firmware.
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
gentoouser_54
n00b
n00b


Joined: 26 May 2011
Posts: 4

PostPosted: Thu May 26, 2011 8:26 pm    Post subject: Reply with quote

Here's the output that command... It's all greek to me.

Code:
billyjoe@netbooky /usr/portage/xfce-base/thunar $ sudo hdparm -iI /dev/sda

/dev/sda:

 Model=ST9250315AS, FwRev=0003SDM1, SerialNo=6VCLRL1L
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=488397168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=yes: unknown setting WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-4,5,6,7

 * signifies the current active mode


ATA device, with non-removable media
   Model Number:       ST9250315AS                             
   Serial Number:      6VCLRL1L
   Firmware Revision:  0003SDM1
   Transport:          Serial
Standards:
   Used: unknown (minor revision code 0x0029)
   Supported: 8 7 6 5
   Likely used: 8
Configuration:
   Logical      max   current
   cylinders   16383   16383
   heads      16   16
   sectors/track   63   63
   --
   CHS current addressable sectors:   16514064
   LBA    user addressable sectors:  268435455
   LBA48  user addressable sectors:  488397168
   Logical/Physical Sector size:           512 bytes
   device size with M = 1024*1024:      238475 MBytes
   device size with M = 1000*1000:      250059 MBytes (250 GB)
   cache/buffer size  = 8192 KBytes
   Nominal Media Rotation Rate: 5400
Capabilities:
   LBA, IORDY(can be disabled)
   Queue depth: 32
   Standby timer values: spec'd by Standard, no device specific minimum
   R/W multiple sector transfer: Max = 16   Current = 16
   Advanced power management level: 254
   Recommended acoustic management value: 254, current value: 0
   DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
        Cycle time: min=120ns recommended=120ns
   PIO: pio0 pio1 pio2 pio3 pio4
        Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
   Enabled   Supported:
      *   SMART feature set
          Security Mode feature set
      *   Power Management feature set
      *   Write cache
      *   Look-ahead
      *   Host Protected Area feature set
      *   WRITE_BUFFER command
      *   READ_BUFFER command
      *   DOWNLOAD_MICROCODE
      *   Advanced Power Management feature set
          SET_MAX security extension
      *   48-bit Address feature set
      *   Device Configuration Overlay feature set
      *   Mandatory FLUSH_CACHE
      *   FLUSH_CACHE_EXT
      *   SMART error logging
      *   SMART self-test
      *   General Purpose Logging feature set
      *   64-bit World wide name
      *   IDLE_IMMEDIATE with UNLOAD
          Write-Read-Verify feature set
      *   WRITE_UNCORRECTABLE_EXT command
      *   {READ,WRITE}_DMA_EXT_GPL commands
      *   Segmented DOWNLOAD_MICROCODE
      *   Gen1 signaling speed (1.5Gb/s)
      *   Gen2 signaling speed (3.0Gb/s)
      *   Native Command Queueing (NCQ)
      *   Phy event counters
          Device-initiated interface power management
      *   Software settings preservation
      *   SMART Command Transport (SCT) feature set
      *   SCT Long Sector Access (AC1)
      *   SCT Error Recovery Control (AC3)
      *   SCT Features Control (AC4)
      *   SCT Data Tables (AC5)
          unknown 206[12] (vendor specific)
Security:
   Master password revision code = 65534
      supported
   not   enabled
   not   locked
      frozen
   not   expired: security count
      supported: enhanced erase
   66min for SECURITY ERASE UNIT. 66min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000c5002babb8d9
   NAA      : 5
   IEEE OUI   : 000c50
   Unique ID   : 02babb8d9
Checksum: correct
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2150

PostPosted: Thu May 26, 2011 9:00 pm    Post subject: Reply with quote

According to Google, ST9250315AS is equal to Seagate Momentus 5400.6, which - also according to Google - is known to have (had) firmware problems (under linux) resulting in a lot spin-up/-downs, which can damage the disk quickly.

IMHO:
a) make a backup of important data
b) hunt down Google/Seagate for a firmware newer as yours (newer than 0003SDM1)
c) use smartmontools to check if damage already happened
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
gentoouser_54
n00b
n00b


Joined: 26 May 2011
Posts: 4

PostPosted: Fri May 27, 2011 12:23 am    Post subject: Reply with quote

Yikes that doesn't sound good!

Well.. I dont have "important data" so Im not too worried about that, and presently my HDD's in good condition.. but where/how do I download firmware for a hardrive? I dont think its in the portage tree.
I checked on Seagates website too but when I input my serial number I just got the message "No download available for this serial number. No action required".
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2150

PostPosted: Fri May 27, 2011 2:16 am    Post subject: Reply with quote

When I search the web for your firmware revision, I get a lot of ASUS parts sites at the top and some linux forums, which makes me believe, that this is a firmware by or designed for ASUS.

According to this website - which I don't know and just found via Google (so don't know if it can be trusted) - at least 7 different firmwares exist, or 7 different names for that matter.

For the same reason, unneeded spin-cycles, I lost 2 different 3.5" drives, WesternDigital (EADS and EARS series), because I didn't know a firmware with linux fixes existed. So in your case, I would compose an email describing the problem clearly and adding all info you can get and send them to both Seagate and ASUS.

As far as firmware-updating would go, usually the manufacturers give you some tool, which can be burned to cd or put an an usbdrive, which then gets booted and the firmware installed from there.

I'm sorry, but since there isn't much more info on the web (I could find), I can't help you much more with this :(
_________________
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Back to top
View user's profile Send private message
tbart
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2004
Posts: 142
Location: Baden // Austria

PostPosted: Wed Dec 07, 2011 10:26 am    Post subject: Reply with quote

just for the record:

Up until just now, i've had the exact same problems with both a Hitachi FDE and a WD Scorpio HD in a Thinkpad T61p.
Turns out I had to disable "Advanced Power Management":

Code:
blackknight ~ # hdparm -B 255 /dev/sda

/dev/sda:
 setting Advanced Power Management level to disabled
 APM_level   = off


The standby time (-S <number>) simply did not do anything.

I'll put this in my
Code:
/etc/conf.d/hdparm
and
Code:
rc-update add hdparm boot
and I guess the fix will be permanent.
What exactly makes this option get set is unintelligible to me, as it only happens after my notebook leaves standby...

EDIT:
Wait, I just found it. It's pm-utils.
Interesting parts in extra paragraphs. Color in code format won't work in this forum.
Code:
cat /usr/lib64/pm-utils/power.d/harddrive
#!/bin/sh

[ -x /sbin/hdparm ] || exit $NA

# Default values on AC
DRIVE_SPINDOWN_VALUE_AC="${DRIVE_SPINDOWN_VALUE_AC:-0}"
DRIVE_WRITE_CACHE_AC="${DRIVE_WRITE_CACHE_AC:-1}"
DRIVE_POWER_MGMT_AC="${DRIVE_POWER_MGMT_AC:-254}"
DRIVE_ACOUSTIC_MGMT_AC="${DRIVE_ACOUSTIC_MGMT_AC:-0}"

# Default values on battery
DRIVE_SPINDOWN_VALUE_BAT="${DRIVE_SPINDOWN_VALUE_BAT:-6}"
DRIVE_WRITE_CACHE_BAT="${DRIVE_WRITE_CACHE_BAT:-0}"

Code:
DRIVE_POWER_MGMT_BAT="${DRIVE_POWER_MGMT_BAT:-1}"
Code:

DRIVE_ACOUSTIC_MGMT_BAT="${DRIVE_ACOUSTIC_MGMT_BAT:-254}"

# Default devices to operate on
DRIVE_LIST="/dev/[hs]d[a-z]"

help() {
cat <<EOF
--------
$0: Control hard drive spindown, write caching,
    power management and acoustic management.

This hook has 8 tuneable parameters:
DRIVE_SPINDOWN_VALUE_AC = time until a drive will spin down on AC
Defaults to 0, which disables drive spindown.
DRIVE_SPINDOWN_VALUE_BAT = time until a drive will spin down on battery
Defaults to 6, which will spin the drive down after 30 seconds of inactivity.

See the -S option on the hdparm manpage for more information.

DRIVE_WRITE_CACHE_AC = Whether the drive caches writes on AC
Defaults to 1, which means that the drive will cache writes internally.
DRIVE_WRITE_CACHE_BAT = Whether the drive caches writes on battery.
Defaults to 0 which means that the drive will not cache writes internally.

See the -W option on the hdparm man page for more information.

DRIVE_POWER_MGMT_AC = Drive Advanced Power Management value on AC
Defaults to 254 for max performance.
DRIVE_POWER_MGMT_BAT = Drive Advanced Power Management value on battery
Defaults to 1 for max power savings.

See the -B option on the hdparm man page

Drive acoustic management:
DRIVE_ACOUSTIC_MGMT_AC = Drive Acoustic Management value on AC
Defaults to 254 for max head speed.
DRIVE_ACOUSTIC_MGMT_BAT = Drive Acoustic Management value on battery
Defaults to 128 for max quietness.

See the -M option on the hdparm man page.

Drives to manage:
DRIVE_LIST = the list of hard drives to manage.
Defaults to "/dev/[hs]d[a-z]", which will manage up to the first 25 drives.

EOF
}

harddrive_ac () {
    for dev in $DRIVE_LIST; do
   # disable write caching, do not spin down the drive, disable APM
   # and acoustic management, and sync everything to drive.
   printf "Disabling hard drive power management for %s..." "$dev"
   hdparm -W $DRIVE_WRITE_CACHE_AC \
       -S $DRIVE_SPINDOWN_VALUE_AC \
       -B $DRIVE_POWER_MGMT_AC \
       -M $DRIVE_ACOUSTIC_MGMT_AC $dev >/dev/null 2>&1 \
       && echo Done. || echo Failed.
    done
}

harddrive_battery() {
    for dev in $DRIVE_LIST; do
   # disable write caching, enable acoustic management
   printf "Enabling power management for %s..." "$dev"
   hdparm -W $DRIVE_WRITE_CACHE_BAT \
       -S $DRIVE_SPINDOWN_VALUE_BAT \
      
Code:
-B $DRIVE_POWER_MGMT_BAT \
Code:

       -M $DRIVE_ACOUSTIC_MGMT_BAT -F $dev >/dev/null 2>&1 \
       && echo Done. || echo Failed.
    done
}

case $1 in
    true) harddrive_battery ;;
    false) harddrive_ac ;;
    help) help;;
    *) exit $NA ;;
esac

exit 0


I think setting this default to 30 seconds spindown is crazy. YMMV.

Therefore, setting the option via /etc/init.d/hdparm won't solve the problem. Either you'll have to put it into
Code:
/etc/pm/sleep.d/50-whateveryoulike

and put something like
Code:
[[ $1 == "resume" ]] || [[ $1 == "thaw" ]] && { hdparm -B 255 /dev/sda; exit; }

into it (or a call to
Code:
/etc/init.d/hdparm restart
) or
(which seems cleaner to me)
fix the original error, but better not do it in /usr but in /etc so it survives updates.
Maybe you can put a copy of
Code:
/usr/lib64/pm-utils/power.d/harddrive
into
Code:
/etc/pm/power.d/harddrive
and set sane values. I don't know, but there must be some way to fix it in /etc.

hth,
th
_________________
Hardrock/Classicrock at its finest: http://rockbrew.com/qr01

FOSS for your mind: http://idler.co.uk/product/how-to-be-free-paperback-signed-edition/
Back to top
View user's profile Send private message
tbart
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2004
Posts: 142
Location: Baden // Austria

PostPosted: Wed Dec 07, 2011 10:59 am    Post subject: Reply with quote

well I think setting the config values to a predefined value will be better:

simply define the values in a file like
Code:
/etc/pm/config.d/harddrive
:

Code:
DRIVE_SPINDOWN_VALUE_BAT=0
DRIVE_WRITE_CACHE_BAT=1
DRIVE_POWER_MGMT_BAT=255
DRIVE_ACOUSTIC_MGMT_BAT=0


just found a forum post regarding this:
https://forums.gentoo.org/viewtopic-t-897692-start-0.html

However, Advanced PM is now always at 128 for me, though I set 255... strange.
_________________
Hardrock/Classicrock at its finest: http://rockbrew.com/qr01

FOSS for your mind: http://idler.co.uk/product/how-to-be-free-paperback-signed-edition/
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3247

PostPosted: Sat Dec 10, 2011 4:50 am    Post subject: Reply with quote

I have a WD drive that also behaves extremely irrationally. It spins down every 5 seconds! I have to run two hdparm commands to keep it from spinning down:
Code:
hdparm -S 241 /dev/sda
hdparm -B 254 /dev/sda
Sometimes I think the hard drive manufacturers deliberately set these settings, so that the drives fail more quickly and you buy more.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using e from git | e18, e19, and kde4 sucks :-/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum