hdparm (9.39-1+b1) spin-up/spin-down bug

  • I installed a hard drive in my NAS today and luckily I had the case open and was able to hear the hard drive spin-up and then spin-down every couple of seconds. This frequency of activity was troubling because it could easily wear out the hard drive in a few months. The bug essentially causes the system to ignore the spin-down time you have entered. I have the spin-down time set to 20 minutes and it was spinning down every couple of seconds even when I was playing a movie from the drive.


    Some searching on the internet led me to discover that this is a known bug:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684241


    The hdparm version installed is 9.39-1+b1 and the bug is fixed in 9.42-1. Currently I work around this by setting the advanced power management to 128 which disables spin-downs.


    Would it break anything if I were to update hdparm to the later version? Could anyone suggest the best way to do this?

  • Thanks for pointing out hd-idle. Couple of questions on how you use it:


    1) Did you disable or otherwise remove hdparm? If not, how do you keep the two from interfering with each other?
    2) How did you setup hd-idle on your system? I've seen examples of people using it as a service and examples of them running it as part of their boot process.
    3) Did you consider just updating hdparm to the latest version so that you can control the parameters from the OMV GUI?


    Thanks!


  • 3) Did you consider just updating hdparm to the latest version so that you can control the parameters from the OMV GUI?


    Can't be done with 9.43-2. I couldn't find 9.42-1, but admit not looking all that hard for it.


    root@omv:~# dpkg -i hdparm_9.43-2_amd64.deb
    (Reading database ... 80617 files and directories currently installed.)
    Preparing to replace hdparm 9.39-1+b1 (using hdparm_9.43-2_amd64.deb) ...
    Unpacking replacement hdparm ...
    dpkg: dependency problems prevent configuration of hdparm:
    hdparm depends on libc6 (>= 2.14); however:
    Version of libc6:amd64 on system is 2.13-38+deb7u8.


    dpkg: error processing hdparm (--install):
    dependency problems - leaving unconfigured
    Processing triggers for man-db ...
    Errors were encountered while processing:
    hdparm

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    1) I have commands executed during reboot of OMV; one for each drive I want to control with hd-idle

    Code
    hdparm -B255 /dev/sdx


    in "physical drive properties" I have disabled everything for these drives
    2) I use it as a service: after installation added to /etc/default/hd-idle these two lines

    Code
    START_HD_IDLE=true
    HD_IDLE_OPTS="-i 0 -a sdb -i 1200 -a sdc -i 1200 -l /var/log/hd-idle.log"


    with this the drives (sdb and sdc) spin down after 1200s
    3) no, I did not consider to update hdparm; I was reading some posts that it does not work properly but at that time did not read anything that it is fixed with a later verision


    hd-idle:
    http://hd-idle.sourceforge.net/

  • I think hd-idle may be the way to go even if I can install the updated hdparm. Looking at the change it doesn't look like they've fixed the problem, only set the drive to 128 which is exactly what I did. More a work-around than a fix.


    https://launchpad.net/ubuntu/+source/hdparm/9.42-1ubuntu1

    Code
    Set spindown policy back to -B128 instead of -B127. Too many drives
        misbehave too badly with this setting, possibly leading to drive failure.
        We should revisit this once we understand why people's drives are spinning
        back *up* so frequently (closes: #684241)


    For anyone interested in my installation notes/cheat-sheet:


    Thanks for all your help!

  • I ran into a question. hd-idle isn't logging anything in the '/var/log/hd-idle.log' file. I even created an empty file to see if it not existing was the issue, but it didn't do anything.


    I checked to see if the service is running with 'service --status-all' and got:
    [ ? ] hd-idle


    But I started it manually '/etc/init.d/hd-idle start' and didn't see anything in the log file either. Running at the command line 'hd-idle -i 0 -a sdc -i 1800 -l /var/log/hd-idle.log' didn't show anything in log.


    I see it running 'ps ax | grep hd-idle', so I know it is running, but it never outputs to the log file.

  • So a log entry showed up finally. Just one so far and randomly out of the blue. The machine has been on all day and the entry is:


    date: 2015-12-25, time: 17:44:37, disk: sdc, running: 5040, stopped: 540


    So I guess it just isn't a very active log.

    • Offizieller Beitrag

    Concerning the log file: you get one entry per ON/OFF-cycle; it tells you how many seconds the drive was running and how many seconds it was stopped; if the status does not change from running to stopped and vice versa you do not get any entry


    Here are two entries from my log file

    Code
    date: 2015-09-29, time: 02:51:25, disk: sdc, running: 2043, stopped: 84362
    date: 2015-09-29, time: 02:51:32, disk: sdb, running: 2041, stopped: 84369
    date: 2015-09-30, time: 03:03:35, disk: sdc, running: 2049, stopped: 85081
    date: 2015-09-30, time: 03:03:37, disk: sdb, running: 2042, stopped: 85083


    I have two drives sdb and sdc. Usually they run for about 2050s (1/2h) and then they stop for 85080s (23.5h; rest of the day). At least if there is no other activity than the daily routine.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!