HDAPM Install Guide - Stop HDD Clicking + Reduce Load Cycle Count (Optibay)

Discussion in 'MacBook Pro' started by happle, Dec 21, 2011.

  1. happle, Dec 21, 2011
    Last edited: Dec 21, 2011

    happle macrumors 6502a

    Joined:
    Jun 20, 2010
    #1
    After doing some research and finally getting HDAPM fully installed and working I decided I'll write up a little guide to help others get it up and running. I will do the guide step by step so even dummies can do it.

    If you don't know what HDAPM is, its a program developed to edit the APM (power settings) of the drive. OSX has a nasty habit of parking the drives heads every few seconds making either a noticeable or even an unnoticeable click. This also causes the load cycle count of the drive to increase rapidly. Most drives are rated to live at least up to 600,000 load cycle counts. Without HDAPM some drives can easily put on 10,000 load cycles in a week. This is a problem IMO.

    These are the instructions to get HDAPM installed on your ‘optibay’ HDD (MBP users who put a HDD in their optical bay), but if you want to install it on your normal drive just don’t replace disk0 with disk1 on step 5.

    1. Download and install HDAPM - hdapm Download page
    2. Open finder and press apple + shift + g
    3. Type /Library/LaunchDaemons/
    4. Find hdapm.plist and open in with text edit
    5. Find where it says <string>disk0</string> and replace the 0 with a 1
    6. It will ask you if you want to duplicate the file, select yes
    7. On the duplicate make sure it says <string>disk1</string>
    8. Then where it says <string>max</string>, replace that with <string>195</string>. This sets your APM to 195 out of 254 (max) which stops the drive from clicking and racking up load cycle counts, but also allows it to save battery and sleep (max setting sometimes will not let the drive sleep)
    9. Save to desktop as hdapm.plist
    10. Drag and drop the hdapm.plist on your desktop into /Library/LaunchDaemons/
    11. Replace the existing file
    12. Open up terminal and enter this command (this makes it so hdapm loads up every boot): sudo chown root:wheel /Library/LaunchDaemons/hdapm.plist
    13. Reboot your Mac
    14. Open up console in Utilities and search HDAPM, it should list the drive you selected and states “success”

    Now to save some more battery download cocktail and set your HDD to sleep after about 5 minutes. This is a nice happy medium where you will save battery but not drastically increase load cycle counts (sleeping the drive often will cause load cycle counts to rise).
     
  2. Satnam1989 macrumors 65816

    Joined:
    Nov 16, 2011
    Location:
    Illinois
    #2
    hey today my drive switched location and hdapm didn't load so i ran the command manually...."sudo hdapm disk0 195" been working since...but some of you might have to do this command time to time because MBP is unpredictable and switches the location of the optical bay HDD to disk0 from disk1 and places your main bay hdd/ssd to disk 1 from disk 0....
     
  3. happle thread starter macrumors 6502a

    Joined:
    Jun 20, 2010
    #3
    you can avoid this by duplicating the .plist yet again and saving a second .plist with a different name in the /launchdaemons folder. just have one .plist that has disk0 and the second one disk1.

    this will make it so hdapm loads on both disk0 and disk1. i talked to the developer and he said that having hdapm load on an ssd does not have any adverse effects. really it just does nothing, since its not a spinning drive.
     
  4. Merkyworks macrumors 6502

    Joined:
    Oct 14, 2008
    #4
    ok so if I have a HDD in my optibay but instead of using this program I used a terminal command and reduced the "put harddrive to sleep" time from the factory time (10min i think) to 2 min.

    what advantage does this have over the way I currently do thing?
     
  5. jon08 macrumors 68000

    Joined:
    Nov 14, 2008
    #5
    Hi happle,

    nice write-up. I've been using hdapm for a while now (ever since I bought a Scorpio Blue for my old MBP 2 years ago; and now that I bought a new MBP I'm using it for my HDD in the Optibay too).

    About number 12. in your guide: I don't think you need to run that command---hdapm seems to work for me even on reboots, just by having installed it. The only problem I've encountered so far is what Satnam has mentioned, which is the random switching between disk0 and disk1. Quite annoying. Funny how I recently contacted the developer about this issue too and he told me it was ok to keep 2 hdapm .plist files - one for disk0 and one for disk1, so that in case they got switched hdapm would still work.

    I've used the "max" APM setting for my HDD, but apparently is has quite an impact on the battery life, since I can only get about 3.5 hrs out of a month-old late-2011 MBP with 100% healthy battery. (I guess having an external monitor hooked to it would also contribute to draining the battery faster?).
     
  6. cvs macrumors member

    cvs

    Joined:
    Feb 23, 2011
    #6
    Reviving this thread, to share hdapm v1.2 use.

    I have been using the earlier versions for a while, needing to use the terminal command every now and then because the hdapm.plist did not work every time, for some reason. I had 2 lists beacuse of the random switching of the optibay HDD to disk0.

    Installed the hdapm_1.2 and used it as is. No specific editing or whatever.
    It seems to work fine all the time. So all those steps might not be needed anymore (apart from actually installing the Aug 2012 version).
     
  7. Stephobs macrumors newbie

    Stephobs

    Joined:
    Oct 7, 2014
    Location:
    Oxealere, France
    #7
    Hi,
    Doesn't do it for me. This constant clicking noise and the uneffective litterature around it just drives me mad.
    I installed hdapm 1.2 but no dice, still this everlasting crickety nerve wrecking noise. Reading endless forum for initiated techs here & there did not solve my pb!
    I'm really fed up with this mac mini late 2012 fusion drive et all.
    It's still under warranty. I guess I'll have to bring it to an apple store agin'. What a bummer!
    As a fcp user, I'm very disappointed altogether despite all the buzz around this "miracle" machine...
     
  8. rachalmers macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #8
    Just installed hdapm.

    Recently upgraded my 2012 Mini to two HDDs, replaced the original drive, and added a new 1TB second drive.
    There has been an annoyingly loud CLICK coming from the box - presumably one of the drives since, so I installed hdapm just now, restarted, and it seems ... touch wood to have stopped it.

    Slightly confusing messages in console though, as first it says it's successful, then it says its not ...
    but hey, lets see what happens.

    [​IMG]

    So it's been 8:33 -> 9:00am, nearly 30 minutes and no click.
     
  9. Stephobs macrumors newbie

    Stephobs

    Joined:
    Oct 7, 2014
    Location:
    Oxealere, France
    #9
    HDAPM, zenitude & mac mini 2012

    You lucky dude ! Btw, I'm amazed to learn that you found space in the little mac mini to install 2 hd !
    On my side of the prairie, nothing really went the way advertised in the hdapm manual describing its installation as being child simple! Errors in the terminal & clicking reappearing here & there for various periods of time became a routine.
    As it gets on my nerve since I work in a silent environment, I simply set the machine as far as I could from my ears so that I not obsessed with the b… clicking anymore. But when I get closer, I can still hear it click like nuts!
    An apple approved repair shop here ran a thorough check on the HD & said everything was fine. They won't change it as long as it's not completely dead & I'm 4 months away from the end of warranty.
    That's my predicament: all I can do is to buy the apple care & be an happy apple tax payer.
    Please keep me posted if your click reappears & we'll start a class action -;)
     
  10. rachalmers macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #10
    I decided to double up the hdd when the main drive started to die, with 2 weeks left of the "new" Apple Care package. The local shop wanted £158 to 'send it away'... plus new drive etc etc. So I thought to hell with it, and purchased a couple new drives, along with Carbon Copy Clone. Anyway, after an hour on the kitchen table - and only one screw left over!!! it all went back together and works fine. Upper and Lower hdd drives squeezed in there.
    Then it started clicking. I'm running Yosemite 10.10.2, on a system nearly the same as yours. 2012 model. Am I glad I didn't wait and get one of the new ones!
    Code:
     OSX Yosemite. 10.10.2.
      Model Name:	Mac mini
      Model Identifier:	Macmini6,2
      Processor Name:	Intel Core i7
      Processor Speed:	2.3 GHz
      Number of Processors:	1
      Total Number of Cores:	4
      L2 Cache (per Core):256 KB
      L3 Cache:6 MB
      Memory:16 GB
      Boot ROM Version:MM61.0106.B03
      SMC Version (system):2.8f1
    I went for two drives, rather than Fusion setups. Put a 7200rpm drive as the boot drive, and a 5400 as the spare.

    So, I've been on this now for a few hours, and still no clicking. I didn't do anything like setting up with the Terminal. Just downloaded the .dmg file, and installed the package - rebooted, and it's been fine ever since, touch wood.

    I read in another thread somewhere that Apple are aware of this problem with replacement drives, and apparently they modify their own drives so it doesn't happen.
    So much for Apple Care. Waste of money I reckon.
    :apple:
     
  11. Stephobs macrumors newbie

    Stephobs

    Joined:
    Oct 7, 2014
    Location:
    Oxealere, France
    #11
    Good for you ! You should have filmed & share the hdd recipe. You ripe to set up an alternative apple repear shop now -;)
    I'm running M.Lion final cut 7 obliges. I dunno if it influences the clicking. Before I brought it to the apple shop to check the hdd, I trashed my documents from the hdd & the clicking vanished. So I guess it might be some of my software which create the click.
    Would you have the forum link of what you wrote "I read in another thread somewhere that Apple are aware of this problem with replacement drives, and apparently they modify their own drives so it doesn't happen", I'm interested!
    Thanks for your preceding reply anyways.
     
  12. rachalmers macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #12
    Clicking vanishing when files are trashed and cleaned, might indicate 'bad sectors' rather than this head parking problem. The heads can click a LOT when the drive is repeatedly trying to read a bad sector - and failing. Some click, some just slowwwwww the computer down. ? Just a thought.

    No worries. Thank goodness for the History in Safari.. :)
    This is the article. There are probably others.
    http://mymacfixes.blogspot.co.uk/2009/06/how-do-i-stop-clicking-noise-from-hard.html
    Second paragraph. It's 2009, but probably still current. Don't know how valid it is, but it sounds about right.
     
  13. bladerunner2000 macrumors 68000

    bladerunner2000

    Joined:
    Jun 12, 2015
    #13
    I just installed a Samsung ST2000LM003 HN-M201RAD Media into the opti-bay of my 2011 MacBook Pro. I've got a Samsung 850 EVO in the default bay, I'd rather have it in to opti-bay but every time I put it in there, it will NOT boot.

    However, HDD in opti-bay and SSD in default boots up fine. Except that there is a damn clicking noise of the head parking. It clicks once every X number of seconds, typically more often when I'm using the battery but much less often when I've got the laptop plugged in with the charger, which is about 98% of the time as it's almost always at work.

    I tried installing HDAPM and followed the steps. When I open the hdapm.plist file, there is no entry that reads <string>disk0</string>.

    Below is the text from the console in regards to HDAPM.

    This is what I've got in the console
    2016-02-25 2:41:20.000 AM kernel[0]: hfs: mounted hdapm on device disk3s2
    2016-02-25 2:41:20.177 AM mds[62]: (Volume.Normal:2464) volume:0x7f9c4e00b800 ********** Bootstrapped Creating a default store:1 SpotLoc:(null) SpotVerLoc:(null) occlude:0 /Volumes/hdapm
    2016-02-25 2:41:33.254 AM com.apple.xpc.launchd[1]: (hdapm) Unknown key for string: ServiceDescription
    2016-02-25 2:41:33.263 AM hdapm[4107]: disk0: Samsung SSD 850 EVO 250GB
    2016-02-25 2:41:33.263 AM hdapm[4107]: Set APM Level to 0xfe: FAILED: APM not supported
    2016-02-25 2:41:33.264 AM hdapm[4107]: disk1: ST2000LM003 HN-M201RAD
    2016-02-25 2:41:33.264 AM hdapm[4107]: Set APM Level to 0xfe: FAILED: APM not supported
    2016-02-25 2:52:39.000 AM kernel[0]: hfs: unmount initiated on hdapm on device disk3s2
    2016-02-25 2:59:07.860 AM hdapm[66]: disk0: Samsung SSD 850 EVO 250GB
    2016-02-25 2:59:07.860 AM hdapm[66]: Set APM Level to 0xfe: FAILED: APM not supported
    2016-02-25 2:59:07.860 AM hdapm[66]: disk1: ST2000LM003 HN-M201RAD
    2016-02-25 2:59:07.861 AM hdapm[66]: Set APM Level to 0xfe: FAILED: APM not supported

    Can anyone help? The hard drive is being used to hold all of my work documents. I do have backups, but I really need to work off of SATA as it's way faster than either USB 2.0 or Firewire 800.

    Thank you.
    --- Post Merged, Feb 25, 2016 ---
    Tried this command after installing HDAPM and got this:

    Set APM Level to 0xc3: FAILED: APM not supported
     
  14. rachalmers macrumors member

    rachalmers

    Joined:
    Oct 21, 2012
    Location:
    UK
    #14

    Hi,
    My plist file reads like this. I'm on a Mac Mini with two drives
    Drive 0:HGST HTS721010A9E630. Upper bay. Drive 1:ST1000LM024 HN-M101MBB. Lower Bay

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>hdapm</string>
    <key>ServiceDescription</key>
    <string>Set ATA Advanced Power Management level</string>
    <key>LaunchOnlyOnce</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>root</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/bin/hdapm</string>
    <string>max</string>
    <string>-log</string>
    </array>
    </dict>
    </plist>



    In a quote from another thread, I found this also.
    Do you find that the Samsung drive is accumulating a lot of load cycles? If not, there may be no problem to "fix".

    The important things to look at (with SMARTUtility or some other tool capable of reading detailed SMART paramaters) are the "Power Cycle Count" and the "Load Cycle Count". If Load Cycles are way higher than Power Cycles, there's potentially an issue. If not, probably not to worry.

    I've seen scenarios where a pretty new drive may have a couple hundred power cycles, and something like hundreds of thousands of load cycles. Those are the situations where drive performance and longevity may be suffering.

    The thread is here. Well worth reading.... https://serato.com/forum/discussion/667121
     
  15. bladerunner2000 macrumors 68000

    bladerunner2000

    Joined:
    Jun 12, 2015
    #15
    Thanks, I'll have to take a look. The head parking click noise doesn't happen as often as some, but it seems to be every 30-60 seconds. I don't recall the drive making any of these noises when it was connected via USB in it's original enclosure.
     
  16. Marx55 macrumors 65816

    Joined:
    Jan 1, 2005
    #16
    Will hdapm work with macOS 10.12 Sierra on Mac mini (late 2012) 1TB Fusion Drive showing high Load Cycle Count?
     
  17. Stephobs macrumors newbie

    Stephobs

    Joined:
    Oct 7, 2014
    Location:
    Oxealere, France
    #17
    Forget it !
    I wanted to go from mountain to sierra but couldn't, so I called apple. The operator made me realize my HDD was dead, had it change thx to apple care & now it's ok, no clicking anymore. End of story.
     

Share This Page