Methods and apparatus for handling abnormal disk partitions
By deploying a detection service module on the host, abnormal disk partitions are automatically detected and processed, solving the problem of low processing efficiency in existing technologies and achieving fast and automatic processing of abnormal disk partitions, reducing manual intervention.
Patent Information
- Application Number
- CN202111547742.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2041-12-16
AI Technical Summary
In existing technologies, the processing efficiency of disk input/output errors caused by abnormal disk partitions is low, mainly relying on manual analysis and troubleshooting, and requiring manual monitoring.
By deploying a detection service module on the host, abnormal disk partitions are detected periodically, and automatic processing is performed based on their generation type, including closing processes, releasing space, unmounting and remounting, and providing feedback on the detection information.
It enables automatic analysis of the types of abnormal disk partitions, reducing manual operations, improving processing efficiency, eliminating potential problems in a timely manner, and ensuring system availability.
Smart Images

Figure CN114237957B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, and more specifically, to a method and apparatus for processing abnormal disk partitions. Background Technology
[0002] Network instability or other factors often cause storage device malfunctions, leading to the inability to read or write disk partitions in the Linux operating system, which manifests as disk input / output errors. Current solutions primarily involve monitoring tools or user-reported issues, followed by manual analysis and troubleshooting. This approach is slow and requires constant monitoring.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a method and apparatus for processing abnormal disk partitions, which at least solves the technical problem that existing solutions mainly rely on monitoring tools or users to discover and report problems, and then manually analyze and troubleshoot them, resulting in slow processing efficiency and the need for manual supervision.
[0005] According to one aspect of the present invention, a method for processing abnormal disk partitions is provided, applied to a host connected to an information collection terminal, the method comprising: detecting abnormal disk partitions of the host; determining the generation type of the abnormal disk partitions; and processing the abnormal disk partitions according to the generation type.
[0006] Optionally, detecting abnormal disk partitions on the host includes: deploying a detection service module on the host as a scheduled task, wherein the detection service module includes an application generated based on a shell script tool; and periodically triggering the detection of the abnormal disk partitions through the detection service module.
[0007] Optionally, determining the generation type of the abnormal disk partition includes: if the abnormal disk partition is generated by a data disk, then the generation type is determined to be a first generation type; if the abnormal disk partition is generated by a system disk, then the generation type is determined to be a second generation type.
[0008] Optionally, processing the abnormal disk partition according to the generation type includes: if the generation type is the first generation type, then closing the process occupying the abnormal disk partition and releasing the space occupied by the abnormal disk partition.
[0009] Optionally, after releasing the space occupied by the abnormal disk partition, the method further includes: unmounting the abnormal disk partition and remounting it after unmounting; performing read / write checks on the remounted abnormal disk partition and feeding back the check information to the information collection terminal.
[0010] Optionally, processing the abnormal disk partition according to the generation type includes: if the generation type is the second generation type, determining whether the abnormal disk partition is mounted to the main directory of the operating system; if the abnormal disk partition is mounted to the main directory of the operating system, the process occupying the abnormal disk partition cannot be closed, and the abnormal disk partition information and processing result information are fed back to the information collection terminal; if the abnormal disk partition is not mounted to the main directory of the operating system, the process occupying the abnormal disk partition is closed.
[0011] Optionally, after processing the abnormal disk partition according to the generation type, the method further includes at least one of the following: controlling the information collection terminal to display host information; controlling the information collection terminal to retrieve the physical storage location of the abnormal host; and controlling the information collection terminal to issue an alarm for the abnormal disk partition.
[0012] According to another aspect of the present invention, an apparatus for processing abnormal disk partitions is also provided, applied to a host connected to an information collection terminal. The apparatus includes: a detection module for detecting abnormal disk partitions of the host; a determination module for determining the generation type of the abnormal disk partition; and a processing module for processing the abnormal disk partition according to the generation type.
[0013] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the abnormal disk partition processing method described in any one of the above.
[0014] According to another aspect of the present invention, a processor is also provided, the processor being configured to run a program, wherein the program, when running, executes the abnormal disk partition processing method described in any of the preceding embodiments.
[0015] In this embodiment of the invention, abnormal disk partitions of the host are detected; the generation type of the abnormal disk partitions is determined; and the abnormal disk partitions are processed according to the generation type. By detecting abnormal disk partitions of the host and processing them according to their generation type, the goal of promptly and proactively analyzing whether the abnormal disk partition is a system disk or a data disk when a problem is discovered is achieved, and automatically matching the pre-defined optimal solution is performed. This reduces manual operation, improves availability in complex environments, and eliminates related anomalies in a timely manner. Furthermore, it solves the technical problem that existing solutions mainly rely on monitoring tools or users to discover and report problems, and then manually analyze and troubleshoot them, which is slow and requires manual supervision. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of a method for handling abnormal disk partitions according to an embodiment of the present invention;
[0018] Figure 2 This is a schematic diagram of a host connected to an information collection terminal according to an embodiment of the present invention;
[0019] Figure 3 This is a schematic diagram of an apparatus for processing abnormal disk partitions according to an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Example 1
[0023] According to an embodiment of the present invention, an embodiment of a method for processing abnormal disk partitions is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0024] Figure 1 This is a flowchart of a method for handling abnormal disk partitions according to an embodiment of the present invention, such as... Figure 1 As shown, this method is applied to a host connected to an information collection terminal and includes the following steps:
[0025] Step S102: Detect abnormal disk partitions on the host;
[0026] Step S104: Determine the generation type of the abnormal disk partition;
[0027] Step S106: Process the abnormal disk partition according to the generation type.
[0028] Through the above steps, abnormal disk partitions on the host can be detected and processed according to their generation type. This achieves the goal of proactively analyzing whether abnormal disk partitions are system disks or data disks upon discovering problems, and automatically matching the pre-defined optimal solution. This reduces manual operation, improves environmental availability, and eliminates related hidden dangers in a timely manner. It also solves the technical problem that existing solutions mainly rely on monitoring tools or users to discover and report problems, and then manually analyze and troubleshoot them, which is slow and requires manual supervision.
[0029] Optionally, detecting abnormal disk partitions on the host includes: deploying a detection service module on the host as a scheduled task, wherein the detection service module includes an application generated based on a shell script tool; and periodically triggering the detection of abnormal disk partitions through the detection service module.
[0030] The aforementioned detection service module can be deployed on an independent partition on the host, separate from other disk partitions. The detection service module detects abnormal disk partitions by triggering them periodically, thereby enabling timely detection of abnormal disk partitions.
[0031] The above scheduled task can be set to occur every 30 minutes, or at other times, or different scheduled detection plans can be set according to different disk partitions.
[0032] The aforementioned detection service module includes applications generated based on shell script tools, such as Bourne shell, C shell, Korn shell, etc. In addition, the aforementioned detection service module can also be an application written in AWK, Perl, Python, etc., without any limitation.
[0033] In practice, various issues can cause disk partitioning, including power failure, loss of CMOS parameters, invalid partition table, corrupted DOS boot record, system stoppage, missing boot sector, unrecognizable hard disk system, hard disk operation timeout, hard disk drive selection failure, hard disk controller failure, missing record, write operation failure, track 0 signal error, head selection signal error, ECC check error, sector buffer overflow during data reading, bad address identifier, unrecognizable error, data comparison error, BIOS not recognizing the hard disk, hard disk self-test failure, and corrupted hard disk partition table. The above methods can quickly and accurately detect abnormal disk partitions.
[0034] Optionally, the generation type of the abnormal disk partition is determined, including: if the abnormal disk partition is generated from a data disk, the generation type is determined to be the first generation type; if the abnormal disk partition is generated from a system disk, the generation type is determined to be the second generation type.
[0035] In one optional implementation, if the abnormal disk partition is generated using the first generation type, it indicates that the abnormal disk partition was generated from the data disk; if the abnormal disk partition is generated using the second generation type, it indicates that the abnormal disk partition was generated from the system disk. This implementation allows for accurate determination of whether the abnormal disk partition was generated from the data disk or the system disk.
[0036] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the first generation type, the process occupying the abnormal disk partition is closed and the space occupied by the abnormal disk partition is released.
[0037] The process of shutting down processes occupying abnormal disk partitions can involve checking disk mount points, root directory mount points, whether any processes are using deleted files, and the parent process. The appropriate action for handling the process occupying the abnormal disk partition is then determined based on the specific circumstances. For example, if a process is found to be using a deleted file, the name of the deleted file is captured from kernel memory and saved as a log. Or, if the parent process exits while one or more child processes are still running, the status of these child processes is collected.
[0038] Optionally, after releasing the space occupied by the abnormal disk partition, the process also includes: unmounting the abnormal disk partition and remounting it after unmounting; performing read / write checks on the remounted abnormal disk partition and feeding the check information back to the information collection terminal.
[0039] The above describes abnormal disk partitions, specifying whether the partitioning method is GPT or MBR. The above describes the read / write testing of abnormal disk partitions after mounting, including but not limited to pure read speed, pure write speed, read / write speed, and read / write volume. This implementation method can detect abnormal disk partitions in advance and automatically handle related issues when abnormal disk partitions are generated from the data disk, reducing tedious and repetitive manual operations.
[0040] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the second generation type, it is determined whether the abnormal disk partition is mounted to the main directory of the operating system; if the abnormal disk partition is mounted to the main directory of the operating system, the process occupying the abnormal disk partition cannot be closed, and the abnormal disk partition information and processing result information are fed back to the information collection end; if the abnormal disk partition is not mounted to the main directory of the operating system, the process occupying the abnormal disk partition is closed.
[0041] The aforementioned main directories include, but are not limited to, device-specific files, system management and configuration files, startup configuration files and scripts, super administrator commands, the system administrator's home directory, and virtual directories.
[0042] In one optional implementation, the generation type is the second generation type, which means the abnormal disk partition is generated from the system disk. First, it needs to be determined whether the abnormal disk partition is mounted to the operating system's main directory. If the abnormal disk partition is mounted to the operating system's main directory, then the process occupying the abnormal disk partition cannot be closed, and the abnormal disk partition information and processing result information need to be fed back to the information collection end. If the abnormal disk partition is not mounted to the operating system's main directory, then the process occupying the abnormal disk partition can be closed directly.
[0043] The above implementation method can detect abnormal disk partitions in advance and automatically handle related issues when abnormal disk partitions are generated by the system disk, reducing tedious and repetitive manual operations.
[0044] Optionally, after processing the abnormal disk partition according to the generation type, the process may include at least one of the following: the control information collection terminal displays host information; the control information collection terminal retrieves the physical storage location of the abnormal host; and the control information collection terminal issues an alarm for the abnormal disk partition.
[0045] The aforementioned host information includes, but is not limited to: motherboard model, hard drive model, power-on time, hard drive read / write cycles, and continuous working time.
[0046] The aforementioned control information collection terminal can retrieve the physical storage location of the abnormal host in at least one of the following ways: retrieve the abnormal host's physical address for corresponding lookup, retrieve the abnormal host's IP address for corresponding lookup, or pre-set a number for the host and retrieve the abnormal host number for corresponding lookup.
[0047] The above-mentioned alarms for abnormal disk partitions include, but are not limited to, audible alarms, pop-up alarms, and light alarms.
[0048] The above implementation method allows the information collection terminal to display host information, detect abnormal hosts and physical storage devices, and promptly issue alarms for abnormal disk partitions, thereby improving the efficiency of problem solving.
[0049] The following is a detailed description of an optional embodiment of the present invention.
[0050] Figure 2 This is a schematic diagram of a host connected to an information collection terminal according to an embodiment of the present invention, as shown below. Figure 2 As shown, this service module is written in shell script and deployed on the Linux controlled host as a cron job. It detects abnormal disk partitions by triggering them on a regular schedule, and handles them automatically. At the same time, it reports the abnormal disk partition information and the processing results to the information collection terminal.
[0051] In current cloud environments, partitions are typically divided into a system disk (sda) and a data disk. Mounted partitions are further categorized into system partitions and application partitions. There are two main methods for creating partitions: one is to directly partition a physical disk by creating a subpartition, and the other is to create an LVM logical volume on the physical disk and then generate an LV partition. The analysis and detection service first analyzes whether the partition was generated from the data disk. If so, it closes the process occupying the partition, releases the disk partition usage, and then unmounts the disk. After successful unmounting, it remounts the partition. After mounting, read / write tests are performed, and the detection information is simultaneously fed back to the information collection end.
[0052] If the abnormal partition is generated from the system disk, it is necessary to analyze whether the partition is the main system directory and determine whether the process can be closed. If it cannot be operated, the relevant information should be fed back to the information collection end.
[0053] The information collection terminal statistically analyzes all information, displays information on hosts that are processing normally and abnormally, retrieves the physical storage location of abnormal hosts, detects abnormal storage in advance, and issues alarms for abnormal information.
[0054] In the above embodiments of the present invention, abnormal hosts and physical storage devices can be detected in advance, and related problems can be handled automatically, reducing tedious and repetitive manual operations. Furthermore, it can proactively detect disk partitions with read / write anomalies on Linux servers, automatically analyze whether the problematic partition is the system disk or the data disk, and resolve related problems according to pre-defined solutions, ensuring system availability.
[0055] Example 2
[0056] According to another aspect of the present invention, an apparatus for processing abnormal disk partitions is also provided, applied to a host connected to an information collection terminal. Figure 3 This is a schematic diagram of an apparatus for processing abnormal disk partitions according to an embodiment of the present invention, such as... Figure 3 As shown, the device for processing abnormal disk partitions includes a detection module 32, a determination module 34, and a processing module 36. The processing device for abnormal disk partitions will be described in detail below.
[0057] The detection module 32 is used to detect abnormal disk partitions of the host; the determination module 34 is connected to the detection module 32 and is used to determine the generation type of the abnormal disk partition; the processing module 36 is connected to the determination module 34 and is used to process the abnormal disk partition according to the generation type.
[0058] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, they can be implemented in the following ways: the above modules can be located in the same processor; and / or, the above modules can be located in different processors in any combination.
[0059] In the above embodiments, the abnormal disk partition processing device can detect abnormal disk partitions of the host and process them according to their generation type. This achieves the goal of proactively analyzing whether the abnormal disk partition is a system disk or a data disk while discovering the problem, and automatically matching the pre-defined optimal solution. This reduces manual operation, improves the availability of the load environment, and eliminates related hidden dangers in a timely manner. It also solves the technical problem that the existing solution mainly relies on monitoring tools or users to discover and report problems, and then manually analyze and troubleshoot them, which is slow and requires manual supervision.
[0060] It should be noted that the detection module 32, the determination module 34 and the processing module 36 mentioned above correspond to steps S102 to S106 in Embodiment 1. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1.
[0061] Optionally, the detection module 32 includes: a deployment unit for deploying the detection service module on the host as a scheduled task, wherein the detection service module includes an application generated based on a shell script tool; and a detection unit for periodically triggering the detection of abnormal disk partitions through the detection service module.
[0062] Optionally, the aforementioned determining module 34 includes: a first determining unit, configured to determine the generation type as a first generation type if the abnormal disk partition is generated by a data disk; and a second determining unit, configured to determine the generation type as a second generation type if the abnormal disk partition is generated by a system disk.
[0063] Optionally, the above processing module 36 includes: a first processing unit, used to close the process occupying the abnormal disk partition and release the space occupied by the abnormal disk partition when the generation type is the first generation type.
[0064] Optionally, the above processing module 36 further includes: a second processing unit, used to unload the abnormal disk partition after releasing the space occupied by the abnormal disk partition, and remount the abnormal disk partition after unloading; and a third processing unit, used to perform read / write detection based on the abnormal disk partition after mounting, and feed back the detection information to the information collection end.
[0065] Optionally, the above processing module 36 includes: a judgment unit, used to determine whether the abnormal disk partition is mounted to the main directory of the operating system when the generation type is the second generation type; a fourth processing unit, used to prevent the process occupying the abnormal disk partition from being closed if the abnormal disk partition is mounted to the main directory of the operating system, and to feed back the abnormal disk partition information and processing result information to the information collection end; and a fifth processing unit, used to close the process occupying the abnormal disk partition if the abnormal disk partition is not mounted to the main directory of the operating system.
[0066] Optionally, the above device further includes at least one of the following: a first control module, used to control the information collection terminal to display host information after processing the abnormal disk partition according to the generation type; a second control module, used to control the information collection terminal to retrieve the physical storage location of the abnormal host; and a third control module, used to control the information collection terminal to issue an alarm for the abnormal disk partition.
[0067] Example 3
[0068] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the abnormal disk partitioning processing method described above.
[0069] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, and / or in any mobile terminal in a group of mobile terminals, and the computer-readable storage medium includes a stored program.
[0070] Optionally, during program execution, the device containing the computer-readable storage medium may be controlled to perform the following functions: detect abnormal disk partitions of the host; determine the generation type of the abnormal disk partitions; and process the abnormal disk partitions according to their generation type.
[0071] Optionally, detecting abnormal disk partitions on the host includes: deploying a detection service module on the host as a scheduled task, wherein the detection service module includes an application generated based on a shell script tool; and periodically triggering the detection of abnormal disk partitions through the detection service module.
[0072] Optionally, the generation type of the abnormal disk partition is determined, including: if the abnormal disk partition is generated from a data disk, the generation type is determined to be the first generation type; if the abnormal disk partition is generated from a system disk, the generation type is determined to be the second generation type.
[0073] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the first generation type, the process occupying the abnormal disk partition is closed and the space occupied by the abnormal disk partition is released.
[0074] Optionally, after releasing the space occupied by the abnormal disk partition, the process also includes: unmounting the abnormal disk partition and remounting it after unmounting; performing read / write checks on the remounted abnormal disk partition and feeding the check information back to the information collection terminal.
[0075] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the second generation type, it is determined whether the abnormal disk partition is mounted to the main directory of the operating system; if the abnormal disk partition is mounted to the main directory of the operating system, the process occupying the abnormal disk partition cannot be closed, and the abnormal disk partition information and processing result information are fed back to the information collection end; if the abnormal disk partition is not mounted to the main directory of the operating system, the process occupying the abnormal disk partition is closed.
[0076] Optionally, after processing the abnormal disk partition according to the generation type, the process may include at least one of the following: the control information collection terminal displays host information; the control information collection terminal retrieves the physical storage location of the abnormal host; and the control information collection terminal issues an alarm for the abnormal disk partition.
[0077] Example 4
[0078] According to another aspect of the present invention, a processor is also provided for running a program, wherein the program executes the abnormal disk partition processing method described above.
[0079] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: detecting abnormal disk partitions of the host; determining the generation type of the abnormal disk partitions; and processing the abnormal disk partitions according to their generation type.
[0080] Optionally, detecting abnormal disk partitions on the host includes: deploying a detection service module on the host as a scheduled task, wherein the detection service module includes an application generated based on a shell script tool; and periodically triggering the detection of abnormal disk partitions through the detection service module.
[0081] Optionally, the generation type of the abnormal disk partition is determined, including: if the abnormal disk partition is generated from a data disk, the generation type is determined to be the first generation type; if the abnormal disk partition is generated from a system disk, the generation type is determined to be the second generation type.
[0082] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the first generation type, the process occupying the abnormal disk partition is closed and the space occupied by the abnormal disk partition is released.
[0083] Optionally, after releasing the space occupied by the abnormal disk partition, the process also includes: unmounting the abnormal disk partition and remounting it after unmounting; performing read / write checks on the remounted abnormal disk partition and feeding the check information back to the information collection terminal.
[0084] Optionally, the abnormal disk partition is processed according to the generation type, including: if the generation type is the second generation type, it is determined whether the abnormal disk partition is mounted to the main directory of the operating system; if the abnormal disk partition is mounted to the main directory of the operating system, the process occupying the abnormal disk partition cannot be closed, and the abnormal disk partition information and processing result information are fed back to the information collection end; if the abnormal disk partition is not mounted to the main directory of the operating system, the process occupying the abnormal disk partition is closed.
[0085] Optionally, after processing the abnormal disk partition according to the generation type, the process may include at least one of the following: the control information collection terminal displays host information; the control information collection terminal retrieves the physical storage location of the abnormal host; and the control information collection terminal issues an alarm for the abnormal disk partition.
[0086] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0087] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0088] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0089] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0090] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0091] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0092] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of handling an abnormal disk partition, characterized by, The method is applied to a host connected with an information collection end, and comprises: detecting an abnormal disk partition of the host; determining a generation type of the abnormal disk partition; processing the abnormal disk partition according to the generation type; determining the generation type of the abnormal disk partition, comprising: if the abnormal disk partition is generated by a data disk, determining the generation type as a first generation type; if the abnormal disk partition is generated by a system disk, determining the generation type as a second generation type; processing the abnormal disk partition according to the generation type, comprising: if the generation type is the second generation type, judging whether the abnormal disk partition is mounted to a main directory of an operating system; if the abnormal disk partition is mounted to the main directory of the operating system, closing a process occupying the abnormal disk partition and feeding back abnormal disk partition information and processing result information to the information collection end; if the abnormal disk partition is not mounted to the main directory of the operating system, closing the process occupying the abnormal disk partition, in the process of closing the process occupying the abnormal disk partition, at least checking disk mounting, checking root directory mounting, checking whether a process uses a deleted file and checking a parent process to determine a solution for processing the process occupying the abnormal disk partition, recording the abnormal disk partition and a partition mode as GPT or MBR, and performing read-write detection on the abnormal disk partition after mounting, wherein the detection content of the read-write detection at least comprises pure read speed, pure write speed, read-write speed and read-write amount.
2. The method of claim 1, wherein, detecting the abnormal disk partition of the host, comprising: deploying a detection service module on the host in a form of a timing task, wherein the detection service module comprises an application program generated based on a shell script tool; triggering the detection of the abnormal disk partition by the detection service module in a timing manner.
3. The method of claim 1, wherein, processing the abnormal disk partition according to the generation type, comprising: if the generation type is the first generation type, closing the process occupying the abnormal disk partition and releasing the occupied space of the abnormal disk partition.
4. The method of claim 3, wherein, after releasing the occupied space of the abnormal disk partition, further comprising: unmounting the abnormal disk partition and remounting the abnormal disk partition after unmounting; performing read-write detection on the abnormal disk partition after mounting and feeding back detection information to the information collection end.
5. The method according to any one of claims 1 to 4, characterized in that, after processing the abnormal disk partition according to the generation type, further comprising at least one of the following: controlling the information collection end to display host information; controlling the information collection end to search for a physical storage location of an abnormal host; and controlling the information collection end to alarm the abnormal disk partition.
6. An apparatus for handling an abnormal disk partition, characterized by comprising: The device is applied to a host connected with an information collection end, and comprises: a detection module, configured to detect an abnormal disk partition of the host; a determination module, configured to determine a generation type of the abnormal disk partition; a processing module, configured to process the abnormal disk partition according to the generation type. The determining module comprises: a first determining unit configured to determine that the generation type is a first generation type if the abnormal disk partition is generated by a data disk; and a second determining unit configured to determine that the generation type is a second generation type if the abnormal disk partition is generated by a system disk. The processing module comprises: a judging unit configured to judge whether the abnormal disk partition is mounted to a main directory of an operating system if the generation type is the second generation type; a fourth processing unit configured to be unable to close a process occupying the abnormal disk partition and feed back abnormal disk partition information and processing result information to the information collection end if the abnormal disk partition is mounted to the main directory of the operating system; and a fifth processing unit configured to close the process occupying the abnormal disk partition if the abnormal disk partition is not mounted to the main directory of the operating system. The device is further configured to check at least disk mounting, root directory mounting, whether there is a process using a deleted file, and a parent process during the process of closing the process occupying the abnormal disk partition, to determine a solution for processing the process occupying the abnormal disk partition. The device is further configured to record the abnormal disk partition and a partition mode as GPT or MBR, and perform read-write detection on the abnormal disk partition after mounting, wherein the read-write detection comprises at least pure read speed, pure write speed, read-write speed, and read-write amount.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program controls a device where the computer readable storage medium is located to execute the processing method of the abnormal disk partition according to any one of claims 1 to 5 when the program is running.
8. A processor, comprising: The processor is configured to run a program, wherein the program executes the processing method of the abnormal disk partition according to any one of claims 1 to 5 when the program is running.
Citation Information
Patent Citations
Fault-tolerant method for data storage load and IPTV (internet protocol television) system
CN106874141A