Onboard hard disk fault detection method and device applied to server

By comparing the I2C bus and BIOS information files, the problem of onboard hard drive failure detection was solved, enabling timely alarms and rapid service recovery for onboard hard drives.

CN119576668BActive Publication Date: 2025-12-26XINHUASAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411747240.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-12-26
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing technologies cannot detect faults in onboard hard drives that are directly installed on the motherboard, resulting in the inability to issue alarms in a timely manner and affecting the security of critical business data.

Method used

The system reads the onboard hard drive's identifier via the I2C bus and compares it with the hard drive information file transmitted by the BIOS to detect hard drive malfunctions, including hard drive loss and device unavailability.

Benefits of technology

It enables fault detection of onboard hard drives, timely alarm issuance, and ensures the security and rapid recovery of critical business data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576668B_ABST
    Figure CN119576668B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and device for detecting the failure of the on-board hard disk applied to a server. In the embodiment, the identification of the on-board hard disk currently in the server is obtained by reading through the I2C bus of the server, the current on-board hard disk information file (containing the information of each on-board hard disk currently in the server) is obtained by the BIOS of the server, the obtained identification of the on-board hard disk currently in the server is compared with the identification of each on-board hard disk contained in the current on-board hard disk information file, so as to detect whether the on-board hard disk of the server has the failure of missing and / or the failure of device disable. The failure detection mode without relying on the storage card to transmit the out-of-band information can detect the failure of the on-board hard disk without connecting the storage card, so that the failure of the on-board hard disk is detected, and the alarm can be sent in time when the on-board hard disk fails.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of server operation and maintenance, and particularly relates to a method and device for detecting a fault of an on-board hard disk of a server. BACKGROUND

[0002] As an important storage space on a server, a hard disk often carries key business data, and therefore, it is crucial to issue an alarm in a timely manner when the hard disk fails, so as to promptly troubleshoot and quickly restore the business.

[0003] At present, fault alarms are usually performed by relying on out-of-band information reported by a storage card (the out-of-band information mainly covers the health status of the hard disk and the like), however, an on-board hard disk refers to a storage device directly installed on a mainboard through a backplane, which is not connected with the storage card, and the out-of-band information that cannot be reported by the on-board hard disk can only report basic events such as insertion and removal of the hard disk, which leads to the fact that the on-board hard disk cannot be timely alarmed when it fails.

[0004] Therefore, there is an urgent need for a fault detection method for an on-board hard disk to issue an alarm when the on-board hard disk fails. SUMMARY

[0005] In view of this, the embodiments of the present application provide a method and device for detecting a fault of an on-board hard disk of a server to issue an alarm when the on-board hard disk fails.

[0006] The embodiments of the present application provide a method for detecting a fault of an on-board hard disk of a server, which comprises the following steps.

[0007] Obtaining an identifier of a currently seated on-board hard disk of the server read through an I2C bus of the server;

[0008] Obtaining a current on-board hard disk information file delivered by a BIOS of the server, the current on-board hard disk information file containing information of each on-board hard disk of the current server; the information of any on-board hard disk at least comprising an identifier of the on-board hard disk;

[0009] Detecting whether the on-board hard disk of the server fails by comparing the obtained identifier of the currently seated on-board hard disk and the identifiers of the on-board hard disks contained in the current on-board hard disk information file;

[0010] The detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the current on-board hard disk in place and the identification of each on-board hard disk contained in the current on-board hard disk information file comprises at least one of the following cases: for the identification of each on-board hard disk in place obtained, if the identification of the on-board hard disk in place is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk in place has a hard disk missing fault; for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the current on-board hard disk in place, a second fault indication is output, and the second fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

[0011] The embodiment of the present application also provides a kind of on-board hard disk fault detection device applied to server, and the device comprises:

[0012] The first obtaining module is used to obtain the identification of the current on-board hard disk in place on the server read through I2C bus on the server;

[0013] The second obtaining module is used to obtain the current on-board hard disk information file passed by BIOS on the server, and the current on-board hard disk information file contains the information of each on-board hard disk on the current server; the information of any on-board hard disk at least includes the identification of the on-board hard disk;

[0014] The detecting module is used to detect whether the on-board hard disk of the server is faulty by comparing the obtained identification of the current on-board hard disk in place and the identification of each on-board hard disk contained in the current on-board hard disk information file;

[0015] The detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the current on-board hard disk in place and the identification of each on-board hard disk contained in the current on-board hard disk information file comprises at least one of the following cases: for the identification of each on-board hard disk in place obtained, if the identification of the on-board hard disk in place is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk in place has a hard disk missing fault; for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the current on-board hard disk in place, a second fault indication is output, and the second fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

[0016] The embodiment of the present application further provides an electronic device, comprising a processor and a computer readable storage medium for storing computer program instructions, which, when executed by the computer readable storage medium, cause the processor to perform the steps of the above method.

[0017] The embodiment of the present application further provides a machine readable storage medium, which stores computer program instructions, when the computer program instructions are executed, the steps of the above method can be implemented.

[0018] From the above technical solution, in the embodiment, the identification of the on-board hard disk currently in the server is obtained by reading through the I2C bus on the server, the current on-board hard disk information file (the current on-board hard disk information file contains the information of each on-board hard disk in the current server) passed by the BIOS on the server is obtained, the obtained identification of the on-board hard disk currently in the server is compared with the identification of each on-board hard disk contained in the current on-board hard disk information file, to detect whether the on-board hard disk of the server has a hard disk missing fault and / or a device disable fault. This way of detecting faults without relying on the storage card to pass out-of-band information can detect the fault of the on-board hard disk without connecting the storage card. Thus, the fault of the on-board hard disk is detected to send an alarm in time when the on-board hard disk fails, so as to prompt the user to troubleshoot in time, and then quickly restore the service. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 The flowchart of the method provided by the embodiment of the present application is shown;

[0020] Figure 2 The flowchart of obtaining the current on-board hard disk information file provided by the embodiment of the present application is shown;

[0021] Figure 3 The flowchart of obtaining the json file provided by the embodiment of the present application is shown;

[0022] Figure 4 The flowchart of another method provided by the embodiment of the present application is shown;

[0023] Figure 5 The structural diagram of the device provided by the embodiment of the present application is shown;

[0024] Figure 6 The structural diagram of the electronic device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] In order for those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the drawings.

[0026] Before describing the method provided by the embodiments of the present application, the technical problem is described in detail:

[0027] At present, in the related art, the hard disk on the mainboard is directly installed on the hard disk board through the backboard, the hard disk indirectly connected to the mainboard through the backboard and the storage card is a non-board hard disk, the BMC recognizes the out-of-band information of the hard disk through the storage card, so as to determine the Fault state of the disk, such as the hard disk being in the Failed, Offline, UnconfiguredBad state. However, the on-board hard disk is not connected with the storage card, and the out-of-band information that cannot be reported cannot be determined by the above-mentioned method. The on-board hard disk can only determine whether it is in the Drive Presence through the Complex Programmable Logic Device (CPLD) on the backboard. For the user level, it is not possible to perceive whether the on-board hard disk is still running normally, that is, the on-board hard disk failure reporting rate is almost 0%, and the hard disk as an important storage space on the server often carries critical business data, and once a failure occurs, it may cause irreparable loss.

[0028] Therefore, there is an urgent need for a fault detection method for on-board hard disks to issue an alarm when the on-board hard disk fails.

[0029] Based on this, the embodiments of the present application provide a method and device for detecting the fault of on-board hard disks applied to servers, which can detect the fault of on-board hard disks without connecting storage cards, so as to realize the detection of on-board hard disks, issue an alarm in time when the on-board hard disk fails, prompt the user to troubleshoot in time, and thus quickly recover the business.

[0030] The method provided by the embodiments of the present application will be described in detail below:

[0031] Referring to Figure 1 , Figure 1 the flowchart of the method provided by the embodiments of the present application. As an embodiment, the execution subject of the method can be a Baseboard Management Controller (BMC) in a server.

[0032] As Figure 1 shown, the flowchart can include the following steps:

[0033] S101, obtaining the identification of the on-board hard disk currently in place on the server through the I2C bus on the server.

[0034] In this embodiment, as an example, the identification of any on-board hard disk can be represented by the physical slot number of the on-board hard disk.

[0035] In this embodiment, the above-mentioned step S101 has many specific implementation manners when specifically implemented, for example, as an example, after the server is normally running, the BMC reads the hard disk in-place information of the backplane CPLD through the I2C bus every specified time period (for example, every 10 minutes). Any hard disk in-place information at least includes the physical slot number of the on-board hard disk in place, the physical slot number of the absent on-board hard disk, the physical slot number of the offline on-board hard disk, and the physical slot number of the on-board hard disk in the preheating state. Through the in-place information, the physical slot number of the on-board hard disk currently in place can be obtained.

[0036] S102, obtaining the current on-board hard disk information file passed by the BIOS on the server, the current on-board hard disk information file containing the information of each on-board hard disk on the current server; the information of any on-board hard disk at least includes the identification of the on-board hard disk.

[0037] As an example, the information of any on-board hard disk includes at least one of the following in addition to the identification of the on-board hard disk (the physical slot number of the on-board hard disk):

[0038] BIOS under number, on-board hard disk model, on-board hard disk firmware version, on-board hard disk capacity, on-board hard disk speed, on-board hard disk type, and on-board hard disk serial number.

[0039] In this embodiment, how the BIOS obtains the current on-board hard disk information file in the above-mentioned step S201, and how the BMC obtains the information of each on-board hard disk after obtaining the current on-board hard disk information file from the BIOS will be described in the form of specific examples in the following, which will not be repeated here.

[0040] S103, detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the current on-board hard disk in place with the identification of each on-board hard disk contained in the current on-board hard disk information file. Wherein, detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the current on-board hard disk in place with the identification of each on-board hard disk contained in the current on-board hard disk information file includes at least one of the following cases: for the obtained identification of each on-board hard disk in place, if the identification of the on-board hard disk in place is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, output a first fault indication, and the first fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk in place has a hard disk missing fault; for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the current on-board hard disk in place, output a second fault indication, and the second fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

[0041] In the embodiment, the identification of the current on-board hard disk in place on the server read by the I2C bus illustrates which on-board hard disk is located in the correct physical slot from the hardware connection point of view. The current on-board hard disk information file sent by the BIOS illustrates the running condition of each on-board hard disk, and comparison between the two can accurately analyze whether the on-board hard disk is faulty.

[0042] In the embodiment, the specific implementation mode of the above step S103 will be described in the form of specific examples in the following, which will not be described here.

[0043] At this point, the process shown in Figure 1 is completed.

[0044] As can be seen from the process shown in Figure 1 , in the embodiment, the identification of the current on-board hard disk in place on the server read by the I2C bus is obtained, the current on-board hard disk information file (containing the information of each on-board hard disk on the current server) transmitted by the BIOS on the server is obtained, the obtained identification of the current on-board hard disk in place is compared with the identification of each on-board hard disk contained in the current on-board hard disk information file, and whether the on-board hard disk of the server has a hard disk missing fault and / or a Device Disable fault is detected. This way of detecting faults without relying on the storage card to transmit out-of-band information can detect the fault of the on-board hard disk without connecting the storage card, so that the detection of the on-board hard disk is realized, and an alarm is sent in time when the on-board hard disk fails, prompting the user to troubleshoot in time, and then quickly recovering the business.

[0045] The following describes how the BIOS obtains the current on-board hard disk information file and how the BMC obtains information of each on-board hard disk after the BIOS obtains the current on-board hard disk information file.

[0046] Please refer to Figure 2 , Figure 2 The flowchart for obtaining the current on-board hard disk information file is provided for the embodiments of the present application.

[0047] As shown in Figure 2 , the flowchart includes the following steps.

[0048] S201, before the BIOS enters the setup state for the first time, obtain the backplane configuration information from the main logic register, and the backplane configuration information is used to indicate the correspondence between each on-board hard disk and the identifier on the backplane.

[0049] S202, write the backplane configuration information into a first json file, and send the first json file to the BIOS, so that the BIOS completes the initialization configuration based on the correspondence in the backplane configuration information in the first json file, and after the BIOS enters the setup complete state from the setup state for the first time, update the first json file based on the current obtained on-board hard disk information, to obtain the initial on-board hard disk information file.

[0050] In the embodiment, in order to ensure that the BIOS can correctly identify and manage all on-board hard disks, before the BIOS enters the setup state for the first time, the correspondence between each on-board hard disk and the identifier is obtained by hardware connection (i.e., by directly connecting the backplane configuration of the platform controller hub (PCH)), the backplane configuration is parsed, and the correspondence is transmitted to the BIOS in a first json file, so that the BIOS completes the initialization configuration based on the correspondence, so that the BIOS can correctly identify the identifier of each on-board hard disk, and after the BIOS enters the setup complete state from the setup state for the first time, the information of each on-board hard disk obtained at this time is written into the first json file based on these configurations, to obtain a second json file, and the second json file is the initial on-board hard disk information file at this time.

[0051] For example, as shown in Figure 3As shown, the BMC obtains the backplane configuration of the platform controller hub (PCH) before the BIOS enters the setup state for the first time, and obtains the hard disk slot distribution information through the backplane configuration and the hard disk slot distribution rule. For models that do not match the general rule, the hard disk slot distribution configuration information is written in xml for adaptation. The hard disk slot distribution information is written into a json file and transmitted to the BIOS, and the BIOS can parse the corresponding physical slot number according to the hard disk slot distribution information. After the BIOS enters the setup complete state from the setup state for the first time, the information of each on-board hard disk is used to update the json file, which is sent to the BMC.

[0052] S203, starting from the initial on-board hard disk information file, whenever the BIOS on the server enters the setup complete state from the setup state, and every interval specified period, the BIOS updates the last current on-board hard disk information file based on the information of each on-board hard disk currently obtained, to obtain the latest on-board hard disk information file.

[0053] In this embodiment, the BIOS updates the last on-board hard disk information file at each update time point to obtain the latest on-board hard disk information file. Each update time point refers to a time point when the BIOS on the server enters the setup complete state from the setup state, and every interval specified period.

[0054] It should be noted that, here, the time interval of updating the on-board hard disk information file can be the same as the time interval of obtaining the identification of the on-board hard disk currently in place by the BMC through the I2C bus in step S101.

[0055] The above describes in detail how the BIOS obtains the current on-board hard disk information file, and how the BMC obtains the information of each on-board hard disk after obtaining the current on-board hard disk information file from the BIOS:

[0056] As an example, the BMC can obtain the / var / BiosPush / BiosBeforeBoot.json file, and the BMC copies the file to / mnt / sdmmc0p4 / bios / BiosBeforeBoot.json.

[0057] The information of each on-board hard disk is located in the "OnBoardSataInfo" field in the json file, and the specific information field is as follows:

[0058] "PhySlot" : Front1————————————————hard disk physical slot

[0059] "LogSlot": 1 —————————————————— BIOS ID

[0060] Model: Intel SSDSC2KB240G7 — Hard drive model

[0061] "FwVersion" : "SCV10121" ———————————— Hard drive firmware version

[0062] "Capacity": 240.0 GB (Hard Disk Capacity)

[0063] "Speed": 6.0Gbps————————————————Hard disk speed

[0064] "Type": "SSD" ————————————————— Hard Drive Type

[0065] "SerialNumber": "PHLF725200RL2P0HGN" — Hard drive serial number

[0066] Using the above method, BMC obtains information about each onboard hard drive on the current server.

[0067] As an example, after obtaining the information of each onboard hard disk, in order to facilitate comparison with the identifier of the previously present onboard hard disk read through the I2C bus, the identifier of the currently present onboard hard disk read through the I2C bus is stored in a global variable, and the information of each onboard hard disk is stored in database A. Then, the identifier of the currently present onboard hard disk is obtained from the global variable and database A and compared with the identifier in the information of the onboard hard disk.

[0068] Furthermore, after the writing to database A is completed, the obtained onboard hard disk information is processed and converted into structure data for the API interface. The structure is stored in database B corresponding to the AIP interface. When the API interface is called, the onboard hard disk information is retrieved from database B.

[0069] The above provides a detailed explanation of how the BIOS obtains the current onboard hard drive information file, and how the BMC obtains the information of each onboard hard drive after obtaining the current onboard hard drive information file from the BIOS.

[0070] The following describes in detail the detection of whether the server's on-board hard disk is faulty (i.e., step S103 described above) by comparing the obtained identification of the current on-board hard disk and the identification of each on-board hard disk contained in the current on-board hard disk information file:

[0071] There are many specific implementation manners of step S103 described above. For example, as an embodiment, for the obtained identification of each on-board hard disk, if the identification of the on-board hard disk is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, a first fault indication is output, which is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a missing fault.

[0072] If the identification of the on-board hard disk is found from the identification of each on-board hard disk contained in the current on-board hard disk information file, the on-site log of the on-board hard disk represented by the identification of the on-board hard disk is output.

[0073] As another embodiment, for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the current on-board hard disk, a second fault indication is output, which is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

[0074] If the identification of the on-board hard disk is not found from the identification of the current on-board hard disk, the on-site log of the on-board hard disk represented by the identification of the on-board hard disk is output.

[0075] As another embodiment, for the obtained identification of each on-board hard disk, if the identification of the on-board hard disk is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, a first fault indication is output, which is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a missing fault.

[0076] If the identification of the on-board hard disk is found from the identification of each on-board hard disk contained in the current on-board hard disk information file, the on-site log of the on-board hard disk represented by the identification of the on-board hard disk is output.

[0077] For the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the current on-board hard disk, a second fault indication is output, which is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

[0078] If the identification of the current in-place onboard hard disk is not found from the identification of the current in-place onboard hard disk, the in-place log of the onboard hard disk represented by the identification of the in-place onboard hard disk is output.

[0079] The above describes in detail the detection of whether the onboard hard disk of the server is faulty by comparing the identification of the current in-place onboard hard disk obtained and the identification of each onboard hard disk contained in the current onboard hard disk information file.

[0080] In order to describe the method provided by the present application in more detail, the following describes the method provided by the present application in combination with the server Figure 4 The scheme provided by the present application is described in more detail in the manner of specific embodiments.

[0081] In the embodiment, the identification of the onboard hard disk is represented by the physical slot number of the onboard hard disk.

[0082] In combination with the flowchart shown in FIG. 1, the flow includes the following steps: Figure 4

[0083] 1. When the server is normally running, the in-place information of the onboard hard disk is obtained by reading the backplane CPLD through I2C, and the physical slot number of the in-place onboard hard disk is stored in global variable A.

[0084] 2. The BIOS passes BiosBeforeBoot.json to the BMC, the BMC reads all the onboard hard disk information of the json file and stores it in database B.

[0085] 3. The physical slot number of each onboard hard disk in global variable A is compared with all the physical slot numbers of the onboard hard disks in database B:

[0086] (1) If the physical slot number can be found in database B, it is proved that the onboard hard disk corresponding to the physical slot number can be normally obtained, and no other log is reported except the in-place log of the onboard hard disk, that is, no alarm is performed.

[0087] (2) If the physical slot number cannot be found in database B, it is proved that the detailed information of the onboard hard disk corresponding to the physical slot number cannot be obtained, and the missing needs to be reported in addition to the in-place log of the onboard hard disk, and is associated with Drive Fault.

[0088] 4. The physical slot number of each onboard hard disk in database B is compared with all the physical slot numbers of the onboard hard disks in global variable A;

[0089] (1) If the physical slot number is found in global variable A, it is proved that the onboard hard disk can be normally obtained, and no other log is reported except the in-place log of the onboard hard disk, that is, no alarm is performed.

[0090] ​(2) If the physical slot number cannot be found in the global variable A, it means that the BIOS recognizes the onboard hard drive but the CPLD does not recognize it, and an unavailable alarm is reported. The reported log is: Device Disable: The disk information not obtained.

[0091] The methods provided in the embodiments of this application have been described above. The apparatus provided in the embodiments of this application is described below:

[0092] See Figure 5 , Figure 5 This is a structural diagram of the device provided in an embodiment of this application. Figure 5 As shown, the device includes: a first acquisition module 501, a second acquisition module 502, and a detection module 503.

[0093] The first acquisition module 501 is used to acquire the identifier of the currently present onboard hard disk on the server, which is read through the server's I2C bus;

[0094] The second obtaining module 502 is used to obtain the current onboard hard disk information file transmitted by the BIOS on the server. The current onboard hard disk information file contains information about each onboard hard disk on the current server. The information of any onboard hard disk includes at least: the identifier of the onboard hard disk.

[0095] The detection module 503 is used to detect whether the server's onboard hard drives are faulty by comparing the obtained identifiers of the currently in-situ onboard hard drives with the identifiers of each onboard hard drive contained in the current onboard hard drive information file. Detecting whether the server's onboard hard drives are faulty by comparing the obtained identifiers of the currently in-situ onboard hard drives with the identifiers of each onboard hard drive contained in the current onboard hard drive information file includes at least one of the following: for each obtained identifier of an in-situ onboard hard drive, if the identifier of that in-situ onboard hard drive is not found in the identifiers of each onboard hard drive contained in the current onboard hard drive information file, a first fault indication is output, indicating that the onboard hard drive represented by the identifier of that in-situ onboard hard drive has a missing fault; for each identifier of an onboard hard drive contained in the current onboard hard drive information file, if the identifier of that in-situ onboard hard drive is not found in the identifiers of the currently in-situ onboard hard drives, a second fault indication is output, indicating that the onboard hard drive represented by the identifier of that inboard hard drive has a device disabled fault.

[0096] In the embodiment, the identification of the currently present on-board hard disk on the server is obtained by reading through the I2C bus on the server, the current on-board hard disk information file passed by the BIOS on the server is obtained (the current on-board hard disk information file contains information of each on-board hard disk currently on the server), the obtained identification of the currently present on-board hard disk is compared with the identification of each on-board hard disk contained in the current on-board hard disk information file, and whether the on-board hard disk of the server has a missing fault and / or a Device Disable fault is detected. The fault detection method without relying on the storage card to pass the out-of-band information can detect the fault of the on-board hard disk without connecting the storage card. Thus, the on-board hard disk is detected to timely issue an alarm when the on-board hard disk has a fault, so as to prompt the user to timely troubleshoot and then quickly restore the service.

[0097] As an embodiment,

[0098] By comparing the obtained identification of the currently present on-board hard disk with the identification of each on-board hard disk contained in the current on-board hard disk information file, whether the on-board hard disk of the server has a fault further includes:

[0099] For the obtained identification of each present on-board hard disk, if the identification of the present on-board hard disk is found from the identification of each on-board hard disk contained in the current on-board hard disk information file, the on-site log of the present on-board hard disk is output.

[0100] For the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the currently present on-board hard disk, the on-site log of the on-board hard disk is output.

[0101] As an embodiment, the identification of the currently present on-board hard disk on the server obtained by reading through the I2C bus on the server includes:

[0102] The hard disk on-site information of each on-board hard disk is obtained by reading the backplane complex programmable logic device (CPLD) of the server through the I2C bus. The hard disk on-site information of any on-board hard disk at least includes the identification of the present on-board hard disk, the identification of the absent on-board hard disk, the identification of the offline on-board hard disk, and the identification of the on-board hard disk in the warm-up state.

[0103] The identification of the currently present on-board hard disk is obtained from the hard disk on-site information of each on-board hard disk.

[0104] As an embodiment, the current on-board hard disk information file is obtained by the following steps:

[0105] Before the BIOS on the server enters the startup setup state for the first time, backplane configuration information is obtained from the main logic register, the backplane configuration information being used to indicate the correspondence between each on-board hard disk on the backplane and the identification;

[0106] The backplane configuration information is written into a first json file, and the first json file is sent to the BIOS, so that the BIOS completes initialization configuration based on the correspondence in the backplane configuration information in the first json file, and after the BIOS enters the setup complete state from the setup state for the first time, the first json file is updated based on the current obtained on-board hard disk information, to obtain an initial on-board hard disk information file;

[0107] Starting from the initial on-board hard disk information file, each time the BIOS on the server enters the setup complete state from the startup setup state, and each time a specified period of time is elapsed, the BIOS updates the last current on-board hard disk information file based on the current obtained on-board hard disk information, to obtain the latest on-board hard disk information file.

[0108] As an embodiment, the information of any on-board hard disk further includes at least one of the following:

[0109] BIOS lower number, on-board hard disk model, on-board hard disk firmware version, on-board hard disk capacity, on-board hard disk speed, on-board hard disk type, and on-board hard disk serial number.

[0110] So far, the Figure 5 structure of the device shown is described.

[0111] Referring to Figure 6 , Figure 6 the electronic device structure diagram provided by the embodiment of the present application. As Figure 5 shown, the hardware structure can include a processor and a machine readable storage medium, the machine readable storage medium storing machine executable instructions capable of being executed by the processor; the processor is used to execute the machine executable instructions to implement the method disclosed in the above examples of the present application.

[0112] Based on the same application concept as the above method, the embodiment of the present application further provides a machine readable storage medium, the machine readable storage medium storing a plurality of computer instructions, the computer instructions being executed by the processor to implement the method disclosed in the above examples of the present application.

[0113] Exemplarily, the machine-readable storage medium described above can be any electronic, magnetic, optical, or other physical storage apparatus, and can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard drive), a solid-state drive, any type of storage disc (such as a compact disc, a DVD, and the like), or similar storage media, or a combination thereof.

[0114] The above description is merely illustrative of the embodiments of the application, and not intended to limit the application. Alternatives and variations of the embodiments of the application can be clearly made by those skilled in the art without departing from the spirit and principles of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall fall within the scope of the claims of the application.

Claims

1. A method for detecting a failure of an on-board hard disk applied to a server, the method comprising: The method comprises: obtaining the identification of the currently present on-board hard disk on the server read through the I2C bus on the server; obtaining the current on-board hard disk information file passed by the BIOS on the server, the current on-board hard disk information file containing the information of each on-board hard disk currently on the server; the information of any on-board hard disk at least includes the identification of the on-board hard disk; the current on-board hard disk information file is obtained by starting from an initial on-board hard disk information file, whenever the BIOS on the server goes from the startup setup state to the setup completion state, and every interval of a specified period, the BIOS updates the last current on-board hard disk information file based on the information of each on-board hard disk currently obtained to obtain the latest on-board hard disk information file; the initial on-board hard disk information file is generated by the BIOS based on the backplane configuration information sent by the BMC, the backplane configuration information is used to indicate the correspondence between each on-board hard disk on the backplane and the identification; detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the currently present on-board hard disk and the identification of each on-board hard disk contained in the current on-board hard disk information file; wherein the detection of whether the on-board hard disk of the server is faulty by comparing the obtained identification of the currently present on-board hard disk and the identification of each on-board hard disk contained in the current on-board hard disk information file comprises at least one of the following cases: for the obtained identification of each present on-board hard disk, if the identification of the present on-board hard disk is not found from the identification of each on-board hard disk contained in the current on-board hard disk information file, a first fault indication is output, the first fault indication is used to indicate that the on-board hard disk represented by the identification of the present on-board hard disk has a hard disk missing fault; for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the currently present on-board hard disk, a second fault indication is output, the second fault indication is used to indicate that the on-board hard disk represented by the identification of the on-board hard disk has a Device Disable fault.

2. The method of claim 1, wherein, The detection of whether the on-board hard disk of the server is faulty by comparing the obtained identification of the currently present on-board hard disk and the identification of each on-board hard disk contained in the current on-board hard disk information file further comprises: for the obtained identification of each present on-board hard disk, if the identification of the present on-board hard disk is found from the identification of each on-board hard disk contained in the current on-board hard disk information file, the on-site log of the present on-board hard disk is output; for the identification of each on-board hard disk contained in the current on-board hard disk information file, if the identification of the on-board hard disk is not found from the identification of the currently present on-board hard disk, the on-site log of the on-board hard disk is output.

3. The method of claim 1, wherein, The obtaining of the identification of the currently present on-board hard disk on the server read through the I2C bus on the server comprises: Read hard disk in-place information of each on-board hard disk obtained by a backplane complex programmable logic device (CPLD) of the server through an I2C bus; the hard disk in-place information of any on-board hard disk at least includes an identification of an on-board hard disk in place, an identification of an absent on-board hard disk, an identification of an offline on-board hard disk, and an identification of an on-board hard disk in a preheating state; Obtain the identification of the on-board hard disk currently in place from the hard disk in-place information of each on-board hard disk.

4. The method of claim 1, wherein, The initial on-board hard disk information file is obtained through the following steps: Before the BIOS of the server enters a startup setup state for the first time, obtain backplane configuration information from a main logic register; Write the backplane configuration information into a first json file, and send the first json file to the BIOS, so that the BIOS completes initialization configuration based on the correspondence relationship in the backplane configuration information in the first json file, and updates the first json file based on the current obtained on-board hard disk information after the BIOS enters a setup completion state from the setup state for the first time, to obtain an initial on-board hard disk information file.

5. The method of claim 1, wherein, The information of any on-board hard disk further includes at least one of the following: BIOS lower number, on-board hard disk model, on-board hard disk firmware version, on-board hard disk capacity, on-board hard disk speed, on-board hard disk type, and on-board hard disk serial number.

6. An on-board hard disk failure detection apparatus for a server, comprising: The device comprises: A first obtaining module for obtaining the identification of the on-board hard disk currently in place on the server read through an I2C bus on the server; A second obtaining module for obtaining a current on-board hard disk information file delivered by the BIOS on the server, the current on-board hard disk information file containing information of each on-board hard disk on the current server; the information of any on-board hard disk at least includes the identification of the on-board hard disk; the current on-board hard disk information file is obtained through the following steps: starting from an initial on-board hard disk information file, whenever the BIOS on the server enters a setup completion state from a startup setup state, and every interval specified period of time, the BIOS updates the last current on-board hard disk information file based on the current obtained on-board hard disk information to obtain the latest on-board hard disk information file; the initial on-board hard disk information file is generated by the BIOS based on backplane configuration information sent by a BMC; the backplane configuration information is used to indicate the correspondence relationship between each on-board hard disk on the backplane and the identification; A detection module for detecting whether the on-board hard disk of the server is faulty by comparing the obtained identification of the on-board hard disk currently in place and the identification of each on-board hard disk contained in the current on-board hard disk information file; The detection of whether the on-board hard disk of the server is faulty by comparing the obtained identification of the on-board hard disk currently in place and the identification of each on-board hard disk contained in the current on-board hard disk information file includes at least one of the following cases: For each in-situ on-board hard disk, if the in-situ on-board hard disk's identity is not found in the identities of the on-board hard disks contained in the current on-board hard disk information file, a first fault indication is output, the first fault indication indicating that the on-board hard disk represented by the in-situ on-board hard disk's identity has a missing fault; For each on-board hard disk's identity contained in the current on-board hard disk information file, if the on-board hard disk's identity is not found in the identities of the in-situ on-board hard disks, a second fault indication is output, the second fault indication indicating that the on-board hard disk represented by the on-board hard disk's identity has a Device Disable fault.

7. The apparatus of claim 6, wherein, the detecting whether the on-board hard disks of the server have faults by comparing the obtained identities of the in-situ on-board hard disks and the identities of the on-board hard disks contained in the current on-board hard disk information file further comprises: For each in-situ on-board hard disk, if the in-situ on-board hard disk's identity is found in the identities of the on-board hard disks contained in the current on-board hard disk information file, the in-situ log of the in-situ on-board hard disk is output; For each on-board hard disk's identity contained in the current on-board hard disk information file, if the on-board hard disk's identity is not found in the identities of the in-situ on-board hard disks, the in-situ log of the on-board hard disk is output.

8. The apparatus of claim 6, wherein, the obtaining the identities of the in-situ on-board hard disks on the server read through the I2C bus on the server comprises: reading the hard disk in-situ information of each on-board hard disk obtained by a complex programmable logic device (CPLD) on the backplane of the server through the I2C bus; the hard disk in-situ information of any on-board hard disk at least including the identity of the in-situ on-board hard disk, the identity of the absent on-board hard disk, the identity of the offline on-board hard disk, and the identity of the on-board hard disk in the preheating state; obtaining the identities of the in-situ on-board hard disks from the hard disk in-situ information of each on-board hard disk; and / or, the initial on-board hard disk information file is obtained by the following steps: obtaining the backplane configuration information from the main logic register before the BIOS of the server first enters the setup state, the backplane configuration information indicating the correspondence between each on-board hard disk and identity on the backplane; writing the backplane configuration information into a first json file, and sending the first json file to the BIOS, so that the BIOS completes the initialization configuration based on the correspondence in the backplane configuration information parsed in the first json file, and updates the first json file based on the current obtained on-board hard disk information after the BIOS first enters the setup complete state from the setup state, to obtain the initial on-board hard disk information file; and / or, the information of any on-board hard disk further comprises at least one of: BIOS lower number, onboard hard drive model, onboard hard drive firmware version, onboard hard drive capacity, onboard hard drive speed, onboard hard drive type, and onboard hard drive serial number.

9. An electronic device, comprising: The electronic device includes: a processor; and a computer readable storage medium having stored thereon computer program instructions, the computer program instructions, when executed by the processor, causing the processor to perform the steps of the method of any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that, a computer readable storage medium having stored thereon computer program instructions, the computer program instructions, when executed by the processor, causing the processor to perform the steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Hard disk fault lamp lightening method, device and equipment and readable storage medium

    CN114758715A

  • Hard disk fault early warning method and system, terminal and storage medium

    CN115221015A