Fault recovery method and device for hard disk in server, equipment and storage medium
By comprehensively diagnosing and analyzing the types of hard disk failures and triggering corresponding recovery strategies, the problem of low accuracy of hard disk failure recovery in the existing technology is solved, and effective coverage of multiple fault scenarios and high accuracy failure recovery is achieved.
Patent Information
- Application Number
- CN202411692331.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
The existing technology cannot effectively cover all hard disk failure scenarios, resulting in low accuracy of hard disk failure recovery, especially when the hard disk is still in a fault state after the firmware is upgraded.
Through comprehensive diagnosis and analysis of the fault types of hard disks, and trigger corresponding fault recovery strategies according to different fault types, covering multiple fault scenarios and improving the accuracy of hard disk failure recovery.
It achieves effective coverage of various hard disk failure scenarios, improves the accuracy of hard disk failure recovery, and ensures the stable operation of the server.
Smart Images

Figure CN119621394A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for recovering a hard disk failure in a server. Background Art
[0002] With the rapid development of the Internet, the demand for servers in various industries is growing. At the same time, there is a more urgent need for server stability. Especially in industries related to people's livelihood and finance, there are extremely high requirements for the stable operation of servers.
[0003] The hard disk is one of the storage media in the three major components of the server. If the hard disk fails, there is a possibility of key data loss, which will affect the stable operation of the server and reduce the stability of the server. Therefore, when the hard disk fails, it is necessary to recover the hard disk failure in the server.
[0004] The existing method for recovering hard disk failure is to use a hot spare disk supported by the RAID card to rebuild the failed disk array using the hot spare disk. However, this method cannot cover all failure scenarios. It is the only processing method and cannot make an adaptive recovery strategy based on the overall machine status. For example, if the hard disk is still in a failed state after the firmware upgrade, there is no corresponding processing solution. Therefore, the accuracy of hard disk failure recovery is low. Summary of the invention
[0005] The present invention provides a hard disk fault recovery method in a server, which is used to analyze the hard disk fault type through comprehensive diagnosis, trigger corresponding fault recovery strategies according to different fault types, cover multiple fault scenarios, and improve the accuracy of hard disk fault recovery.
[0006] In a first aspect, the present application provides a method for recovering a hard disk failure in a server, the method comprising:
[0007] Acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk;
[0008] Determine, according to the status information of the first hard disk, a hard disk failure type of the first hard disk, wherein the first hard disk is any one of the hard disks in the server;
[0009] Determine a target fault recovery strategy corresponding to the hard disk fault type of the first hard disk by using a preset correspondence between the hard disk fault type and the fault recovery strategy;
[0010] The target fault recovery strategy is used to recover from the fault of the first hard disk.
[0011] The above method determines the hard disk failure type of the hard disk according to the status information of the hard disk, and then determines the target fault recovery strategy corresponding to the hard disk failure type of the hard disk by using the pre-set correspondence between the hard disk failure type and the fault recovery strategy; and uses the target fault recovery strategy to recover the hard disk failure. Therefore, in the embodiment of the present application, the hard disk failure type is analyzed through comprehensive diagnosis, and the corresponding fault recovery strategy is triggered according to different failure types, thereby covering a variety of fault scenarios and improving the accuracy of hard disk failure recovery.
[0012] In a possible implementation, the hard disk failure type includes a hard disk failure and an array card failure, wherein the hard disk failure is used to indicate that a hard disk fails, and the array card failure is used to indicate that an array card in the server fails.
[0013] The above method improves the accuracy of hard disk failure recovery by including multiple failure types in the hard disk failure type to ensure that it is not a single processing method.
[0014] In a possible implementation manner, determining the fault type of the first hard disk according to the status information of the first hard disk includes:
[0015] If the status information of the first hard disk is a fault state, determining that the hard disk fault type of the first hard disk is a hard disk fault;
[0016] If the status information of the first hard disk is empty, it is determined that the hard disk failure type of the first hard disk is an array card failure.
[0017] The above method determines the fault type of the hard disk through the status information of the hard disk, thereby ensuring the accuracy of the determined fault type.
[0018] In a possible implementation manner, if the hard disk failure type is the hard disk failure;
[0019] Recovering the failure of the first hard disk by using the target failure recovery strategy includes:
[0020] Determine a target logical disk corresponding to the first hard disk by using a preset correspondence relationship between hard disks and logical disks, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located;
[0021] Determine whether there is a hot spare disk in the target logical disk by using the function identifier of each hard disk in the target logical disk, wherein the function identifier is used to indicate the function of the hard disk in the target logical disk;
[0022] If yes, use the hot spare disk to replace the first hard disk, and restore the data in the first hard disk to the hot spare disk;
[0023] If not, an idle hard disk in the server is set as the hot spare disk, and the hot spare disk is used to replace the first hard disk, and the data in the first hard disk is restored to the hot spare disk.
[0024] The above method, through the hot spare disk in the target logical disk or setting the idle hard disk as a hot spare disk, and starting the hot spare disk, and restoring the data in the first hard disk to the hot spare disk, realizes that the hot spare disk can continue to work instead of the first hard disk, ensuring that the hard disk failure type is a hard disk failure and can be solved in time.
[0025] In a possible implementation, the method further includes:
[0026] If the idle hard disk does not exist in the server, notifying the user to replace the first hard disk;
[0027] When it is determined that the first hard disk is replaced, determining whether the configuration of the replaced first hard disk meets a specified condition;
[0028] If yes, determining the replaced first hard disk as the hot spare disk, and using the hot spare disk to replace the first hard disk, and restoring the backup data corresponding to the first hard disk to the hot spare disk;
[0029] If not, the process returns to the step of notifying the user to replace the first hard disk until the backup data corresponding to the first hard disk is restored to the hot spare disk.
[0030] The above method is a corresponding fault recovery mode when the idle hard disk does not exist in the server, which ensures that the hard disk fault can be recovered and further improves the accuracy of fault recovery.
[0031] In a possible implementation manner, if the hard disk failure type is the array card failure;
[0032] The recovering the first hard disk failure by using the target failure recovery strategy includes:
[0033] Based on the fault log reported by the server, determine whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log;
[0034] If yes, processing the failure of the first hard disk based on the current temperature of the array card;
[0035] If not, the current link status of the serial communication bus I2C link where the array card is located is obtained, and the first hard disk is restored from failure based on the current link status of the I2C link.
[0036] The above method performs fault recovery through the current temperature of the array card or the I2C link where the array card is located, so as to ensure that the hard disk fault can be recovered when the hard disk fault type is an array card fault, further improving the accuracy of hard disk fault recovery.
[0037] In a possible implementation manner, processing the failure of the first hard disk based on the current temperature of the array card includes:
[0038] If the current temperature is greater than the specified temperature, a target fan speed corresponding to the current temperature of the array card is determined by using a preset correspondence between the temperature and the fan speed, and the speed of the fan corresponding to the array card is adjusted to the target speed until the current temperature is no greater than the specified temperature, and then the process returns to the step of determining whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log based on the fault log reported by the server;
[0039] If the current temperature is not greater than the specified threshold, the user is reminded to perform fault recovery;
[0040] The performing fault recovery on the first hard disk based on the current link state of the I2C link includes:
[0041] If the current state of the I2C link is an abnormal state, the I2C link is reset.
[0042] The above method adjusts the temperature of the array card by adjusting the fan speed to ensure that the temperature of the array card returns to a normal temperature, or resets the I2C link to ensure that the I2C link where the array card is located returns to normal, thereby ensuring that the hard disk whose fault type is an array card fault can be solved.
[0043] In a possible implementation, the method further includes:
[0044] If the current state of the I2C link is normal and the state information of the first hard disk is empty, then acquiring the fault information in the array card log in the server; wherein the array card log is used to store the fault information reported by the array card;
[0045] Determining fault recovery indication information according to the fault information;
[0046] The fault recovery indication information is sent to a user terminal device, so that the user can perform fault recovery based on the fault recovery indication information.
[0047] The above method ensures that when the current state of the I2C link is normal and the state information of the first hard disk is empty, there is corresponding fault recovery indication information, and notifies the user to perform fault recovery based on the fault recovery indication information, so as to ensure that different types of faults can be resolved in time.
[0048] In a possible implementation, the method further includes:
[0049] If the fault information is empty, after determining the hard disk fault type as a hard disk fault, return to execute the step of using the pre-set correspondence between the hard disk fault type and the fault recovery strategy to determine the target fault recovery strategy corresponding to the hard disk fault type of the first hard disk.
[0050] In the above method, when the fault information is empty, the hard disk fault type is determined to be a hard disk fault, and the fault recovery strategy corresponding to the hard disk fault is used to perform fault recovery, thereby ensuring that the fault can be resolved in a timely manner.
[0051] In a second aspect, the present application provides a hard disk failure recovery device in a server, the device comprising:
[0052] An acquisition module, used to acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk;
[0053] a fault type determination module, configured to determine a hard disk fault type of a first hard disk according to status information of the first hard disk, wherein the first hard disk is any one of the hard disks in the server;
[0054] a fault recovery strategy determination module, configured to determine a target fault recovery strategy corresponding to the hard disk fault type of the first hard disk by using a preset correspondence between hard disk fault types and fault recovery strategies;
[0055] A fault recovery module is used to recover the fault of the first hard disk by using the target fault recovery strategy.
[0056] In a possible implementation, the hard disk failure type includes a hard disk failure and an array card failure, wherein the hard disk failure is used to indicate that a hard disk fails, and the array card failure is used to indicate that an array card in the server fails.
[0057] In a possible implementation manner, the fault type determination module is specifically configured to:
[0058] If the status information of the first hard disk is a fault state, determining that the hard disk fault type of the first hard disk is a hard disk fault;
[0059] If the status information of the first hard disk is empty, it is determined that the hard disk failure type of the first hard disk is an array card failure.
[0060] In a possible implementation manner, if the hard disk failure type is the hard disk failure;
[0061] The fault recovery module is specifically used for:
[0062] Determine a target logical disk corresponding to the first hard disk by using a preset correspondence relationship between hard disks and logical disks, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located;
[0063] Determine whether there is a hot spare disk in the target logical disk by using the function identifier of each hard disk in the target logical disk, wherein the function identifier is used to indicate the function of the hard disk in the target logical disk;
[0064] If yes, use the hot spare disk to replace the first hard disk, and restore the data in the first hard disk to the hot spare disk;
[0065] If not, an idle hard disk in the server is set as the hot spare disk, and the hot spare disk is used to replace the first hard disk, and the data in the first hard disk is restored to the hot spare disk.
[0066] In a possible implementation manner, the fault recovery module is further configured to:
[0067] If the idle hard disk does not exist in the server, notifying the user to replace the first hard disk;
[0068] When it is determined that the first hard disk is replaced, determining whether the configuration of the replaced first hard disk meets a specified condition;
[0069] If yes, determining the replaced first hard disk as the hot spare disk, and using the hot spare disk to replace the first hard disk, and restoring the backup data corresponding to the first hard disk to the hot spare disk;
[0070] If not, the process returns to the step of notifying the user to replace the first hard disk until the backup data corresponding to the first hard disk is restored to the hot spare disk.
[0071] In a possible implementation manner, if the hard disk failure type is the array card failure;
[0072] The fault recovery module is specifically used for:
[0073] Based on the fault log reported by the server, determine whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log;
[0074] If yes, processing the failure of the first hard disk based on the current temperature of the array card;
[0075] If not, the current link status of the serial communication bus I2C link where the array card is located is obtained, and the first hard disk is restored from failure based on the current link status of the I2C link.
[0076] In a possible implementation manner, the fault recovery module is further configured to:
[0077] If the current temperature is greater than the specified temperature, a target fan speed corresponding to the current temperature of the array card is determined by using a preset correspondence between the temperature and the fan speed, and the speed of the fan corresponding to the array card is adjusted to the target speed until the current temperature is no greater than the specified temperature, and then the process returns to the step of determining whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log based on the fault log reported by the server;
[0078] If the current temperature is not greater than the specified threshold, the user is reminded to perform fault recovery;
[0079] The performing fault recovery on the first hard disk based on the current link state of the I2C link includes:
[0080] If the current state of the I2C link is an abnormal state, the I2C link is reset.
[0081] In a possible implementation manner, the fault recovery module is further configured to:
[0082] If the current state of the I2C link is normal and the state information of the first hard disk is empty, then acquiring the fault information in the array card log in the server; wherein the array card log is used to store the fault information reported by the array card;
[0083] Determining fault recovery indication information according to the fault information;
[0084] The fault recovery indication information is sent to a user terminal device, so that the user can perform fault recovery based on the fault recovery indication information.
[0085] In a possible implementation manner, the fault recovery module is further configured to:
[0086] If the fault information is empty, after determining the hard disk fault type as a hard disk fault, return to execute the step of using the pre-set correspondence between the hard disk fault type and the fault recovery strategy to determine the target fault recovery strategy corresponding to the hard disk fault type of the first hard disk.
[0087] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the fault recovery method of the hard disk in the server when executing the computer program.
[0088] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for recovering a hard disk in a server described above in the present application.
[0089] In the fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which is stored in a computer-readable storage medium; when the processor of a memory access device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the memory access device executes the steps in the hard disk failure recovery method in the above-mentioned server of the present application.
[0090] For each aspect from the third to the fifth aspect and the technical effects that may be achieved by each aspect, please refer to the technical effects that can be achieved by various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0092] Figure 1 One of the flowcharts of a method for recovering a hard disk failure in a server provided in an embodiment of the present application;
[0093] Figure 2 A schematic diagram of a fault recovery process corresponding to a hard disk fault type provided in an embodiment of the present application is a hard disk fault;
[0094] Figure 3 A flowchart of a fault recovery method corresponding to a hard disk fault type of array card fault provided in an embodiment of the present application;
[0095] Figure 4A second flowchart of a method for recovering a hard disk in a server provided in an embodiment of the present application;
[0096] Figure 5 A schematic diagram of a hard disk failure recovery device in a server provided in an embodiment of the present application;
[0097] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0098] In order to make the purpose, technical solution and advantages of the present application more clear, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operation method in the method embodiment can also be applied to the device embodiment or the system embodiment.
[0099] In the description of this application, "multiple" is understood to be "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. A is connected to B, which can represent two situations: A is directly connected to B and A is connected to B through C. In addition, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0100] The existing method for recovering hard disk failure is to use a hot spare disk supported by the RAID card to rebuild the failed disk array using the hot spare disk. However, this method cannot cover all failure scenarios. It is the only processing method and cannot make an adaptive recovery strategy based on the overall machine status. For example, if the hard disk is still in a failed state after the firmware upgrade, there is no corresponding processing solution. Therefore, the accuracy of hard disk failure recovery is low.
[0101] In this regard, an embodiment of the present application provides a method for recovering a hard disk in a server, by determining the hard disk failure type of the hard disk according to the status information of the hard disk, and then using the pre-set correspondence between the hard disk failure type and the failure recovery strategy to determine the target failure recovery strategy corresponding to the hard disk failure type of the hard disk; the hard disk failure is recovered using the target failure recovery strategy, thereby, in the embodiment of the present application, the failure type of the hard disk is analyzed through comprehensive diagnosis, and the corresponding failure recovery strategy is triggered according to different failure types, thereby covering a variety of failure scenarios and improving the accuracy of hard disk failure recovery.
[0102] The following is a description of a method for recovering a hard disk in a server according to an embodiment of the present application in conjunction with the accompanying drawings. Figure 1 FIG. 1 is a flow chart of a method for recovering a hard disk failure in a server, which may specifically include the following steps:
[0103] Step 101: Acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk;
[0104] The status information in the embodiment of the present application includes normal status, fault status, working status, offline status, etc.
[0105] Step 102: determining a hard disk failure type of a first hard disk according to status information of the first hard disk, wherein the first hard disk is any one of the hard disks in the server;
[0106] The hard disk failure types in the embodiment of the present application include hard disk failure and array card failure, wherein the hard disk failure is used to indicate that the hard disk fails, and the array card failure is used to indicate that the array card in the server fails.
[0107] In a possible implementation, step 102 may be specifically implemented as follows:
[0108] If the status information of the first hard disk is a fault state, it is determined that the hard disk fault type of the first hard disk is a hard disk fault; if the status information of the first hard disk is empty, it is determined that the hard disk fault type of the first hard disk is an array card fault.
[0109] In the embodiment of the present application, the state information of the first hard disk is empty, which means that the state information of the first hard disk cannot be obtained. In the embodiment of the present application, when the state information of the first hard disk is obtained and is in a fault state or empty, a hard disk fault log is reported. The hard disk fault log is terminated when the hard disk fault is restored.
[0110] Step 103: using the preset correspondence between the hard disk failure type and the failure recovery strategy, determine a target failure recovery strategy corresponding to the hard disk failure type of the first hard disk;
[0111] Step 104: Utilize the target fault recovery strategy to recover from the fault of the first hard disk.
[0112] Next, the fault recovery method in step 104 is introduced. First, the corresponding fault recovery method when the hard disk fault type is a hard disk fault is introduced. Figure 2 FIG. 1 is a flowchart of a fault recovery process corresponding to a hard disk fault type of a hard disk fault, which may specifically include the following steps:
[0113] Step 201: using a preset correspondence between hard disks and logical disks, determining a target logical disk corresponding to the first hard disk, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located;
[0114] Step 202: using the function identifier of each hard disk in the target logical disk, determine whether there is a hot spare disk in the target logical disk, if yes, execute step 203, if no, execute step 204; wherein the function identifier is used to indicate the function of the hard disk in the target logical disk;
[0115] For example, function identifier A is used to indicate a hot spare disk, function identifier B is used to indicate a backup disk, etc. In the embodiment of the present application, each hard disk in the logical disk has a corresponding function identifier, and the function identifier of each hard disk can be used to determine whether there is a hot spare disk in the target logical disk.
[0116] Step 203: Replace the first hard disk with the hot spare disk, and restore the data in the first hard disk to the hot spare disk;
[0117] In the embodiment of the present application, the data in the first hard disk is restored to the hot spare disk, that is, the hot spare disk replaces the first hard disk, and the data in the first hard disk is restored to the hot spare disk. This step is the step of logical disk reconstruction, which belongs to the prior art and is not the invention point of the present application. The embodiment of the present application will not be repeated here.
[0118] Step 204: Determine whether there is an idle hard disk in the server, if yes, execute step 205, if no, execute step 206;
[0119] Step 205: setting an idle hard disk in the server as the hot spare disk, and using the hot spare disk to replace the first hard disk, and restoring the data in the first hard disk to the hot spare disk.
[0120] In a possible implementation, before setting the idle hard disk in the server as the hot spare disk, it is determined that the type of the idle hard disk is the same as the hard disk type of the first hard disk, and the hard disk capacity of the idle hard disk is not less than the capacity of the target logical disk.
[0121] In a possible implementation, setting the idle hard disk in the server as the hot spare disk can be specifically implemented as: adding the idle hard disk to the target logical disk, and setting the function identifier of the idle hard disk to the function identifier corresponding to the hot spare disk.
[0122] Step 206: Notify the user to replace the first hard disk;
[0123] In the embodiment of the present application, the message notified to the user includes the slot corresponding to the first hard disk in the server, so that the user can correctly replace the first hard disk.
[0124] Step 207: when it is determined that the first hard disk has been replaced, determine whether the configuration of the replaced first hard disk meets a specified condition; if so, execute step 208; if not, return to execute step 206;
[0125] In the embodiment of the present application, the BMC (Baseboard Management Controller) in the server detects whether a hard disk has been replaced or a new disk has been inserted by polling the backplane. That is, the status information of the first hard disk is obtained, and the status of the hard disk is compared with the status information of the hard disk obtained last time. If they are the same, it is determined that the first hard disk has not been replaced; if they are not the same, it is determined that the first hard disk has been replaced.
[0126] Step 208: determine the replaced first hard disk as the hot spare disk, use the hot spare disk to replace the first hard disk, and restore the backup data corresponding to the first hard disk to the hot spare disk.
[0127] In the embodiment of the present application, if the backup data of the first hard disk exists in other hard disks in the target logical disk except the first hard disk and the hot spare disk, the replaced first hard disk is determined as the hot spare disk, and the backup data in other hard disks are copied to the hot spare disk.
[0128] The specified conditions in the embodiment of the present application are that the type of the first hard disk after replacement is the same as the hard disk type of the first hard disk, and the capacity of the first hard disk after replacement is not less than the capacity of the target logical disk.
[0129] After introducing the corresponding fault recovery method when the hard disk fault type is a hard disk fault, the corresponding fault recovery method when the hard disk fault type is an array card fault in the embodiment of the present application is introduced. Figure 3 As shown, it is a flowchart of a fault recovery method corresponding to a hard disk fault type of array card fault, which may specifically include the following steps:
[0130] Step 301: Based on the fault log reported by the server, determine whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log; if so, execute step 302, if not, execute step 303;
[0131] Step 302: Processing the failure of the first hard disk based on the current temperature of the array card;
[0132] In one embodiment, step 302 can be specifically implemented as follows: if the current temperature is greater than the specified temperature, a preset correspondence between temperature and fan speed is used to determine a target fan speed corresponding to the current temperature of the array card, and the speed of the fan corresponding to the array card is adjusted to the target speed until the current temperature is no greater than the specified temperature, then returning to the step of determining whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log based on the fault log reported by the server; if the current temperature is not greater than the specified threshold, reminding the user to perform fault recovery.
[0133] The following describes the specific methods for users to perform fault recovery:
[0134] First, the user restarts the server and checks whether the PCIE UCE alarm is cleared. If so, the process ends. If not, re-plug the cable and riser, and check again whether the PCIE UCE alarm is cleared. If not, replace the cable and riser, and check whether the PCIE UCE alarm is cleared. If not, replace the PCIE card.
[0135] Step 303: Acquire the current link status of the serial communication bus I2C link where the array card is located, and perform fault recovery on the first hard disk based on the current link status of the serial communication bus I2C link.
[0136] In one embodiment, step 303 may be specifically implemented as follows: if the current state of the I2C link is an abnormal state, resetting the I2C link.
[0137] In the embodiment of the present application, the reset of the I2C link is implemented by using the PCA9548 chip. Specifically, the RESET signal pin of the PCA9548 chip is connected to the BMC GPIO (General-purpose input / output) in the server, and the BMC realizes the reset function of the I2C link by pulling down the RESET pin level and then immediately restoring the RESET pin level.
[0138] In order to ensure that a variety of fault scenarios can be covered, in one embodiment, if the current state of the I2C link is normal and the state information of the first hard disk is empty, the fault information in the array card log in the server is obtained; wherein the array card log is used to store the fault information reported by the array card; according to the fault information, fault recovery indication information is determined; and the fault recovery indication information is sent to the user terminal device so that the user can perform fault repair based on the fault recovery indication information.
[0139] In the embodiment of the present application, the pre-set correspondence between fault information and fault recovery indication information is used to determine the fault recovery indication information corresponding to the fault information. Table 1 shows the correspondence between fault information and fault recovery indication information:
[0140] Table 1:
[0141] Fault Information Failure recovery instructions BBU Failure Replace the BBU Cache failure Replace the cache Array card failure Replace the array card … …
[0142] For example, if the fault information is a BBU (Battery Backup Unit) fault, the user is notified to replace the BBU. If the fault information is a cache fault, the user is notified to replace the cache. If the fault information is an array card fault, the user is notified to replace the array card.
[0143] In a possible implementation, if the fault information is empty, after the hard disk fault type is determined to be a hard disk fault, the process returns to execute the step of using the pre-set correspondence between the hard disk fault type and the fault recovery strategy to determine the target fault recovery strategy corresponding to the hard disk fault type of the first hard disk.
[0144] Next, combine Figure 4 The method for recovering a hard disk failure in a server in an embodiment of the present application is described, and may specifically include the following steps:
[0145] Step 401: Acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk;
[0146] Step 402: if the state information of the first hard disk is a fault state, after determining that the hard disk fault type of the first hard disk is a hard disk fault, execute step 404;
[0147] Step 403: if the status information of the first hard disk is empty, after determining that the hard disk failure type of the first hard disk is an array card failure, execute step 408;
[0148] Step 404: using the preset correspondence between hard disks and logical disks, determining a target logical disk corresponding to the first hard disk, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located;
[0149] Step 405: using the function identifiers of the hard disks in the target logical disk, determine whether there is a hot spare disk in the target logical disk. If so, execute step 406; if not, execute step 407;
[0150] Wherein, the function identifier is used to indicate the function of the hard disk in the target logical disk;
[0151] Step 406: Replace the first hard disk with the hot spare disk, and restore the data in the first hard disk to the hot spare disk;
[0152] Step 407: setting an idle hard disk in the server as the hot spare disk, replacing the first hard disk with the hot spare disk, and restoring data in the first hard disk to the hot spare disk;
[0153] Step 408: Based on the fault log reported by the server, determine whether there is a PCIEUCE alarm in the fault log, if yes, execute step 409, if no, execute step 412;
[0154] Step 409: Determine whether the current temperature of the array card is greater than the specified temperature, if so, execute step 410, if not, execute step 411;
[0155] Step 410: using the preset correspondence between temperature and fan speed, determine the target fan speed corresponding to the current temperature of the array card, and adjust the speed of the fan corresponding to the array card to the target speed until the current temperature is not greater than the specified temperature, and then return to step 408;
[0156] Step 411: Remind the user to perform fault recovery;
[0157] Step 412: If the current state of the I2C link is an abnormal state, reset the I2C link.
[0158] Based on the same inventive concept, the present application also provides a fault recovery device for a hard disk in a server, see Figure 5 , the device 500 comprises:
[0159] The acquisition module 501 is used to acquire the status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk;
[0160] A fault type determination module 502 is used to determine a hard disk fault type of a first hard disk according to the state information of the first hard disk, wherein the first hard disk is any one of the hard disks in the server;
[0161] A fault recovery strategy determination module 503 is used to determine a target fault recovery strategy corresponding to the hard disk fault type of the first hard disk by using a preset correspondence between the hard disk fault type and the fault recovery strategy;
[0162] The fault recovery module 504 is used to recover the fault of the first hard disk by using the target fault recovery strategy.
[0163] In a possible implementation, the hard disk failure type includes a hard disk failure and an array card failure, wherein the hard disk failure is used to indicate that a hard disk fails, and the array card failure is used to indicate that an array card in the server fails.
[0164] In a possible implementation manner, the fault type determination module 502 is specifically configured to:
[0165] If the status information of the first hard disk is a fault state, determining that the hard disk fault type of the first hard disk is a hard disk fault;
[0166] If the status information of the first hard disk is empty, it is determined that the hard disk failure type of the first hard disk is an array card failure.
[0167] In a possible implementation manner, if the hard disk failure type is the hard disk failure;
[0168] The fault recovery module 504 is specifically used for:
[0169] Determine a target logical disk corresponding to the first hard disk by using a preset correspondence relationship between hard disks and logical disks, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located;
[0170] Determine whether there is a hot spare disk in the target logical disk by using the function identifier of each hard disk in the target logical disk, wherein the function identifier is used to indicate the function of the hard disk in the target logical disk;
[0171] If yes, start the hot spare disk and restore the data in the first hard disk to the hot spare disk;
[0172] If not, an idle hard disk in the server is set as the hot spare disk, the hot spare disk is started, and the data in the first hard disk is restored to the hot spare disk.
[0173] In a possible implementation manner, the fault recovery module 504 is further configured to:
[0174] If the idle hard disk does not exist in the server, notifying the user to replace the first hard disk;
[0175] When it is determined that the first hard disk is replaced, determining whether the configuration of the replaced first hard disk meets a specified condition;
[0176] If yes, determining the replaced first hard disk as the hot spare disk, and restoring the backup data corresponding to the first hard disk to the hot spare disk;
[0177] If not, the process returns to the step of notifying the user to replace the first hard disk until the backup data corresponding to the first hard disk is restored to the hot spare disk.
[0178] In a possible implementation manner, if the hard disk failure type is the array card failure;
[0179] The fault recovery module 504 is specifically used for:
[0180] Based on the fault log reported by the server, determine whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log;
[0181] If yes, processing the failure of the first hard disk based on the current temperature of the array card;
[0182] If not, the current link status of the serial communication bus I2C link where the array card is located is obtained, and the first hard disk is restored from failure based on the current link status of the serial communication bus I2C link.
[0183] In a possible implementation manner, the fault recovery module 504 is further configured to:
[0184] If the current temperature is greater than the specified temperature, a target fan speed corresponding to the current temperature of the array card is determined by using a preset correspondence between temperature and fan speed, and the speed of the fan corresponding to the array card is adjusted to the target speed until the current temperature is no greater than the specified temperature, and then the process returns to the step of determining whether there is an array card UCE event in the fault log based on the fault log reported by the server;
[0185] If the current temperature is not greater than the specified threshold, the user is reminded to perform fault recovery;
[0186] The performing fault recovery on the first hard disk based on the current link state of the I2C link includes:
[0187] If the current state of the I2C link is an abnormal state, the I2C link is reset.
[0188] In a possible implementation manner, the fault recovery module 504 is further configured to:
[0189] If the current state of the I2C link is normal and the state information of the first hard disk is empty, then acquiring the fault information in the array card log in the server; wherein the array card log is used to store the fault information reported by the array card;
[0190] Determining fault recovery indication information according to the fault information;
[0191] The fault recovery indication information is sent to a user terminal device, so that the user can perform fault recovery based on the fault recovery indication information.
[0192] In a possible implementation manner, the fault recovery module 504 is further configured to:
[0193] If the fault information is empty, after determining the hard disk fault type as a hard disk fault, return to execute the step of using the pre-set correspondence between the hard disk fault type and the fault recovery strategy to determine the target fault recovery strategy corresponding to the hard disk fault type of the first hard disk.
[0194] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the function of the hard disk failure recovery device in the aforementioned server, referring to Figure 6 , the electronic device comprises:
[0195] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.
[0196] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute the hard disk failure recovery method in the server discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 6 The functions of each module in the device shown.
[0197] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling the data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.
[0198] In one possible design, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.
[0199] Processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the hard disk failure recovery method in the server disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0200] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0201] By programming the processor 601, the code corresponding to the method for recovering the hard disk in the server described in the above embodiment can be fixed into the chip, so that the chip can execute the method when running. Figure 1The steps of the method for recovering a hard disk failure in a server in the embodiment shown are as follows: How to design and program the processor 601 is a technology well known to those skilled in the art and will not be described in detail here.
[0202] An embodiment of the present application also provides a computer-readable storage medium that stores computer-executable instructions required to execute the above-mentioned processor, which includes a program required to execute the above-mentioned processor.
[0203] In some possible implementations, various aspects of the method for recovering a hard disk in a server provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method for recovering a hard disk in a server according to various exemplary implementations of the present application described above in this specification.
[0204] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0205] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0208] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0209] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for recovering a hard disk failure in a server, characterized in that: The method comprises: Acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk; Determine, according to the status information of the first hard disk, a hard disk failure type of the first hard disk, wherein the first hard disk is any one of the hard disks in the server; Determine a target fault recovery strategy corresponding to the hard disk fault type of the first hard disk by using a preset correspondence between the hard disk fault type and the fault recovery strategy; The target fault recovery strategy is used to recover from the fault of the first hard disk.
2. The method according to claim 1, characterized in that The hard disk failure types include hard disk failure and array card failure, wherein the hard disk failure is used to indicate that the hard disk fails, and the array card failure is used to indicate that the array card in the server fails.
3. The method according to claim 2, characterized in that The determining, according to the status information of the first hard disk, the fault type of the first hard disk includes: If the status information of the first hard disk is a fault state, determining that the hard disk fault type of the first hard disk is a hard disk fault; If the status information of the first hard disk is empty, it is determined that the hard disk failure type of the first hard disk is an array card failure.
4. The method according to claim 2, characterized in that: If the hard disk failure type is the hard disk failure; Recovering the failure of the first hard disk by using the target failure recovery strategy includes: Determine a target logical disk corresponding to the first hard disk by using a preset correspondence relationship between hard disks and logical disks, wherein the logical disk is a hard disk array composed of multiple hard disks, and the target logical disk is the logical disk where the first hard disk is located; Determine whether there is a hot spare disk in the target logical disk by using the function identifier of each hard disk in the target logical disk, wherein the function identifier is used to indicate the function of the hard disk in the target logical disk; If yes, use the hot spare disk to replace the first hard disk, and restore the data in the first hard disk to the hot spare disk; If not, an idle hard disk in the server is set as the hot spare disk, and the hot spare disk is used to replace the first hard disk, and the data in the first hard disk is restored to the hot spare disk.
5. The method according to claim 4, characterized in that The method further comprises: If the idle hard disk does not exist in the server, notifying the user to replace the first hard disk; When it is determined that the first hard disk is replaced, determining whether the configuration of the replaced first hard disk meets a specified condition; If yes, determining the replaced first hard disk as the hot spare disk, and using the hot spare disk to replace the first hard disk, and restoring the backup data corresponding to the first hard disk to the hot spare disk; If not, the process returns to the step of notifying the user to replace the first hard disk until the backup data corresponding to the first hard disk is restored to the hot spare disk.
6. The method according to claim 2, characterized in that If the hard disk failure type is the array card failure; The recovering the first hard disk failure by using the target failure recovery strategy includes: Based on the fault log reported by the server, determine whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log; If yes, processing the failure of the first hard disk based on the current temperature of the array card; If not, the current link status of the serial communication bus I2C link where the array card is located is obtained, and the first hard disk is restored from failure based on the current link status of the I2C link.
7. The method according to claim 6, characterized in that The processing of the failure of the first hard disk based on the current temperature of the array card includes: If the current temperature is greater than the specified temperature, a target fan speed corresponding to the current temperature of the array card is determined by using a preset correspondence between the temperature and the fan speed, and the speed of the fan corresponding to the array card is adjusted to the target speed until the current temperature is no greater than the specified temperature, and then the process returns to the step of determining whether there is a high-speed serial computer expansion bus PCIE uncorrectable error UCE alarm in the fault log based on the fault log reported by the server; If the current temperature is not greater than the specified threshold, the user is reminded to perform fault recovery; The performing fault recovery on the first hard disk based on the current link state of the I2C link includes: If the current state of the I2C link is an abnormal state, the I2C link is reset.
8. The method according to claim 7, characterized in that The method further comprises: If the current state of the I2C link is normal and the state information of the first hard disk is empty, then acquiring the fault information in the array card log in the server; wherein the array card log is used to store the fault information reported by the array card; Determining fault recovery indication information according to the fault information; The fault recovery indication information is sent to a user terminal device, so that the user can perform fault recovery based on the fault recovery indication information.
9. The method according to claim 8, characterized in that The method further comprises: If the fault information is empty, after determining the hard disk fault type as a hard disk fault, return to execute the step of using the pre-set correspondence between the hard disk fault type and the fault recovery strategy to determine the target fault recovery strategy corresponding to the hard disk fault type of the first hard disk.
10. A hard disk failure recovery device in a server, characterized in that: The device comprises: An acquisition module, used to acquire status information of each hard disk in the server, wherein the status information is used to indicate the current status of the hard disk; a fault type determination module, configured to determine a hard disk fault type of a first hard disk according to status information of the first hard disk, wherein the first hard disk is any one of the hard disks in the server; A fault recovery strategy determination module is used to determine a target fault recovery strategy corresponding to the hard disk fault type of the first hard disk by using a preset correspondence between the hard disk fault type and the fault recovery strategy; A fault recovery module is used to recover the fault of the first hard disk by using the target fault recovery strategy.
11. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 9 when executing a computer program stored in the memory.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Disk exception processing method and device, equipment and storage medium
CN120523689A
Disk exception processing method, device, equipment and storage medium
CN120523689B
Video stream fault recovery method, system and device and storage medium
CN120658858A