Detection and Handling Methods, Devices and Media for System Disk Abnormalities under RAID
By detecting the RAID and disk status and closing the abnormal link, the problem of system read-only failure caused by RAID system disk exception is solved, and the stability of the system is improved.
Patent Information
- Application Number
- CN202210760962.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2042-06-30
AI Technical Summary
An abnormal RAID system disk causes the system to enter read-only failure, affecting system stability.
By detecting the status of RAID and disk, obtaining the status detection results, and closing the transmission data link of RAID when an abnormality is detected to prevent the system from accessing the abnormal disk.
Effectively prevent system read-only failure caused by RAID system disk abnormalities, and improve system stability and reliability.
Smart Images

Figure CN115061849B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and particularly to a method, device, and medium for detecting and handling system disk anomalies under RAID. Background Art
[0002] Redundant Arrays of Independent Drives (RAID) is a technology that combines multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance than a single hard disk and providing data backup. To ensure the high performance and data security of the system disk, we usually use two disks to form a RAID and use this RAID as the system disk.
[0003] Although RAID ensures the high performance of the system disk and the security of the data stored on the disk, once one of the disks fails, to ensure data security, RAID will downgrade from the read-write mode to the read-only mode. At this time, when the system accesses the system disk again, write operations will be rejected. Being in this state for a long time will cause the system to enter an unstable state, resulting in increased memory, increased system load, and even system crashes and restarts.
[0004] Therefore, it can be seen that how to prevent the system disk anomaly under RAID from causing the system to enter the read-only failure and improve the stability of the system is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] The purpose of the present application is to provide a method, device, and medium for detecting and handling system disk anomalies under RAID, which are used to prevent the system disk anomaly under RAID from causing the system to enter the read-only failure and improve the stability of the system.
[0006] To solve the above technical problems, the present application provides a method for detecting and handling system disk anomalies under RAID, including:
[0007] Obtain the current RAID, the disks that make up the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each of the disks;
[0008] Detect the status of the current RAID and the status of the disks respectively;
[0009] Obtain the detection result of the status of the current RAID and the detection result of the status of the disks;
[0010] In the case where the detection result of the status of the current RAID and / or the detection result of the status of the disk is abnormal, close the data transmission link of the current RAID.
[0011] Preferably, detecting the status of the disk includes:
[0012] Obtain the number of data transmission links of the current RAID and the SMART information of the disk;
[0013] Detect the status of the disk according to the number of data transmission links of the current RAID and the SMART information of the disk.
[0014] Preferably, in the case where the detection result of the status of the disk is abnormal, closing the data transmission link of the current RAID includes:
[0015] Judge whether the number of data transmission links of the current RAID is a preset value; wherein, the preset value is determined according to the number of disks constituting the current RAID;
[0016] If not, determine that the detection result of the status of the disk is abnormal and close the data transmission link of the current RAID;
[0017] If so, obtain the SMART information of the disk; in the case where the number of disks corresponding to the SMART information is the preset value, judge whether the SMART information is correct; if the SMART information is abnormal, determine that the detection result of the status of the disk is abnormal and close the data transmission link of the disk corresponding to the abnormal SMART information; in the case where the number of disks corresponding to the SMART information is not the preset value, determine that the detection result of the status of the disk is abnormal and close the data transmission link of the disk corresponding to the unobtained SMART information.
[0018] Preferably, in the case where the detection result of the status of the current RAID is abnormal, closing the data transmission link of the current RAID includes:
[0019] In the case where the detection result of the status of the current RAID is abnormal, obtain the abnormal disks in the current RAID;
[0020] Close the data transmission links of the abnormal disks.
[0021] Preferably, the separate detection of the status of the current RAID and the status of the disk includes:
[0022] Detect the status of the disk;
[0023] When the detection result of the state of the disk is normal, detect the state of the current RAID.
[0024] Preferably, when the detection result of the state of the current RAID is normal, the method further includes:
[0025] Since it is determined that the detection result of the state of the current RAID is normal, return to the steps of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID within a first preset time.
[0026] When the detection result of the state of the disk is abnormal, after closing the link for transmitting data of the current RAID, the method further includes:
[0027] Since the link for transmitting data of the current RAID is closed, return to the steps of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID within a second preset time.
[0028] Preferably, after closing the link for transmitting data of the current RAID, it further includes:
[0029] Output information for prompting that the current RAID is abnormal.
[0030] To solve the above technical problems, the present application further provides a detection and processing device for system disk abnormality under RAID, including:
[0031] A first acquisition module for acquiring the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each of the disks.
[0032] A detection module for respectively detecting the state of the current RAID and the state of the disk.
[0033] A second acquisition module for acquiring the detection result of the state of the current RAID and the detection result of the state of the disk.
[0034] A closing module for closing the link for transmitting data of the current RAID when the detection result of the state of the current RAID and / or the detection result of the state of the disk is abnormal.
[0035] To solve the above technical problems, the present application further provides a detection and processing device for system disk abnormality under RAID, including:
[0036] A memory for storing a computer program;
[0037] A processor for implementing the steps of the method for detecting and handling system disk anomalies under RAID when executing the computer program.
[0038] To solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for detecting and handling system disk anomalies under RAID are implemented.
[0039] The method for detecting and handling system disk anomalies under RAID provided by the present application includes: obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each disk; respectively detecting the status of the current RAID and the status of the disks; obtaining the detection result of the status of the current RAID and the detection result of the status of the disks; and closing the link for transmitting data of the current RAID when the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal. In this method, by detecting the status of the RAID and the status of the disks, when an anomaly is detected, the link for transmitting data of the current RAID is closed, so that the system no longer accesses the abnormal disks under the RAID, thereby preventing the system disk anomaly under the RAID from causing the system to enter a read-only failure and improving the stability of the system.
[0040] In addition, the present application also provides a device for detecting and handling system disk anomalies under RAID and a computer-readable storage medium, which have the same or corresponding technical features as the method for detecting and handling system disk anomalies under RAID mentioned above, and the effects are the same. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0042] Figure 1 It is a flowchart of a method for detecting and handling system disk anomalies under RAID provided by an embodiment of the present application;
[0043] Figure 2 It is a flowchart of a method for detecting and handling disk status provided by an embodiment of the present application;
[0044] Figure 3Flowchart of a RAID status detection and processing method provided by an embodiment of the present application;
[0045] Figure 4 Structural diagram of a detection and processing device for system disk anomalies under RAID provided by an embodiment of the present application;
[0046] Figure 5 Structural diagram of a detection and processing device for system disk anomalies under RAID provided by another embodiment of the present application;
[0047] Figure 6 Flowchart of a method for preventing the system from entering a read-only failure due to system disk anomalies under RAID provided by an embodiment of the present application. Detailed implementation manners
[0048] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0049] The core of the present application is to provide a method, device, and medium for detecting and processing system disk anomalies under RAID, which are used to prevent the system from entering a read-only failure due to system disk anomalies under RAID and improve the stability of the system.
[0050] RAID is a technology that combines multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance than a single hard disk and providing data backup. To ensure the high performance and data security of the system disk, we usually use two disks to form a RAID and use this RAID as the system disk. In practice, more than two disks can be used to form a RAID.
[0051] To enable those skilled in the art to better understand the solutions of the present application, the following further detailed description of the present application will be provided in conjunction with the accompanying drawings and specific implementation manners. Figure 1 Flowchart of a method for detecting and processing system disk anomalies under RAID provided by an embodiment of the present application for the present application, as Figure 1 shown, the method includes:
[0052] S10: Obtain the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each disk.
[0053] In order to detect the abnormality of the system disk under RAID, it is necessary to first obtain the current RAID, the disks that make up the current RAID, and the link for transmitting data of the current RAID. For example, if the current RAID is composed of two disks and the link for transmitting data of the current RAID includes the data transmission links of the two disks, then when the two disks form the current RAID, the number of outgoing data links of the current RAID is 2, that is, the maximum number of links for transmitting data of the current RAID is equal to the number of disks that make up the current RAID.
[0054] S11: Detect the status of the current RAID and the status of the disks respectively.
[0055] S12: Obtain the detection results of the status of the current RAID and the detection results of the status of the disks.
[0056] To detect the status of the current RAID, it is usually done by judging whether the RAID has degraded (such as one of the disks that make up the current RAID is damaged). When it is determined that the RAID has degraded, it means that the detection result of the status of the current RAID is abnormal. When detecting the status of the disks, it usually includes detecting the link for transmitting data of the current RAID, the SMART information of the disks, whether the SMART information is abnormal, etc. When any one of them is abnormal, it can be determined that the detection result of the status of the disks is abnormal. Specifically, when the number of links for transmitting data of the current RAID is less than the number of disks that make up the current RAID, it is determined that the disk is abnormal; when the SMART information of the disk is not obtained, it is determined that the status of the disk is abnormal; although the SMART information of the disk is obtained, if the SMART information is not correct, it is still determined that the status of the disk is abnormal.
[0057] S13: When the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal, close the link for transmitting data of the current RAID.
[0058] In order to prevent the system from entering the read-only failure due to the abnormality of the system disk under RAID, in practice, when the detection result of the status of the current RAID is abnormal, the detection result of the status of the disks is abnormal, or the detection results of the status of the current RAID and the status of the disks are both abnormal, the link for transmitting data of the current RAID can be closed.
[0059] The method for detecting and handling system disk anomalies under RAID provided in this embodiment includes: obtaining the current RAID, the disks that make up the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each disk; detecting the status of the current RAID and the status of the disks respectively; obtaining the detection result of the status of the current RAID and the detection result of the status of the disks; and closing the link for transmitting data of the current RAID when the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal. In this method, by detecting the status of the RAID and the status of the disks, and closing the link for transmitting data of the current RAID when an anomaly is detected, the system no longer accesses the abnormal disks under the RAID, thereby preventing the system from entering a read-only failure due to system disk anomalies under the RAID and improving the stability of the system.
[0060] In implementation, to make the detection of the disk status more accurate, a preferred implementation is that detecting the status of the disk includes:
[0061] obtaining the number of links for transmitting data of the current RAID and the SMART information of the disks;
[0062] detecting the status of the disks based on the number of links for transmitting data of the current RAID and the SMART information of the disks.
[0063] It is possible to determine whether the status of the disks is abnormal by detecting any one of the link for transmitting data of the current RAID, the SMART information of the disks, and the accuracy of the SMART information. For example, if only the link for transmitting data of the current RAID is normal, it is determined that the detection result of the disk status is normal. However, in fact, there may be a situation where the SMART information of the disks cannot be obtained. Therefore, if it is not further determined whether the SMART information of the disks can be obtained normally, the data transmission link of the disks for which the SMART information cannot be obtained cannot be closed, and it will still cause the system to enter a read-only failure due to system disk anomalies under the RAID. Therefore, in this embodiment, the status of the disks is detected based on the number of links for transmitting data of the current RAID and the SMART information of the disks.
[0064] The method provided in this embodiment for detecting the status of the disks based on the number of links for transmitting data of the current RAID and the SMART information of the disks can detect the status of the disks more accurately compared to the method of judging the status of the disks solely relying on the number of links for transmitting data of the current RAID or the SMART information of the disks.
[0065] In the above embodiments, the status of the disk is detected. In the case where the disk status is detected as abnormal, the abnormality needs to be processed. To prevent the system disk from being abnormal under RAID from causing the system to enter a read-only failure, a preferred implementation is that when the detection result of the disk status is abnormal, closing the data transmission link of the current RAID includes:
[0066] Determine whether the number of data transmission links of the current RAID is a preset value; where the preset value is determined according to the number of disks that make up the current RAID;
[0067] If not, then determine that the detection result of the disk status is abnormal, and close the data transmission link of the current RAID;
[0068] If so, obtain the SMART information of the disk; when the number of disks corresponding to the SMART information is the preset value, determine whether the SMART information is correct; if the SMART information is abnormal, then determine that the detection result of the disk status is abnormal, and close the data transmission link of the disk corresponding to the abnormal SMART information; when the number of disks corresponding to the SMART information is not the preset value, then determine that the detection result of the disk status is abnormal, and close the data transmission link of the disk corresponding to the unobtained SMART information.
[0069] Taking the current RAID composed of two disks as an example, illustrate the detection process of the disk status. Figure 2 It is a flowchart of a disk status detection and processing method provided by an embodiment of the present application. As Figure 2 shown, the method includes:
[0070] S14: Determine whether the number of data transmission links of the current RAID is 2; if not, go to step S15; if so, go to step S16;
[0071] S15: Close the data transmission link of the abnormal current RAID;
[0072] S16: Obtain the disk SMART information;
[0073] S17: Determine whether the number of disks that can normally obtain SMART information is 2; if not, go to step S18; if so, go to step S19;
[0074] S18: Close the link corresponding to the disk where the SMART information cannot be found;
[0075] S19: Traverse the disk SMART information;
[0076] S20: Determine whether the SMART information is abnormal; if so, go to step S21:
[0077] S21: Close the link corresponding to the disk with abnormal SMART information.
[0078] It can be seen from Figure 2 that during the process of detecting the disk status, the number of data transmission links of the current RAID, the number of disks that can normally obtain SMART information, and the correctness of the SMART information are respectively judged. When any of these situations is abnormal, the corresponding data transmission link is closed. This makes the system no longer access the abnormal disks under the RAID, thereby preventing the system disk under the RAID from being abnormal and causing the system to enter a read-only failure, and improving the stability of the system.
[0079] In implementation, it may occur that a few disks constituting the RAID fail, resulting in an abnormal detection result of the current RAID status. At this time, if all the data transmission links of the disks of the current RAID are closed, it may cause the normal disks in the RAID to be unusable. Therefore, the preferred implementation is that when the detection result of the current RAID status is abnormal, closing the data transmission link of the current RAID includes:
[0080] When the detection result of the current RAID status is abnormal, obtain the abnormal disks in the current RAID;
[0081] Close the data transmission links of the abnormal disks.
[0082] Figure 3 This is a flowchart of a RAID status detection and processing method provided by an embodiment of the present application.
[0083] As Figure 3 shown, the method includes:
[0084] S22: Judge whether the RAID is degraded; if so, go to step S23;
[0085] S23: Close the link corresponding to the abnormal disk of the RAID.
[0086] RAID degradation means that there is a disk failure in the RAID. When the status of the RAID is degraded, it is considered that the detection result of the RAID status is abnormal. In order to ensure that the undamaged disks in the RAID can work normally, in this embodiment, the abnormal disks in the RAID are found, and then only the data transmission links corresponding to the abnormal disks are closed. For example, when the number of disks constituting the RAID is large and only one disk fails, when all the data transmission links of the disks constituting the RAID are closed, a large number of read and write requests will pile up and cannot be completed. However, when only the link corresponding to the failed disk is closed, it can be ensured as much as possible that the data transmission links of the normal disks can still transmit data, ensuring the stability of the system.
[0087] The specific process of detecting the status of the current RAID and the status of the disks is described above. In implementation, the order of detecting the status of the current RAID and the status of the disks is not limited. However, since a RAID is composed of multiple disks, a preferred implementation is that detecting the status of the current RAID and the status of the disks respectively includes:
[0088] Detect the status of the disks;
[0089] When the detection result of the status of the disks is normal, detect the status of the current RAID.
[0090] In this embodiment, first detect the status of the disks, and when the status of the disks is normal, detect the status of the RAID. On the one hand, since a RAID is composed of multiple disks, detecting the status of the disks first can ensure that the RAID may be normal only when the disk status is normal. If the disk status is abnormal, the RAID must be abnormal, so there is no need to detect the RAID status anymore. Therefore, preferentially detecting the status of the disks can timely close the corresponding data transmission link for abnormal disks and improve the efficiency of fault handling; on the other hand, the process of detecting the status of the disks in the above embodiment includes detecting the data transmission link of the current RAID, the SMART information of the disks, and the accuracy of the SMART information, while the detection of the status of the current RAID only includes determining whether the RAID has degraded. It can be seen that the method of detecting the status of the disks is more accurate than the method of detecting the status of the RAID, and thus can close the abnormal data transmission link to prevent the system disk under the RAID from being abnormal and causing the system to enter a read-only failure, improving the stability of the system.
[0091] In implementation, in order to be able to detect the RAID in a timely manner, a preferred implementation is that when the detection result of the status of the current RAID is normal, it further includes:
[0092] Starting from when it is determined that the detection result of the status of the current RAID is normal, return to the steps of obtaining the current RAID, the disks constituting the current RAID, and the data transmission link of the current RAID within the first preset time;
[0093] When the detection result of the status of the disks is abnormal, after closing the data transmission link of the current RAID, it further includes:
[0094] Starting from closing the data transmission link of the current RAID, return to the steps of obtaining the current RAID, the disks constituting the current RAID, and the data transmission link of the current RAID within the second preset time.
[0095] The specific values of the first preset time and the second preset time are not limited and are determined according to the actual situation. The magnitudes of the first preset time and the second preset time are not limited, and the first preset time can be less than, equal to, or greater than the second preset time. When the detection result of the current disk status is normal, the RAID status is detected; when the detection result of the current disk status is abnormal, in order to prevent the system disk under the RAID from being abnormal and causing the system to enter a read-only failure, the data transmission link corresponding to the abnormal disk is closed. After that, in order to be able to detect in a timely manner whether the disks under the RAID are faulty, the steps of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID are returned, and the disk status and the RAID status are continuously detected. When the detection result of the current RAID status is normal, in order to be able to detect in a timely manner whether the disks under the RAID are faulty, similarly, the steps of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID are returned; compared with when the detection result of the current RAID status is normal, when the detection result of the current RAID status is abnormal, it is necessary to first close the data transmission link of the current RAID, and then return the steps of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID.
[0096] After a disk under the RAID is detected once in the embodiment provided, the disk under the RAID is detected again after a preset time, so that the status of the RAID and the status of the disks can be understood in a timely manner, and then the abnormal situation can be processed in a timely manner, the corresponding data transmission link is closed, and the system disk under the RAID is prevented from being abnormal and causing the system to enter a read-only failure, thereby improving the stability of the system.
[0097] In implementation, in order to facilitate the user to understand whether the current RAID is faulty, the preferred implementation method is that after closing the data transmission link of the current RAID, it further includes:
[0098] Outputting information for prompting that the current RAID is abnormal.
[0099] The prompting method, the specific content of the prompt information, etc. are not limited and are determined according to the actual situation. For example, the user can be prompted through an alarm method. After closing the data transmission link of the current RAID in the embodiment provided, it further includes: outputting information for prompting that the current RAID is abnormal, so that the user can quickly discover the abnormality, quickly analyze and eliminate the fault, and improve the stability, security, and availability of the system.
[0100] In the above embodiments, the method for detecting and handling system disk anomalies under RAID has been described in detail. The present application also provides corresponding embodiments of the device for detecting and handling system disk anomalies under RAID. It should be noted that the embodiments of the device part of the present application are described from two perspectives, one is from the perspective of functional modules, and the other is from the perspective of hardware.
[0101] Figure 4 The structural diagram of the device for detecting and handling system disk anomalies under RAID provided by an embodiment of the present application. This embodiment is based on the perspective of functional modules and includes:
[0102] The first acquisition module 10 is used to acquire the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each disk;
[0103] The detection module 11 is used to respectively detect the status of the current RAID and the status of the disks;
[0104] The second acquisition module 12 is used to acquire the detection result of the status of the current RAID and the detection result of the status of the disks;
[0105] The shutdown module 13 is used to shut down the link for transmitting data of the current RAID when the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal.
[0106] Since the embodiments of the device part correspond to the embodiments of the method part, for the embodiments of the device part, please refer to the description of the embodiments of the method part, which will not be elaborated here for the time being.
[0107] For the device for detecting and handling system disk anomalies under RAID provided by this embodiment, the first acquisition module is used to acquire the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each disk; the detection module is used to respectively detect the status of the current RAID and the status of the disks; the second acquisition module is used to acquire the detection result of the status of the current RAID and the detection result of the status of the disks; the shutdown module is used to shut down the link for transmitting data of the current RAID when the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal. In this device, by detecting the status of the RAID and the status of the disks, and shutting down the link for transmitting data of the current RAID when an anomaly is detected, the system no longer accesses the abnormal disks under the RAID, thereby preventing the system from entering a read-only failure due to system disk anomalies under RAID and improving the stability of the system.
[0108] Figure 5 The structural diagram of the detection and processing device for system disk anomalies under RAID provided by another embodiment of this application. This embodiment is from the perspective of hardware. For example, Figure 5 As shown, the detection and processing device for system disk anomalies under RAID includes:
[0109] A memory 20 for storing computer programs;
[0110] A processor 21 for implementing the steps of the method for detecting and processing system disk anomalies under RAID as mentioned in the above embodiment when executing the computer program.
[0111] The detection and processing device for system disk anomalies under RAID provided by this embodiment may include but is not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.
[0112] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0113] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may further include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for detecting and handling system disk anomalies under RAID disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the method for detecting and handling system disk anomalies under RAID mentioned above.
[0114] In some embodiments, the device for detecting and handling system disk anomalies under RAID may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0115] Those skilled in the art can understand that Figure 5 the structure shown in does not constitute a limitation on the device for detecting and handling system disk anomalies under RAID, and may include more or fewer components than those shown in the figure.
[0116] The device for detecting and handling system disk anomalies under RAID provided by the embodiments of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the method for detecting and handling system disk anomalies under RAID, and the effect is the same as above.
[0117] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps recorded in the foregoing method embodiments.
[0118] It can be understood that if the methods in the above embodiments are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0119] The computer-readable storage medium provided by this application includes the method for detecting and handling system disk anomalies under the above-mentioned RAID, and the effect is the same.
[0120] To enable those skilled in the art to better understand the technical solution of this application, the following is combined with the attached Figure 6 For a further detailed description of the above-mentioned application of this application, Figure 6 It is a flowchart of a method provided by an embodiment of this application for preventing the system from entering a read-only failure due to system disk anomalies under RAID. As Figure 6 shown, this method includes:
[0121] S24: Obtain the topological relationship of RAID, disk link, and disk;
[0122] S25: Disk status detection;
[0123] S26: Determine whether the link is not closed during the disk status detection; if so, proceed to step S27; if not, proceed to step S30;
[0124] S27: RAID status detection;
[0125] S28: In the case of detecting an abnormal RAID status, close the link and proceed to step S30;
[0126] S29: Detect that the RAID status is normal, and proceed to step S30;
[0127] S30: Wait for 1 minute; and return to step S24.
[0128] The method provided in this embodiment for preventing the system from entering a read-only failure caused by an abnormal system disk under RAID detects the status of the RAID and the status of the disks. In the case of detecting an abnormality, the data transmission link of the current RAID is closed, so that the system no longer accesses the abnormal disks under the RAID, thereby preventing the system from entering a read-only failure caused by an abnormal system disk under RAID and improving the stability of the system.
[0129] The above has introduced in detail the method, device and medium for detecting and processing abnormal system disks under RAID provided in this application. The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0130] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
Claims
1. A method for detecting and handling system disk anomalies under RAID, characterized in that, it includes: Obtain the current RAID, the disks that make up the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each of the disks; Detect the status of the current RAID and the status of the disks respectively; Obtain the detection result of the status of the current RAID and the detection result of the status of the disks; When the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal, close the link for transmitting data of the current RAID; The detecting the status of the disks includes: Obtain the number of links for transmitting data of the current RAID and the SMART information of the disks; Detect the status of the disks according to the number of links for transmitting data of the current RAID and the SMART information of the disks; When the detection result of the status of the disks is abnormal, closing the link for transmitting data of the current RAID includes: Judge whether the number of links for transmitting data of the current RAID is a preset value; wherein, the preset value is determined according to the number of disks that make up the current RAID; If not, determine that the detection result of the status of the disks is abnormal and close the link for transmitting data of the current RAID; If so, obtain the SMART information of the disks; when the number of disks corresponding to the SMART information is the preset value, judge whether the SMART information is correct; if the SMART information is abnormal, determine that the detection result of the status of the disks is abnormal and close the link for transmitting data of the disk corresponding to the abnormal SMART information; when the number of disks corresponding to the SMART information is not the preset value, determine that the detection result of the status of the disks is abnormal and close the link for transmitting data of the disk that does not obtain the SMART information corresponding thereto; When the detection result of the status of the current RAID is abnormal, closing the link for transmitting data of the current RAID includes: When the detection result of the status of the current RAID is abnormal, obtain the abnormal disks in the current RAID; Close the link for transmitting data of the abnormal disks.
2. The method for detecting and handling system disk anomalies under RAID according to claim 1, characterized in that, The detecting the status of the current RAID and the status of the disks respectively includes: Detect the status of the disks; When the detection result of the status of the disks is normal, detect the status of the current RAID.
3. The method for detecting and handling system disk anomalies under RAID according to claim 2, characterized in that, When the detection result of the status of the current RAID is normal, the method further includes: Starting from when the detection result of the status of the current RAID is determined to be normal, within the first preset time, return to the step of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; In the case where the detection result of the status of the disk is abnormal, after closing the link for transmitting data of the current RAID, the method further includes: Starting from when the link for transmitting data of the current RAID is closed, within the second preset time, return to the step of obtaining the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID.
4. The method for detecting and handling system disk abnormality under RAID according to claim 1, characterized in that after closing the link for transmitting data of the current RAID, it further includes: outputting information for prompting the abnormality of the current RAID.
5. A device for detecting and handling system disk abnormality under RAID, characterized in that for implementing the steps of the method for detecting and handling system disk abnormality under RAID according to claim 1, including: A first acquisition module for acquiring the current RAID, the disks constituting the current RAID, and the link for transmitting data of the current RAID; wherein, the link for transmitting data of the current RAID includes the links for transmitting data of each of the disks; A detection module for respectively detecting the status of the current RAID and the status of the disks; A second acquisition module for acquiring the detection result of the status of the current RAID and the detection result of the status of the disks; A closing module for closing the link for transmitting data of the current RAID when the detection result of the status of the current RAID and / or the detection result of the status of the disks is abnormal.
6. A device for detecting and handling system disk abnormality under RAID, characterized in that includes: A memory for storing a computer program; A processor for implementing the steps of the method for detecting and handling system disk abnormality under RAID according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for detecting and handling system disk abnormality under RAID according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Fault remote self-diagnostic device for electric power equipment
CN107588801A
Method, system and equipment for comprehensively detecting system disk and storage medium
CN114281611A