Hard disk failure processing method in a system Linux

The invention provides a method for processing a failure of a hard disk under a Linux system. The method comprises the following steps of: 1, configuring files; 2, periodically detecting the hard disk, and storing a result in a hard disk log file; 3, extracting state parameters of the hard disk; 4, judging whether the failure occurs or is to occur in the hard disk according to the state parameters of the hard disk, if so, sending a failure event to a processing module by a detection module, executing the step 5, and otherwise, continuously executing the step 2; 5, searching a corresponding failure processing scheme by the processing module according to the type of the failure event which is sent by the detection module; and 6, performing failure processing by the failure processing scheme, after the failure processing is finished, exiting from the processing module, and continuously executing the step 2. By the method, a user can flexibly customize according to own requirements, and when the failure occurs or is to occur in the hard disk, an alarm is given to the user, a bad track of the hard disk is repaired, or the data of the hard disk is backed up, so that the use flexibility of the user and the safety of the data of the hard disk are improved.