Ubuntu's "load/unload cycle threat" analysis and official Solutions

Source: Internet
Author: User

Due to Ubuntu's own problems, most hard disks may experience a large number of load/unload cycle (Head reset) operations during use, about 2-3 times/minute.

During normal use of a hard disk, the load/unload cycle will not appear several times in the last day, however, this bug in Ubuntu will make the previously negligible load/unload cycle a huge system risk and directly shorten the hard drive life (usually the hard drive can load/unload cycle 600,000 times, and then over ).

The above is not an alarmist. It is just like BT downloading software will increase the hard drive head burden (later btsoftware has a caching function to reduce the number of hard drive reads.

Https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/59695

Https://wiki.ubuntu.com/DanielHahler/Bug59695

All problems are analyzed and solved. It's just e-text. Here is the solution of Wiki on the official website.

Force hdparm values in ACPI hooks

Gilles posted the following workaround: create a file called 99-fix-park.sh (keep the '99-'and '. sh', but you can name the file as you like otherwise) with the following two lines:

 
#! /Bin/sh hdparm-B 254 $ HDD

And copy it to the following directories:/etc/ACPI/resume. d/and/etc/ACPI/start. d/

Https://launchpad.net/ubuntu/+source/acpi-support/+bug/59695/comments/10)

Simply put, it is in Ubuntu's ETC/ACPI/resume. d/and/etc/ACPI/start. d/put a 99-fix-park.sh file (99-xx-xx.sh, XX can be written at Will) in the directory. The content is the two lines. Then the system will execute this command at startup, so that it will not perform unnecessary load/unload cycle. Of course there will be several times a day, but it is enough to ignore it.

Of course, the two directories have limited permissions.

Enter the terminal, enter Su, press enter, and then enter the root password to obtain the root permission and perform operations on the/etc directory.

CD/desktop: Enter the desktop, create the file on the desktop, and use cp xxx (File Name)/etc/ACPI/resume. d/

And cp xxx (File Name)/etc/ACPI/start. d/copy the file (if you do not have the root permission, you cannot copy it ).

Then you can delete the desktop file and go to the etc directory to see if the file has been copied.

 

Note: In some places on the Internet, it is said that you want to copy the file to three folders, and the file content is not hdparm-B 254 $ HDD. The above two posts have discussed this, if the content is 255 (theoretical maximum ),ProgramIt may not be executed (Hard Disk power management is disabled). If you copy data to three folders instead of the two above, there will be side effects. Therefore, I believe that the Wiki on the official website is based on the above.

Then, if you have time, you can use the system hardware check tools such as AIDA to check how many hours your hard disk has been started, how many times it has been started, and how many cycle has been loaded/unloaded, then we can estimate how long it will take for a tractor to become a zombie.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.