{"id":411,"date":"2018-03-27T16:14:43","date_gmt":"2018-03-27T23:14:43","guid":{"rendered":"http:\/\/www.sysop.ca\/?p=411"},"modified":"2018-10-01T06:30:24","modified_gmt":"2018-10-01T13:30:24","slug":"prevent-a-high-load_cycle_count-value-on-rhel7-centos7","status":"publish","type":"post","link":"http:\/\/www.sysop.ca\/?p=411","title":{"rendered":"Prevent a high Load_Cycle_Count value on RHEL7\/CentOS7"},"content":{"rendered":"<p>I recently bought a cheap 2.5 inch Seagate ST1000LM048 1TB drive for a small Dell Optiplex 990 system I have. I&#8217;m using the system as a basic lab shell host and to host a local http mirror for some often-used software from work. The Optiplex is an ultra small form factor system so it only accepts 2.5 inch laptop drives. I was going to put an SSD in it however in this case space &gt; speed and I didn&#8217;t want to spend a fortune on this machine as it&#8217;s 6 years old.<\/p>\n<p>One thing I noticed with this cheap $60 drive is it seems to have fairly aggressive APM features. In 12 hours of on-time it incremented the Load_Cycle_Count over 300.<\/p>\n<p style=\"padding-left: 30px;\">[root@shell ~]# smartctl -a \/dev\/sda |grep Load_Cycle_Count<br \/>\n193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always &#8211; 315<\/p>\n<p>I did some research online and it seems to be a fairly common issue. I remember having this issue with some WD Green drives 5 or 6 years ago. I hear if you contact Seagate support they have a tool called SeaChestUtilities that can permanently disable some drive power features however the easier route for me is to use the linux hdparm tool.<\/p>\n<p>The solution then was to use hdparm to adjust the APM timer for the drive. After a quick yum search I located hdparm and installed it. Running hdparm -B \/dev\/sda will tell you the current value from 1-255, with 1 being the most aggressive power saving and 255 being disabled.<\/p>\n<p>Since this system will be online 24&#215;7 I chose to disable mine with hdparm -B 255 \/dev\/sda although I also see people suggesting a value of 254. You may want to play with the value to find the best results for you, especially if you&#8217;re using a battery powered device.<\/p>\n<p>The only issue with this approach is the fix is only temporary and is lost on the next reboot. I looked at the hdparm man-page and it suggests using \/etc\/hdparm.conf for permanent changes however on RHEL7\/CentOS7 there isn&#8217;t a systemd unit file for hdparm so it&#8217;s not entirely clear if the file will be read on boot. I opted to go the the easiest way and add my hdparm string to \/etc\/rc.d\/rc.local:<\/p>\n<p style=\"padding-left: 30px;\">[root@shell ~]# grep hdparm \/etc\/rc.d\/rc.local<br \/>\n\/usr\/sbin\/hdparm -B 255 \/dev\/sda<br \/>\n[root@shell ~]# chmod u+x \/etc\/rc.d\/rc.local<br \/>\n[root@shell ~]# systemctl enable rc-local<\/p>\n<p style=\"padding-left: 30px;\">[root@shell ~]# systemctl status rc-local<br \/>\n\u00e2\u2014\u008f rc-local.service &#8211; \/etc\/rc.d\/rc.local Compatibility<br \/>\nLoaded: loaded (\/usr\/lib\/systemd\/system\/rc-local.service; static; vendor preset: disabled)<br \/>\nActive: active (exited) since Tue 2018-03-27 16:36:17 MDT; 26min ago<\/p>\n<p style=\"padding-left: 30px;\">Mar 27 16:36:17 shell.sysop.ca systemd[1]: Starting \/etc\/rc.d\/rc.local Compatibility&#8230;<br \/>\nMar 27 16:36:17 shell.sysop.ca rc.local[15796]: \/dev\/sda:<br \/>\nMar 27 16:36:17 shell.sysop.ca rc.local[15796]: setting Advanced Power Management level to disabled<br \/>\nMar 27 16:36:17 shell.sysop.ca rc.local[15796]: APM_level = off<br \/>\nMar 27 16:36:17 shell.sysop.ca systemd[1]: Started \/etc\/rc.d\/rc.local Compatibility.<\/p>\n<p>Now every time on boot it will adjust the drive&#8217;s APM settings. In the last 8 hours the Load_Cycle_Count has not increased.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently bought a cheap 2.5 inch Seagate ST1000LM048 1TB drive for a small Dell Optiplex 990 system I have. I&#8217;m using the system as a basic lab shell host and to host a local http mirror for some often-used software from work. The Optiplex is an ultra small form factor system so it only &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.sysop.ca\/?p=411\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Prevent a high Load_Cycle_Count value on RHEL7\/CentOS7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,11,23],"tags":[],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-general","category-hardware","category-linux"],"_links":{"self":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=411"}],"version-history":[{"count":2,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":414,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=\/wp\/v2\/posts\/411\/revisions\/414"}],"wp:attachment":[{"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sysop.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}