Onboard hard disk fault detection method and device applied to server
By reading the onboard hard disk identifier on the I2C bus on the server and comparing it with the information files transmitted by the BIOS, the onboard hard disk failure was solved, and the problem of the failure of the existing technology was not able to effectively detect the onboard hard disk failure was achieved, and timely alarms and business recovery were achieved.
Patent Information
- Application Number
- CN202411747240.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing technology cannot effectively detect and alert the fault of the onboard hard disk, resulting in the inability to issue an alarm in time when the hard disk fails, affecting the normal operation of the business.
By reading the onboard hard disk identifier on the I2C bus on the server and comparing it with the identifier in the onboard hard disk information file passed by the BIOS, we can detect whether the onboard hard disk is faulty. This method does not need to rely on the memory card to pass out-of-band information, and can detect faults on the on-board hard disk without the memory card.
It realizes fault detection of onboard hard disks, timely alarms are issued, helping users to promptly troubleshoot and quickly restore business.
Smart Images

Figure CN119576668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server operation and maintenance technology, and in particular to a method and device for detecting onboard hard disk failures applied to a server. Background Art
[0002] As an important storage space on the server, the hard disk often carries critical business data. Therefore, timely alarm when the hard disk fails is crucial for timely troubleshooting and rapid business recovery.
[0003] At present, fault alarms are usually based on out-of-band information reported by storage cards (out-of-band information mainly covers information such as the health status of the hard disk). However, an onboard hard disk refers to a storage device directly installed on the motherboard through a backplane. It is not connected to a storage card and cannot report out-of-band information. It can only report basic events such as the insertion and removal of the hard disk, which makes it impossible to issue timely alarms for faults in the onboard hard disk.
[0004] Therefore, there is an urgent need for a fault detection method for an onboard hard disk, so as to issue an alarm when a fault occurs in the onboard hard disk. Summary of the invention
[0005] In view of this, an embodiment of the present application provides an onboard hard disk fault detection method and device applied to a server, so as to generate an alarm when an onboard hard disk fails.
[0006] The present application provides an onboard hard disk fault detection method applied to a server, the method comprising:
[0007] Get the ID of the onboard hard disk currently in the server read through the I2C bus on the server;
[0008] Obtaining a current onboard hard disk information file transmitted by the BIOS on the server, the current onboard hard disk information file containing information of each onboard hard disk on the current server; the information of any onboard hard disk at least includes: an identifier of the onboard hard disk;
[0009] By comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty;
[0010] Among them, by comparing the obtained identifier of the currently in-place onboard hard disk and the identifiers of each onboard hard disk included in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty includes at least one of the following situations: for each onboard hard disk identifier that has been obtained, if the identifier of the onboard hard disk in place is not found from the identifiers of each onboard hard disk included in the current onboard hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk in place has a hard disk missing fault; for each onboard hard disk identifier included in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifier of the currently in-place onboard hard disk, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a device disabled fault.
[0011] The embodiment of the present application also provides an onboard hard disk fault detection device applied to a server, the device comprising:
[0012] The first obtaining module is used to obtain the identifier of the onboard hard disk currently in the server read through the I2C bus on the server;
[0013] The second acquisition module 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 the information of each onboard hard disk on the current server; the information of any onboard hard disk at least includes: the identification of the onboard hard disk;
[0014] A detection module, used to detect whether the onboard hard disk of the server is faulty by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file;
[0015] Among them, by comparing the obtained identifier of the currently in-place onboard hard disk and the identifiers of each onboard hard disk included in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty includes at least one of the following situations: for each onboard hard disk identifier that has been obtained, if the identifier of the onboard hard disk in place is not found from the identifiers of each onboard hard disk included in the current onboard hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk in place has a hard disk missing fault; for each onboard hard disk identifier included in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifier of the currently in-place onboard hard disk, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a device disabled fault.
[0016] An embodiment of the present application also provides an electronic device, comprising: a processor and a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions, when executed by the computer-readable storage medium, enable the processor to execute the steps of the above method.
[0017] An embodiment of the present application also 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] It can be seen from the above technical scheme that in this embodiment, by obtaining the identifier of the onboard hard disk currently in place on the server read through the I2C bus on the server, obtaining the current onboard hard disk information file transmitted by the BIOS on the server (the current onboard hard disk information file contains the information of each onboard hard disk on the current server), and comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file, it is possible to detect whether the onboard hard disk of the server has a hard disk missing fault and / or a device unavailable Device Disable fault. This method of fault detection without relying on the memory card to transmit out-of-band information can perform fault detection on an onboard hard disk that is not connected to a memory card. In this way, fault detection of the onboard hard board is achieved, so that an alarm is issued in time when the onboard hard disk fails, thereby prompting the user to troubleshoot in time and then quickly restore business. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of a process for a method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a process for obtaining the current onboard hard disk information file provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the process of obtaining a json file provided in an embodiment of the present application;
[0022] Figure 4 A schematic diagram of another method provided in an embodiment of the present application;
[0023] Figure 5 A schematic diagram of the structure of the device provided in the embodiment of the present application;
[0024] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable 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 understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0026] Before describing the method provided in the embodiment of the present application, the technical problem is described in detail:
[0027] At present, in the related technology, the hard disk installed directly on the mainboard through the backplane is an onboard hard board, and the hard disk indirectly connected to the mainboard through the backplane and the memory card is a non-onboard hard disk. The BMC recognizes the out-of-band information of the hard disk through the memory card to determine the fault state of the disk, such as the hard disk is in the Failed, Offline, UnconfiguredBad and other states. However, the onboard hard disk is not connected to the memory card, and the out-of-band information that it cannot report cannot determine the fault in the above manner. The onboard hard disk can only obtain whether the Drive Presence is in place through the complex programmable logic device (Complex Programmable Logic Device, CPLD) on the backplane. At the user level, it is impossible to perceive whether the onboard hard disk is still operating normally, that is, the onboard hard disk failure reporting rate is almost 0%, and the hard disk is an important storage space on the server, often carrying critical business data. Once a failure occurs, it may cause irreversible losses.
[0028] Therefore, there is an urgent need for a fault detection method for an onboard hard disk, so as to issue an alarm when a fault occurs in the onboard hard disk.
[0029] Based on this, the embodiments of the present application provide a method and device for onboard hard disk fault detection applied to a server. It does not rely on the memory card to transmit out-of-band information for fault detection, and can perform fault detection on an onboard hard disk that is not connected to a memory card. In this way, the detection of the onboard hard board is achieved, so that an alarm is issued in time when the onboard hard disk fails, thereby prompting the user to troubleshoot in time and quickly restore business.
[0030] The method provided in the embodiment of the present application is described in detail below:
[0031] See also Figure 1 , Figure 1 A flowchart of a method provided in an embodiment of the present application. As an embodiment, the execution subject of the method may be a baseboard management controller (BMC) in a server.
[0032] like Figure 1 As shown, the process may include the following steps:
[0033] S101, obtaining an identifier of a currently installed onboard hard disk on the server read through an I2C bus on the server.
[0034] In this embodiment, as an example, the identification of any onboard hard disk can be represented by the physical slot number of the onboard hard disk.
[0035] In this embodiment, there are many specific implementation methods for the above step S101. For example, as an embodiment, after the server runs normally, the BMC reads the backplane CPLD through the I2C bus at a specified time interval (for example, every 10 minutes) to obtain the hard disk presence information. Any hard disk presence information at least includes the physical slot number of the onboard hard disk in place, the physical slot number of the onboard hard disk that is absent, the physical slot number of the onboard hard disk that is offline, and the physical slot number of the onboard hard disk in the preheating state. The physical slot number of the onboard hard board currently in place can be obtained through the presence information.
[0036] S102, obtaining a current onboard hard disk information file transmitted by BIOS on the server, wherein the current onboard hard disk information file includes information of each onboard hard disk on the current server; the information of any onboard hard disk includes at least: an identifier of the onboard hard disk.
[0037] As an embodiment, the information of any onboard hard disk includes at least one of the following in addition to the identifier of the onboard hard disk (the physical slot number of the onboard hard disk):
[0038] BIOS number, onboard hard disk model, onboard hard disk firmware version, onboard hard disk capacity, onboard hard disk speed, onboard hard disk type, and onboard hard disk serial number.
[0039] In this embodiment, how the BIOS in the above step S201 obtains the current onboard hard disk information file, and how the BMC obtains the information of each onboard hard disk after obtaining the current onboard hard disk information file from the BIOS will be explained in the following text in the form of specific embodiments and will not be repeated here.
[0040] S103, by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk included in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty. Wherein, by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk included in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty includes at least one of the following situations: for each onboard hard disk identification obtained, if the identification of the onboard hard disk in place is not found from the identifications of each onboard hard disk included in the current onboard hard disk information file, then outputting a first fault indication, the first fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk in place has a hard disk missing fault; for each onboard hard disk identification included in the current onboard hard disk information file, if the identification of the onboard hard disk is not found from the identification of the currently in-place onboard hard disk, then outputting a second fault indication, the second fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk has a device unavailable DeviceDisable fault.
[0041] In this embodiment, the identifier of the onboard hard disk currently in place on the server read by the I2C bus explains which onboard hard disks are located in the correct physical slots from the perspective of hardware connection. The current onboard hard disk information file sent by the BIOS explains the operating status of each onboard hard disk. By comparing the two, it is possible to accurately analyze whether the onboard hard disk is faulty.
[0042] In this embodiment, the specific implementation of the above step S103 will be described in detail later in the form of a specific embodiment, which will not be described here in detail.
[0043] So far, completed Figure 1 The process shown.
[0044] pass Figure 1 As can be seen from the process shown, in this embodiment, by obtaining the identifier of the onboard hard disk currently in place on the server read through the I2C bus on the server, obtaining the current onboard hard disk information file transmitted by the BIOS on the server (the current onboard hard disk information file contains the information of each onboard hard disk on the current server), and comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file, it is detected whether the onboard hard disk of the server has a hard disk missing fault and / or a device unavailable Device Disable fault. This method of fault detection without relying on the memory card to transmit out-of-band information can perform fault detection on an onboard hard disk that is not connected to a memory card. In this way, the detection of the onboard hard board is realized, so that an alarm is issued in time when the onboard hard disk fails, thereby prompting the user to troubleshoot in time and then quickly restore business.
[0045] The following describes in detail how the BIOS obtains the current onboard hard disk information file, and how the BMC obtains the information of each onboard hard disk after obtaining the current onboard hard disk information file from the BIOS:
[0046] See also Figure 2 , Figure 2 A flowchart for obtaining the current onboard hard disk information file provided in an embodiment of the present application.
[0047] like Figure 2 As shown, the process includes the following steps:
[0048] S201, 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, where the backplane configuration information is used to indicate the corresponding relationship between each onboard 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 parsing the corresponding relationship in the backplane configuration information in the first json file, and after the BIOS enters the setup completion state from the setup state for the first time, the first json file is updated based on the currently obtained onboard hard disk information to obtain an initial onboard hard disk information file.
[0050] In this embodiment, in order to ensure that the BIOS can correctly identify and manage all onboard hard disks, before the BIOS enters the startup setup state for the first time on the server, the backplane configuration is parsed through the hardware connection (that is, through the backplane configuration directly connected to the platform path controller (Platform Controller Hub, PCH) to obtain the correspondence between each onboard hard disk and the identifier. The correspondence is then passed to the BIOS in the form of 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 onboard hard disk, and after the BIOS enters the setup completion state from the setup state for the first time, the information of each onboard 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 onboard hard disk information file.
[0051] For example, if Figure 3As shown, before the BIOS enters the startup setup state for the first time, the BMC obtains the backplane configuration of the directly connected platform path controller (Platform Controller Hub, PCH). Through the backplane configuration and the hard disk slot distribution rules, the hard disk slot distribution information can be obtained. For models that are not compatible with the general rules, the hard disk slot distribution configuration information is written separately in XML for adaptation. The hard disk slot distribution information is written into a json file and passed to the BIOS. The BIOS can parse the hard disk slot distribution information to obtain the corresponding physical slot number. After the BIOS enters the setup completion state from the setup state for the first time, the json file is updated with the information of each onboard hard disk and sent to the BMC.
[0052] S203, starting from the initial onboard hard disk information file, every time the BIOS on the server changes from the startup setup state to the setup completion state, and every specified time period, the BIOS updates the previous current onboard hard disk information file based on the information of each backplane disk currently obtained to obtain the latest onboard hard disk information file.
[0053] In this embodiment, the BIOS will update the last onboard hard disk information file at each update time point to obtain the latest version of the onboard hard disk information file. Each update time point refers to each time when the BIOS on the server changes from the startup setup state to the setup completion state, and each time point at intervals of a specified time period.
[0054] It should be noted that, here, the time interval for updating the onboard hard disk information file may be the same as the time interval for the BMC to obtain the identifier of the currently located onboard hard disk through the I2C bus in the above step S101.
[0055] The above describes in detail how BIOS obtains the current onboard hard disk information file. After BMC obtains the current onboard hard disk information file from BIOS, it describes how to obtain the information of each onboard hard disk:
[0056] As an embodiment, the BMC may obtain the information in the / var / BiosPush / BiosBeforeBoot.json file, and the BMC copies the file to / mnt / sdmmc0p4 / bios / BiosBeforeBoot.json.
[0057] The information of each onboard hard disk is located in the "OnBoardSataInfo" field in the json file. The specific information fields are as follows:
[0058] "PhySlot":Front1——————————————————hard disk physical slot
[0059] "LogSlot":1————————————————————Bios number
[0060] "Model":"INTEL SSDSC2KB240G7"————————Hard disk model
[0061] "FwVersion":"SCV10121"————————————Hard disk firmware version
[0062] "Capacity":"240.0GB——————————————Hard disk capacity
[0063] "Speed":"6.0Gbps————————————————Hard disk speed
[0064] "Type":"SSD"————————————————— Hard disk type
[0065] "SerialNumber":"PHLF725200RL2P0HGN"——————hard disk serial number
[0066] Through the above method, BMC obtains the information of each onboard hard disk on the current server.
[0067] As an embodiment, after obtaining the information of each onboard hard disk, in order to facilitate comparison with the identifier of the previous onboard hard disk read via the I2C bus, the identifier of the currently onboard hard disk read by the I2C bus will be stored in a global variable, and the information of each onboard hard disk will be stored in database A. Then, the identifier of the currently onboard hard disk is obtained from the global variable and database A and compared with the identifier in the onboard hard disk information.
[0068] Furthermore, after database A is written, the obtained onboard hard disk information is processed and converted into structure data for the API interface, and the structure is stored in database B corresponding to the AIP interface. When the API interface is called, the onboard hard disk information is obtained from database B.
[0069] The above describes in detail how the BIOS obtains the current onboard hard disk information file, and how the BMC obtains the information of each onboard hard disk after obtaining the current onboard hard disk information file from the BIOS.
[0070] The following is a detailed description of the above-mentioned detection of whether the onboard hard disk of the server is faulty (i.e., the above-mentioned step S103) by comparing the obtained identification of the currently in-place onboard hard disk and the identification of each onboard hard disk contained in the current onboard hard disk information file:
[0071] There are many specific implementation methods of the above-mentioned step S103. For example, as an embodiment, for each onboard hard disk that has been identified, if the identification of the onboard hard disk in place is not found from the identifications of each onboard hard disk contained in the current onboard hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk in place has a missing hard disk fault.
[0072] If the identifier of the onboard hard disk in place is found from the identifiers of the onboard hard disks included in the current onboard hard disk information file, the onboard hard disk in place log represented by the identifier of the onboard hard disk in place is output.
[0073] As another embodiment, for the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a Device Disable fault.
[0074] If the identifier of the onboard hard disk is not found from the identifiers of the currently onboard hard disks, the on-board hard disk presence log represented by the identifier of the onboard hard disk is output.
[0075] As another embodiment, with respect to the identification of each onboard hard disk in place that has been obtained, if the identification of the onboard hard disk in place is not found from the identifications of each onboard hard disk contained in the current onboard hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk in place has a missing hard disk fault.
[0076] If the identifier of the onboard hard disk in place is found from the identifiers of the onboard hard disks included in the current onboard hard disk information file, the onboard hard disk in place log represented by the identifier of the onboard hard disk in place is output.
[0077] For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a Device Disable fault.
[0078] If the identifier of the onboard hard disk is not found from the identifiers of the currently onboard hard disks, the on-board hard disk presence log represented by the identifier of the onboard hard disk is output.
[0079] The above describes in detail the method of detecting whether the onboard hard disk of the server is faulty by comparing the obtained identification of the currently in-place onboard hard disk with the identifications of each onboard hard disk contained in the current onboard hard disk information file.
[0080] In order to explain the method provided by the present application in more detail, the following Figure 4 The solution provided in this application is described in more detail by way of specific embodiments.
[0081] In this embodiment, the identification of the onboard hard disk is represented by the physical slot number of the onboard hard disk.
[0082] Combination Figure 4 As shown, the process includes the following steps:
[0083] 1. When the server is running normally, the backplane CPLD is read through I2C to obtain the on-board hard disk presence information, and the physical slot number of the on-board hard disk in place is stored in the global variable A.
[0084] 2. BIOS passes BiosBeforeBoot.json to BMC. BMC reads all onboard hard disk information in the json file and stores it in database B.
[0085] 3. Compare the physical slot number of each onboard hard disk in the global variable A with all the physical disk slot numbers of the onboard hard disks in the database B:
[0086] (1) If the physical slot number can be found in database B, it proves that the onboard hard disk corresponding to the physical slot number can be obtained normally. Except for the onboard hard disk in place log, no other logs are reported, that is, no alarm is issued.
[0087] (2) If the physical slot number cannot be found in database B, it means that the detailed information of the onboard hard disk corresponding to the physical slot number cannot be obtained. In addition to the onboard hard disk presence log, it is necessary to report missing and associate it with Drive Fault.
[0088] 4. Compare the physical disk slot number of each onboard hard disk in database B with the physical slot numbers of all onboard hard disks in global variable A;
[0089] (1) If the physical slot number is found in the global variable A, it proves that the onboard hard disk can be obtained normally. Except for the onboard hard disk in place log, no other logs are reported, that is, no alarm is issued.
[0090] (2) If the physical slot number cannot be found in the global variable A, it means that the BIOS has recognized the onboard hard disk but the CPLD has not. An unavailable alarm is reported and the reported log is: Device Disable: The disk information notobtained.
[0091] The method provided in the embodiment of the present application is described above. The device provided in the embodiment of the present application is described below:
[0092] See also Figure 5 , Figure 5 This is a diagram of the device structure provided in the embodiment of the present application. Figure 5 As shown, the device includes: a first obtaining module 501, a second obtaining module 502 and a detection module 503.
[0093] The first obtaining module 501 is used to obtain the identifier of the onboard hard disk currently in the server read through the I2C bus on the server;
[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 the information of each onboard hard disk on the current server; the information of any onboard hard disk at least includes: the identification of the onboard hard disk;
[0095] The detection module 503 is used to detect whether the onboard hard disk of the server is faulty by comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk included in the current onboard hard disk information file; wherein, by comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk included in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty includes at least one of the following situations: for each onboard hard disk identifier obtained in place, if the identifier of the onboard hard disk in place is not found from the identifiers of each onboard hard disk included in the current onboard hard disk information file, a first fault indication is output, and the first fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk in place has a hard disk missing fault; for each onboard hard disk identifier included in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifier of the currently in-place onboard hard disk, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a device disabled fault.
[0096] In this embodiment, by obtaining the identifier of the onboard hard disk currently in place on the server read through the I2C bus on the server, obtaining the current onboard hard disk information file transmitted by the BIOS on the server (the current onboard hard disk information file contains the information of each onboard hard disk on the current server), and comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file, it is detected whether the onboard hard disk of the server has a hard disk missing fault and / or a device unavailable Device Disable fault. This method of fault detection without relying on the memory card to transmit out-of-band information can perform fault detection on an onboard hard disk that is not connected to a memory card. In this way, the detection of the onboard hard board is realized, so that an alarm is issued in time when the onboard hard disk fails, thereby prompting the user to troubleshoot in time and then quickly restore business.
[0097] As an example,
[0098] By comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty also includes:
[0099] For each onboard hard disk identification that has been obtained, if the onboard hard disk identification of the onboard hard disk in place is found from the identifications of the onboard hard disks included in the current onboard hard disk information file, then the onboard hard disk in place log is output;
[0100] For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, the in-place log of the onboard hard disk is output.
[0101] As an embodiment, obtaining the identifier of the onboard hard disk currently in the server read through the I2C bus on the server includes:
[0102] The hard disk presence information of each onboard hard disk is obtained by reading the complex programmable logic device CPLD of the backplane of the server through the I2C bus; the hard disk presence information of any onboard hard disk at least includes the identification of the onboard hard disk in place, the identification of the onboard hard disk absent, the identification of the onboard hard disk offline, and the identification of the onboard hard disk in the preheating state;
[0103] The identifier of the currently located onboard hard disk is obtained from the hard disk location information of each onboard hard disk.
[0104] As an embodiment, the current onboard 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, the backplane configuration information is obtained from the main logic register. The backplane configuration information is used to indicate the corresponding relationship between each onboard hard disk and the identifier on the backplane;
[0106] 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 corresponding relationship in the backplane configuration information parsed in the first json file, and after the BIOS enters the setup completed state from the setup state for the first time, update the first json file based on the currently obtained onboard hard disk information to obtain an initial onboard hard disk information file;
[0107] Starting from the initial onboard hard disk information file, every time the BIOS on the server changes from the startup setup state to the setup completion state, and every specified time period, the BIOS updates the previous current onboard hard disk information file based on the currently obtained information of each backplane disk to obtain the latest onboard hard disk information file.
[0108] As an embodiment, the information of any onboard hard disk further includes at least one of the following:
[0109] BIOS number, onboard hard disk model, onboard hard disk firmware version, onboard hard disk capacity, onboard hard disk speed, onboard hard disk type, and onboard hard disk serial number.
[0110] So far, completed Figure 5 Structural description of the device shown.
[0111] See also Figure 6 , Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0112] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.
[0113] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.
[0114] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for detecting a fault of an onboard hard disk of a server, characterized in that: The method comprises: Obtaining an identification of an onboard hard disk currently in place on the server read via an I2C bus on the server; Obtaining a current onboard hard disk information file transmitted by the BIOS on the server, wherein the current onboard hard disk information file contains information about each onboard hard disk on the server; the information about any onboard hard disk at least includes an identifier of the onboard hard disk; By comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file, detecting whether the onboard hard disk of the server is faulty; The detecting whether the onboard hard disk of the server is faulty by comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file includes at least one of the following situations: For each onboard hard disk identification that has been obtained, if the identification of the onboard hard disk in place is not found from the identifications of each onboard hard disk included in the current onboard hard disk information file, a first fault indication is output, where the first fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk in place has a hard disk missing fault; For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a Device Disable fault.
2. The method according to claim 1, characterized in that The detecting whether the onboard hard disk of the server is faulty by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file further comprises: For each onboard hard disk identification that has been obtained, if the onboard hard disk identification of the onboard hard disk in place is found from the identifications of the onboard hard disks included in the current onboard hard disk information file, then the onboard hard disk in place log is output; For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, the in-place log of the onboard hard disk is output.
3. The method according to claim 1, characterized in that The obtaining of the identifier of the onboard hard disk currently in place on the server read through the I2C bus on the server comprises: The hard disk presence information of each onboard hard disk is obtained by reading the backplane complex programmable logic device CPLD of the server through the I2C bus; the hard disk presence information of any onboard hard disk at least includes the identification of the onboard hard disk in place, the identification of the absent onboard hard disk, the identification of the offline onboard hard disk, and the identification of the onboard hard disk in the preheating state; The identifier of the currently located onboard hard disk is obtained from the hard disk location information of each onboard hard disk.
4. The method according to claim 1, characterized in that The current onboard hard disk information file is obtained by the following steps: Before the BIOS on the server enters the startup setup state for the first time, obtaining backplane configuration information from the main logic register, wherein the backplane configuration information is used to indicate the corresponding relationship between each onboard hard disk and the identifier 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 corresponding relationship in the backplane configuration information parsed in the first json file, and after the BIOS enters the setup completed state from the setup state for the first time, updating the first json file based on the currently obtained onboard hard disk information to obtain an initial onboard hard disk information file; Starting from the initial onboard hard disk information file, every time the BIOS on the server changes from the startup setup state to the setup completion state, and every specified time period, the BIOS updates the previous current onboard hard disk information file based on the information of each backplane disk currently obtained to obtain the latest onboard hard disk information file.
5. The method according to claim 1, characterized in that The information of any onboard hard disk also includes at least one of the following: BIOS number, onboard hard disk model, onboard hard disk firmware version, onboard hard disk capacity, onboard hard disk speed, onboard hard disk type, and onboard hard disk serial number.
6. A device for detecting a fault of an onboard hard disk used in a server, characterized in that: The device comprises: A first obtaining module is used to obtain an identification of an onboard hard disk currently in place on the server read through an I2C bus on the server; The second obtaining module is used to obtain the current onboard hard disk information file transmitted by the BIOS on the server, wherein the current onboard hard disk information file contains information about each onboard hard disk on the server; the information about any onboard hard disk at least includes: an identifier of the onboard hard disk; A detection module, used to detect whether the onboard hard disk of the server is faulty by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file; The detecting whether the onboard hard disk of the server is faulty by comparing the obtained identifier of the currently in-place onboard hard disk with the identifiers of each onboard hard disk contained in the current onboard hard disk information file includes at least one of the following situations: For each onboard hard disk identification that has been obtained, if the identification of the onboard hard disk in place is not found from the identifications of each onboard hard disk included in the current onboard hard disk information file, a first fault indication is output, where the first fault indication is used to indicate that the onboard hard disk represented by the identification of the onboard hard disk in place has a hard disk missing fault; For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, a second fault indication is output, and the second fault indication is used to indicate that the onboard hard disk represented by the identifier of the onboard hard disk has a Device Disable fault.
7. The device according to claim 6, characterized in that The detecting whether the onboard hard disk of the server is faulty by comparing the obtained identification of the currently in-place onboard hard disk with the identification of each onboard hard disk contained in the current onboard hard disk information file further comprises: For each onboard hard disk identification that has been obtained, if the onboard hard disk identification of the onboard hard disk in place is found from the identifications of the onboard hard disks included in the current onboard hard disk information file, then the onboard hard disk in place log is output; For the identifier of each onboard hard disk contained in the current onboard hard disk information file, if the identifier of the onboard hard disk is not found from the identifiers of the currently in-place onboard hard disks, the in-place log of the onboard hard disk is output.
8. The device according to claim 6, characterized in that The obtaining of the identifier of the onboard hard disk currently in place on the server read through the I2C bus on the server comprises: The hard disk presence information of each onboard hard disk is obtained by reading the backplane complex programmable logic device CPLD of the server through the I2C bus; the hard disk presence information of any onboard hard disk at least includes the identification of the onboard hard disk in place, the identification of the absent onboard hard disk, the identification of the offline onboard hard disk, and the identification of the onboard hard disk in the preheating state; Obtaining the identification of the currently located onboard hard disk from the hard disk location information of each onboard hard disk; and / or, The current onboard hard disk information file is obtained by the following steps: Before the BIOS on the server enters the startup setup state for the first time, obtaining backplane configuration information from the main logic register, wherein the backplane configuration information is used to indicate the corresponding relationship between each onboard hard disk and the identifier 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 corresponding relationship in the backplane configuration information parsed in the first json file, and after the BIOS enters the setup completed state from the setup state for the first time, updating the first json file based on the currently obtained onboard hard disk information to obtain an initial onboard hard disk information file; Starting from the initial onboard hard disk information file, whenever the BIOS on the server changes from the startup setup state to the setup completion state, and at every specified time interval, the BIOS updates the last current onboard hard disk information file based on the currently obtained information of each backplane disk to obtain the latest onboard hard disk information file; and / or, The information of any onboard hard disk also includes at least one of the following: BIOS number, onboard hard disk model, onboard hard disk firmware version, onboard hard disk capacity, onboard hard disk speed, onboard hard disk type, and onboard hard disk serial number.
9. An electronic device, characterized in that: The electronic device includes: Processor; and A computer-readable storage medium having computer program instructions stored therein, wherein the computer program instructions, when executed by the processor, cause the processor to perform the steps of the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the steps of any one of the methods of claims 1 to 5.
Citation Information
Patent Citations
Method and device for generating hard disk physical position in BIOS
CN111209174A
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
Hard disk backboard detection method and device, computer equipment and storage medium
CN118394581A
Single-root input / output virtualization-based storage solution for software defined storage
US11100033B1