Multi-system disk redundancy method, device and equipment and readable storage medium

By creating a backup area in the end area of ​​the target system disk and writing the backup partition table to the area, the problem of backup partition table failure in the mirrored redundant array is solved, achieving higher security and stability.

CN119621435APending Publication Date: 2025-03-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411943780.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

During the process of forming a mirrored redundant array, the backup partition table in GPT format is not at the end of the physical disk due to the alignment policy or other characteristics, which causes the backup partition table to fail and cannot be read normally when the main partition table fails, resulting in the kernel startup failure.

Method used

Use the end area of ​​the target system disk as the backup area. The number of target system disks is greater than or equal to 2. Combine other areas except the backup area to obtain a mirrored redundant array. Partition the mirrored redundant array to obtain the main partition table and the backup partition table. Write the main partition table to the head end area of ​​the mirrored redundant array, and write the backup partition table to the backup area.

Benefits of technology

Through this method, the system can always read the backup partition table at the end of the system disk, solving the problem of backup partition table failure, improving the security and stability of the mirrored redundant array, making its redundant effect better.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621435A_ABST
    Figure CN119621435A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-system-disk redundancy method, device and equipment and a readable storage medium, and is applied to the field of backup, and the tail end areas of a plurality of target system disks serve as backup areas; taking other areas except the backup area in the target system disk as combined areas, and combining the combined areas to obtain a mirror image redundant array; and partitioning the mirror redundant array to obtain a main partition table and a backup partition table, writing the main partition table into a head end region of the mirror redundant array, and writing the backup partition table into a backup region. The method has the beneficial effects that the method is realized based on a soft function, hardware resources do not need to be modified and increased, and the cost is relatively low; according to the fixed reading principle of the system, the system can read the backup partition table at the tail end of the system disk all the time, the problem that the backup partition table fails due to GPT partition in the mirror image redundant array construction process is solved, the mirror image redundant array has high safety and stability, and the redundancy effect of the mirror image redundant array is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of backup, and in particular to a multi-system disk redundancy method, device, equipment and readable storage medium. Background Art

[0002] When the mirrored redundant array is constructed and partitioned using the GPT (GUID Partition Table, Globally Unique Identifier Partition Table) format, the last part of the system disk is usually not used due to the alignment strategy or other characteristics of the mirrored redundant array construction process, resulting in the GPT backup partition table being stored at the end of the mirrored redundant array instead of the end of the physical disk. This causes the backup partition table to be in an invalid state. Once the primary partition table fails, the backup partition table must be read but will fail, causing the kernel to fail to boot. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a multi-system disk redundancy method, device, equipment and readable storage medium, which solves the problem of backup partition table failure in the prior art.

[0004] In order to solve the above technical problems, the present invention provides a multi-system disk redundancy method, comprising:

[0005] Use the end area of ​​the target system disk as the backup area, and the number of target system disks is greater than or equal to 2;

[0006] The other areas in the target system disk except the backup area are used as the combined area, and the combined area is combined to obtain a mirrored redundant array;

[0007] The mirrored redundant array is partitioned to obtain a primary partition table and a backup partition table. The primary partition table is written into the head end area of ​​the mirrored redundant array, and the backup partition table is written into the backup area.

[0008] On the one hand, after combining the combined areas to obtain the mirrored redundant array, it also includes:

[0009] The backup partition table offset, the backup mirror redundant array information offset and the backup bitmap information offset are calculated according to the backup area and the combined area.

[0010] On the one hand, the backup partition table is written to the backup area, including:

[0011] Get the address of the backup partition table in the backup area according to the backup partition table offset;

[0012] Write the backup partition table to the backup area according to the address.

[0013] On the one hand, after writing the backup partition table into the backup area, it also includes:

[0014] Modify the location information and cyclic redundancy check information in the backup partition table, and modify the location information and cyclic redundancy check information about the backup partition table in the primary partition table.

[0015] On the one hand, after combining the combined areas to obtain the mirrored redundant array, it also includes:

[0016] Obtaining mirrored redundant array information and bitmap information of the mirrored redundant array;

[0017] The mirrored redundant array information and the bitmap information are written to the backup area.

[0018] On the one hand, after writing the backup partition table to the backup area, it also includes:

[0019] When the system is restarted, if the mirrored redundant array information of the mirrored redundant array is damaged, resulting in the failure of the mirrored redundant array reorganization, the mirrored redundant array information and the bitmap information in the backup area are read and verified;

[0020] When the mirrored redundant array information of the backup area passes the verification, the mirrored redundant array information of the mirrored redundant array is replaced with the mirrored redundant array information of the backup area;

[0021] When the bitmap information of the backup area passes the verification, the bitmap information of the mirrored redundant array is replaced with the bitmap information of the backup area;

[0022] Reorganize the mirrored redundant array.

[0023] On the one hand, after writing the backup partition table to the backup area, it also includes:

[0024] When the mirrored redundant array information of the mirrored redundant array changes and is refreshed, the mirrored redundant array information loading field is assigned a value of refreshing the mirrored redundant array information backup;

[0025] When it is detected that the mirrored redundant array information loading field is to refresh the mirrored redundant array information backup, the mirrored redundant array information in the backup area is refreshed;

[0026] When the bitmap information of the mirrored redundant array changes and is flushed, it is determined whether the first field and the second field are set, and if so, the third field is set; the first field is used to determine whether to enable; the second field is used to control whether to reserve backup space for the bitmap information; the third field is used to control whether the bitmap information is updated;

[0027] When it is detected that the third field is set, the bitmap information of the backup area is refreshed.

[0028] The present invention also provides a multi-system disk redundancy device, comprising:

[0029] A backup area determination module, used to use the end area of ​​the target system disk as the backup area, and the number of the target system disks is greater than or equal to 2;

[0030] A combination module, used to use other areas of the target system disk except the backup area as combination areas, and combine the combination areas to obtain a mirrored redundant array;

[0031] The partition module is used to partition the mirror redundant array to obtain a primary partition table and a backup partition table, write the primary partition table into the head end area of ​​the mirror redundant array, and write the backup partition table into the backup area.

[0032] The present invention also provides a multi-system disk redundancy device, comprising:

[0033] Memory for storing computer programs;

[0034] The processor is used to implement the above-mentioned multi-system disk redundancy method when executing a computer program.

[0035] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the multi-system disk redundancy method as described above is implemented.

[0036] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the multi-system disk redundancy method when executed by a processor.

[0037] It can be seen from the above technical scheme that the present invention uses the end area of ​​the target system disk as the backup area, and the number of the target system disks is greater than or equal to 2; uses other areas of the target system disk except the backup area as the combined area, and combines the combined areas to obtain a mirror redundant array; partitions the mirror redundant array to obtain a primary partition table and a backup partition table, writes the primary partition table into the head end area of ​​the mirror redundant array, and writes the backup partition table into the backup area. The beneficial effects of the present invention are: the method is based on soft function implementation, does not require modification and increase of hardware resources, and has low cost; according to the fixed reading principle of the system, the system can always read the backup partition table at the end of the system disk, which solves the problem that the GPT partition causes the backup partition table to fail during the construction of the mirror redundant array, so that the mirror redundant array has higher security and stability, and its redundancy effect is better.

[0038] In addition, the present invention also provides a multi-system disk redundancy device, equipment and storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 A flowchart of a multi-system disk redundancy method provided by an embodiment of the present invention;

[0041] Figure 2 A timing diagram for creating a mirrored redundant array provided by an embodiment of the present invention;

[0042] Figure 3 A flowchart of a backup partition table storage method provided by an embodiment of the present invention;

[0043] Figure 4 An example diagram of a process of initializing and refreshing a backup area provided by an embodiment of the present invention;

[0044] Figure 5 An example diagram of the storage location of each piece of information in a backup area provided by an embodiment of the present invention;

[0045] Figure 6 A flowchart of a data recovery method provided by an embodiment of the present invention;

[0046] Figure 7 A schematic diagram of the structure of a multi-system disk redundancy device provided by an embodiment of the present invention;

[0047] Figure 8 A schematic diagram of the structure of a multi-system disk redundant device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] First, some nouns involved in this application are analyzed:

[0050] MD (Multiple Device Driver): multiple device driver;

[0051] RAID (Redundant Array of Independent Disks) is a method of combining multiple physical hard drives into a single logical unit to improve performance, data redundancy, or storage capacity.

[0052] RAID1: Redundant Array of Mirrors;

[0053] DAS (Direct Attached Storage): Directly connected storage;

[0054] NAS (Network Attached Storage): Network attached storage;

[0055] SAN (Storage Area Network): Storage Area Network;

[0056] CDP (Continuous Data Protection): continuous data protection;

[0057] SSD: solid state drive;

[0058] Mdadm (multiple devices admin) tool: software RAID management tool;

[0059] Superblock: the core data structure of the mirrored redundant array, including the key information and metadata of the mirrored redundant array, such as the size, status, location of free space of the mirrored redundant array, etc.; that is, the mirrored redundant array information in this embodiment.

[0060] Bitmap: A data structure for efficiently storing and processing Boolean values;

[0061] GPT format: It is the abbreviation of GUID Partition Table, which is a structural layout standard of hard disk partition table;

[0062] Rdev: It is a data structure used to reference and operate physical devices in a mirrored redundant array, recording various information related to the physical disk, such as the type, status, and characteristics of the device.

[0063] The present invention relates to a mirrored redundant array technology based on an MD module, which realizes the function of supporting multi-system disk redundancy of a centralized storage device, and is a method for realizing multi-system disk redundancy of a centralized storage device based on a mirrored redundant array. Centralized storage refers to the centralized management and storage of data and information in a centralized storage system. The storage system is usually a cluster composed of multiple nodes, which can provide high-performance reading and writing speeds. Its characteristic is that all nodes are managed in a unified manner, which makes backup, recovery and maintenance simpler and more efficient. The interconnection between the storage device and the host and between each node usually adopts DAS, NAS, SAN and other technologies, and supports multiple coupling controllers, shared disk arrays and caches to improve reuse performance. At the same time, the centralized storage has power-off protection, dual-active, disaster recovery, CDP and other technologies to ensure the redundancy of the system and the security of data. Centralized storage can perfectly solve the scenarios that require highly reliable and fast access to databases, big data analysis, etc., and provide virtualization scenarios and disaster recovery scenario requirements.

[0064] At present, most centralized storage software runs on an operating system based on the Linux (an operating system) kernel, and usually uses SSD disks with fast reading and writing speeds as system disks. If the partition table is damaged, the boot program is tampered with, etc., resulting in the inability to start the operating system normally, or if extremely important data in the storage system, such as configuration files, is damaged or lost, or if the system disk is physically damaged and cannot be used normally due to the electrical characteristics of the SSD, the above situations will cause storage system node failures or even the entire cluster to crash. Therefore, it is necessary to provide a multi-system disk redundancy method, which is characterized by using two or more system disks to form an array, and the content stored in each system disk is completely consistent and mirrored to each other. And it is displayed as a combined drive letter to the upper layer. Its characteristics are to improve data security, the data is completely mirrored on multiple system disks, even if one of the system disks is damaged, the data can be restored from other system disks; data recovery is simple, even if one of the system disks is damaged, only the data on the backup system disk needs to be copied to the new system disk to complete the data recovery; improve the disk reading speed, and read data from multiple mirrored system disks.

[0065] There are two main methods for implementing redundant array of mirrors (RAID1): hardware RAID card implementation and soft RAID1 based on the Multi-Disk (MD) module in the kernel and the mdadm tool. The former is costly to implement and requires the support of the storage system hardware motherboard, while the latter is implemented by software driver, which is low-cost and easy to implement. However, when building a redundant array of mirrors, the alignment strategy or other characteristics of the redundant array building process usually reserve the last part of the physical system disk for unused, resulting in the GPT backup partition table being stored in the last 33 sectors of the array drive letter instead of the last 33 sectors of the physical system disk. Once the primary partition table fails and the backup partition table needs to be read, the read fails because the backup partition table cannot be read in the last sector of the physical layer, so the backup partition table is in an invalid state, which leads to kernel startup failure.

[0066] In view of the above problems, the present invention provides a multi-system disk redundancy method to solve the problem of failure of backup partition table. Figure 1 , Figure 1 A flowchart of a multi-system disk redundancy method provided by an embodiment of the present invention. The method may include:

[0067] S101: The end area of ​​the target system disk is used as a backup area, and the number of the target system disks is greater than or equal to 2.

[0068] The target system disk in this embodiment is a system disk that meets the preset conditions. Among them, the preset conditions are set by the user, that is, two or more system disks that meet the user's needs are used as target system disks. This embodiment does not limit the system disk. It is understandable that the system disk can be a magnetic disk; it can also be a solid-state hard disk. It is understandable that because it is necessary to achieve multi-system disk redundancy and combine the target system disks to obtain a mirrored redundant array, the number of system disks should be greater than or equal to 2. The end area in this embodiment refers to the N sectors at the end of the system disk on the physical level, which are used to store the backup partition table. It is understandable that the end area can meet the storage of the backup partition table. If the last 33 sectors of the system disk are used to store the backup partition table, then the end area is the last 33 sectors of the system disk.

[0069] Furthermore, after the end area of ​​the target system disk is used as the backup area, the following steps may be further included:

[0070] If a mirrored redundant array has been created for the target system disk, the data in the backup area will be cleared.

[0071] Specifically, when the target system disk has been used to create a mirrored redundant array, the backup area still has historical backup information, so it needs to be cleared to store the backup information of the current mirrored redundant array. Specifically, the backup area data can be cleared by calling the clean interface.

[0072] In this embodiment, the backup area is cleaned up in advance to facilitate subsequent storage of backup data.

[0073] S102: Use other areas in the target system disk except the backup area as combined areas, and combine the combined areas to obtain a mirrored redundant array.

[0074] After the backup area is determined in step S101, other areas except the backup area are combined to obtain a mirrored redundant array. The specific combination process can refer to the prior art and will not be repeated here. It should be noted that since the mirrored redundant array is obtained by combining the combined areas in this embodiment, there is a change compared to the prior art that directly combines all areas of the target system disk. Therefore, it is necessary to adjust the value of the sector field in the rdev (rdev structure is the representation of the character device in the kernel, which contains various information and operation functions of the device) structure data so that the system can recognize the combined area combined in this embodiment. The creation (combination) process of the mirrored redundant array can be referred to. Figure 2 , Figure 2 A timing diagram for creating a mirrored redundant array provided by an embodiment of the present invention.

[0075] S103: partitioning the mirrored redundant array to obtain a primary partition table and a backup partition table, writing the primary partition table into the head end area of ​​the mirrored redundant array, and writing the backup partition table into the backup area.

[0076] For details, please refer to Figure 3 The completion of the combination in step 102 indicates that the mirrored redundant array is created and the mirrored redundant array is obtained. At this time, the mirrored redundant array needs to be partitioned. After the partitioning is completed, the primary partition table and the backup partition table can be obtained. The primary partition table is written to the head end area of ​​the mirrored redundant array, and the backup partition table is written to the backup area of ​​step S101. Among them, writing the backup partition table to the backup area of ​​step S101 can specifically include: calling the backup_convert_ptb interface to move the backup partition table of the mirrored redundant array to the end position of the target system disk on the physical layer, that is, the backup area.

[0077] This embodiment does not specifically limit the content in the partition table, which generally includes the name, capacity and position of each system disk in the mirror redundant array in RAID1, so as to realize the system disk list under the graph and complete the management of the system disk in RAID. In this way, when the main partition table is abnormal, the backup partition table can be read in the end area of ​​the target system disk (this area is the end area on the physical level) according to the conventional reading principle. The head end area in this embodiment refers to the M sectors at the head of the mirror redundant system disk.

[0078] Further, after combining the combined areas to obtain the mirrored redundant array, the following steps may be specifically included:

[0079] Step 21: Obtain mirrored redundant array information and bitmap information of the mirrored redundant array;

[0080] Step 22: Write the mirrored redundant array information and the bitmap information into the backup area.

[0081] It should be noted that if the Superblock and Bitmap are tampered with or overwritten, the mirrored redundant array will fail to function or be reorganized, which will usually cause the kernel to fail to boot. Therefore, it is necessary to increase the real-time backup feature of the Superblock and Bitmap to enhance the security and stability of the mirrored redundant array and solve the drawbacks of the existing mirrored redundant array, that is, to write the mirrored redundant array information and bitmap information to the backup area. It is understandable that the size of the terminal area (backup area) reserved in step S101 will change according to the size of the stored content. At this time, the space size of the backup area for:

[0082] ;

[0083] in, is the capacity of the target system disk; The data block size is 4k by default; The size of the reserved backup Bitmap data space; 4K is the size of the backup Superblock (backup mirror redundant array information) data space; 17K is the size of the reserved backup partition table space.

[0084] Furthermore, in order to avoid conflicts caused by storing backup mirror redundant array information, backup bitmap information and backup partition table locations, after combining the combined area to obtain the mirror redundant array, the backup partition table offset, backup mirror redundant array information offset and backup bitmap information offset are calculated based on the backup area and the combined area. Figure 4In the process of creating the mirrored redundant array, a reserved backup interval related data structure Reserv_space is added to the mirrored redundant array extended device data structure rdev, an initialization interface function reserv_space_init is added, and the initialization interface function reserv_space_init is called in the operation interface add_new_disk for adding a system disk.

[0085] By calling the reserv_space_init interface, the newly added fields ptb_offset (backup partition table offset), sbb_offset (backup mirror redundant array information offset) and bmpb_offset (backup bitmap information offset) are calculated and initialized, and the newly added fields are initialized and assigned values. In this embodiment, the 33 sectors at the end of the target system disk are used as the backup area as an example. The calculation formulas for the offsets of ptb_offset, sbb_offset and bmpb_offset are as follows:

[0086] ;

[0087] ;

[0088] ;

[0089] in, Indicates the backup partition table offset; Indicates the size of a single sector space; Indicates the backup mirror redundant array information offset; Indicates the backup bitmap information offset.

[0090] Thus, the above-mentioned writing the backup partition table into the backup area may specifically include:

[0091] Step 21: Obtain the address of the backup partition table in the backup area according to the backup partition table offset;

[0092] Step 22: Write the backup partition table into the backup area according to the address.

[0093] According to the above offset calculation, the specific storage locations of the backup partition table, backup mirror redundant array information (mirror redundant array information in the backup area) and backup bitmap information (bitmap information in the backup area) in the backup area can be obtained. For details, please refer to Figure 5 .

[0094] Furthermore, after writing the backup partition table into the backup area, the following steps may be specifically included:

[0095] Modify the location information and cyclic redundancy check information in the backup partition table, and modify the location information and cyclic redundancy check information about the backup partition table in the primary partition table.

[0096] Specifically, when the partition operation is completed, the backup_convert_ptb interface is called to write the backup partition table to the ptb_offset offset position, and the position information and CRC (cyclic redundancy) check data in the backup partition table are modified, and the position information and CRC check data about the backup partition in the main partition table are modified. It can be understood that the partition table stores the position information, so when the position of the backup partition table changes, the data in the corresponding backup partition table will change, and the data about the backup partition table in the main backup partition table will also change.

[0097] Furthermore, after writing the backup partition table into the backup area, the following steps may be specifically included:

[0098] Step 31: when the system is restarted, if the mirrored redundant array information of the mirrored redundant array is damaged and causes the mirrored redundant array reorganization failure, the mirrored redundant array information and bitmap information of the backup area are read and verified;

[0099] Step 32: When the mirrored redundant array information of the backup area passes the verification, the mirrored redundant array information of the mirrored redundant array is replaced with the mirrored redundant array information of the backup area;

[0100] Step 33: When the bitmap information of the backup area passes the verification, the bitmap information of the mirrored redundant array is replaced with the bitmap information of the backup area;

[0101] Step 34: Reorganize the mirrored redundant array.

[0102] Specifically, please refer to Figure 6. When the system restarts and receives a reorganization command, it is necessary to perform an assemble operation on the system disk that created the mirrored redundant array. If the Superblock data is damaged and the reorganization of the mirrored redundant array fails, try calling the recovery_sbb_to_sb (Superblock data recovery interface) interface to read the Superblock data in the backup area. After successful verification, copy it to the Superblock data area of ​​the mirrored redundant array. If the mirrored redundant array uses an internal type of Bitmap and the data is damaged, try calling recovery_bmpb_to_bmp (Bitmap data recovery interface) to read the Bitmap data stored in the backup area. After successful verification, copy it to the Bitmap data area of ​​the mirrored redundant array, and then retry the mirrored redundant array reorganization operation. Similarly, the above can also be manually triggered by a command to copy the Superblock data in the backup area to the Superblock area of ​​the mirrored redundant array to restore the damaged Superblock data. By Figure 6 It can be seen that when the backup area stores bitmap information, the control parameter --bmpb can be specified to call the recovery_sbb_to_sb interface to read the Bitmap data in the backup area. Of course, if there is a bitmap backup in other storage spaces, the bitmap information can also be obtained from other locations by specifying the control parameter.

[0103] Furthermore, after writing the backup partition table into the backup area, the following steps may be specifically included:

[0104] Step 41: when the mirrored redundant array information of the mirrored redundant array changes and is refreshed, assign the mirrored redundant array information loading field to refresh the mirrored redundant array information backup;

[0105] Step 42: when it is detected that the mirrored redundant array information loading field is to refresh the mirrored redundant array information backup, the mirrored redundant array information in the backup area is refreshed;

[0106] Step 43: When the bitmap information of the mirrored redundant array changes and is flushed, determine whether the first field and the second field are set, and if so, set the third field; the first field is used to determine whether to enable; the second field is used to control whether to reserve backup space for the bitmap information; the third field is used to control whether the bitmap information is updated;

[0107] Step 34: When it is detected that the third field is set, the bitmap information of the backup area is refreshed.

[0108] It should be noted that a new enumeration meaning REFRESH_BACKUP_SB (refresh mirror redundant array information backup) is added to the field sb_loaded (mirror redundant array information loading field) in the rdev data structure. New fields bmpb_flg (i.e. the second field) and bmpb_dirty (i.e. the third field) are added to bitmap_info. bmpb_flg is used to control whether it is necessary to reserve Bitmap data backup space to back up Bitmap data, and bmpb_dirty is used to control whether Bitmap data is updated. A new interface refresh_bmpb is added to refresh the Bitmap data of the backup partition, i.e. the refresh_sbb interface is the backup mirror redundant array information refresh interface, and similarly the refresh_bmpb interface is the backup bitmap information refresh interface.

[0109] Specifically, please refer to Figure 4 The main thread and synchronization thread part in it. When the mirror redundant array is created, the main thread and synchronization thread of the mirror redundant array are awakened. In the main thread of the mirror redundant array, when the Superblock data in the mirror redundant array changes and the action of flushing to the system disk is completed, the sb_loaded field is assigned to REFRESH_BACKUP_SB; when the Bitmap data is updated and the action of flushing the Bitmap data in the mirror redundant array to the system disk is completed, it is determined whether the fields internal (first field) and bmpb_flg (second field) are set, and if they are satisfied, the field bmpb_dirty (third field) is set. In the mirror redundant array synchronization thread, the current mirror redundant array load is determined. When the mirror redundant array is idle, first check whether the field sb_loaded in the rdev data structure is REFRESH_BACKUP_SB. If it is satisfied, call the refresh_sbb interface to refresh the Superblock data of the backup partition. Similarly, call the refresh_bmpb interface to refresh the Bitmap data of the backup area when the fields internal, bmpb_flg and bmpb_dirty are satisfied at the same time, and the write CRC check value can also be calculated. Whether the first field, the second field and the third field in this embodiment are set can be understood as whether their field values ​​are 1, or whether their field representations are TRUE.

[0110] The multi-system disk redundancy method provided by the embodiment of the present invention is applied. The end area of ​​the target system disk is used as the backup area, and the number of target system disks is greater than or equal to 2; other areas in the target system disk except the backup area are used as the combined area, and the combined area is combined to obtain a mirrored redundant array; the mirrored redundant array is partitioned to obtain a main partition table and a backup partition table, and the main partition table is written into the head end area of ​​the mirrored redundant array, and the backup partition table is written into the backup area. The beneficial effects of the present invention are: the method is based on soft function implementation, and there is no need to modify or increase hardware resources, and the cost is low; according to the fixed reading principle of the system, the system can always read the backup partition table at the end position of the system disk, which solves the problem that the GPT partition causes the backup partition table to fail during the construction of the mirrored redundant array, so that the mirrored redundant array has higher security and stability, and its redundancy effect is better. In addition, it can well solve the problem of conflicting positions of various information in the backup area, and back up important data related to the mirrored redundant array, further improving the security and stability of the mirrored redundant array.

[0111] The following is an introduction to a multi-system disk redundancy device provided by an embodiment of the present invention. The multi-system disk redundancy device described below and the multi-system disk redundancy method described above can be referred to each other.

[0112] Please refer to Figure 7 , Figure 7 A schematic diagram of a multi-system disk redundancy device provided by an embodiment of the present invention may include:

[0113] The backup area determination module 100 is used to use the end area of ​​the target system disk as the backup area, and the number of the target system disks is greater than or equal to 2;

[0114] A combination module 200 is used to use other areas of the target system disk except the backup area as a combination area, and combine the combination areas to obtain a mirrored redundant array;

[0115] The partition module 300 is used to partition the mirrored redundant array to obtain a primary partition table and a backup partition table, write the primary partition table into the head end area of ​​the mirrored redundant array, and write the backup partition table into the backup area.

[0116] Based on the above embodiment, the multi-system disk redundancy device may further include:

[0117] The offset calculation module is used to calculate the backup partition table offset, the backup mirror redundant array information offset and the backup bitmap information offset according to the backup area and the combined area.

[0118] Based on the above embodiment, the partition module 300 may include:

[0119] An address calculation unit, used for obtaining the address of the backup partition table in the backup area according to the backup partition table offset;

[0120] The backup unit is used to write the backup partition table into the backup area according to the address.

[0121] Based on the above embodiment, the multi-system disk redundancy device may further include:

[0122] The modification module is used to modify the position information and cyclic redundancy check information in the backup partition table, and to modify the position information and cyclic redundancy check information about the backup partition table in the main partition table.

[0123] Based on the above embodiment, the multi-system disk redundancy device may further include:

[0124] An information acquisition module, used for acquiring mirrored redundant array information and bitmap information of the mirrored redundant array;

[0125] The backup module is used to write the mirrored redundant array information and the bitmap information into the backup area.

[0126] Based on the above embodiment, the multi-system disk redundancy device may further include:

[0127] The backup information reading module is used to read the mirrored redundant array information and bitmap information of the backup area and perform verification when the mirrored redundant array information of the mirrored redundant array is damaged and the mirrored redundant array reorganization fails when the system is restarted;

[0128] A first recovery module is used to replace the mirrored redundant array information of the mirrored redundant array with the mirrored redundant array information of the backup area after the mirrored redundant array information of the backup area passes the verification;

[0129] A second recovery module is used to replace the bitmap information of the mirrored redundant array with the bitmap information of the backup area when the bitmap information of the backup area passes the verification;

[0130] The reorganization module is used to reorganize the mirrored redundant array.

[0131] Based on the above embodiment, the multi-system disk redundancy device may further include:

[0132] A field assignment module is used to assign a mirrored redundant array information loading field to refresh the mirrored redundant array information backup when the mirrored redundant array information of the mirrored redundant array changes and is refreshed;

[0133] A first information refreshing module is used to refresh the mirrored redundant array information in the backup area when it is detected that the mirrored redundant array information loading field is refreshing the mirrored redundant array information backup;

[0134] The setting module is used to determine whether the first field and the second field are set when the bitmap information of the mirrored redundant array changes and is flushed, and if so, the third field is set; the first field is used to determine whether to turn on; the second field is used to control whether to reserve backup space for the bitmap information; the third field is used to control whether the bitmap information is updated;

[0135] The second information refreshing module is used to refresh the bitmap information of the backup area when it is detected that the third field is set.

[0136] It should be noted that the order of the modules and units in the above-mentioned multi-system disk redundancy device can be changed without affecting the logic.

[0137] The multi-system disk redundancy device provided by the embodiment of the present invention is applied, through the backup area determination module 100, used to use the end area of ​​the target system disk as the backup area, and the number of target system disks is greater than or equal to 2; the combination module 200 is used to use other areas in the target system disk except the backup area as the combination area, and the combination area is combined to obtain a mirror redundant array; the partition module 300 is used to partition the mirror redundant array to obtain a main partition table and a backup partition table, write the main partition table into the head end area of ​​the mirror redundant array, and write the backup partition table into the backup area. The beneficial effects of this device are: this device is based on soft function implementation, does not need to modify and increase hardware resources, and has low cost; according to the fixed reading principle of the system, the system can always read the backup partition table at the end position of the system disk, solves the problem that the GPT partition causes the backup partition table to fail during the construction of the mirror redundant array, so that the mirror redundant array has higher security and stability, and its redundancy effect is better. In addition, it can well solve the problem of conflict between the positions of various information in the backup area, and backs up important data related to the mirror redundant array, further improving the security and stability of the mirror redundant array.

[0138] Figure 8 A schematic diagram of a multi-system disk redundancy device provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown in the figure, the multi-system disk redundant equipment includes:

[0139] A memory 60, for storing computer programs;

[0140] The processor 61 is used to implement the steps of the multi-system disk redundancy method in the above embodiment when executing a computer program.

[0141] The multi-system disk redundant device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0142] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 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 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0143] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the multi-system disk redundancy method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, data of the multi-system disk redundancy method, etc.

[0144] In some embodiments, the multi-system disk redundant device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .

[0145] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation to the multi-system disk redundant device, and may include more or less components than those shown in the figure.

[0146] It is understandable that if the multi-system disk redundancy method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or the whole or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program codes.

[0147] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the multi-system disk redundancy method as described above are implemented.

[0148] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be cross-referenced with other embodiments described in this document.

[0149] A computer program product includes a computer program / instruction, which implements the steps of the multi-system disk redundancy method disclosed above when executed by a processor.

[0150] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the 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 method part.

[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0152] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only 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 terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0153] The above is a detailed introduction to a multi-system disk redundancy method, device, equipment and computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A multi-system disk redundancy method, characterized in that: include: Using the end area of ​​the target system disk as a backup area, the number of the target system disks being greater than or equal to 2; Using other areas of the target system disk except the backup area as combined areas, and combining the combined areas to obtain the mirrored redundant array; The mirrored redundant array is partitioned to obtain a primary partition table and a backup partition table, the primary partition table is written into the head end area of ​​the mirrored redundant array, and the backup partition table is written into the backup area.

2. The multi-system disk redundancy method according to claim 1, characterized in that: After combining the combined areas to obtain the mirrored redundant array, the method further includes: A backup partition table offset, a backup mirrored redundant array information offset and a backup bitmap information offset are calculated according to the backup area and the combined area.

3. The multi-system disk redundancy method according to claim 2, characterized in that: Writing the backup partition table into the backup area includes: Obtaining the address of the backup partition table in the backup area according to the backup partition table offset; According to the address, the backup partition table is written into the backup area.

4. The multi-system disk redundancy method according to claim 3, characterized in that: After writing the backup partition table into the backup area, the method further includes: The position information and cyclic redundancy check information in the backup partition table are modified, and the position information and cyclic redundancy check information about the backup partition table in the main partition table are modified.

5. The multi-system disk redundancy method according to claim 1, characterized in that: After combining the combined areas to obtain the mirrored redundant array, the method further includes: Acquire mirrored redundant array information and bitmap information of the mirrored redundant array; The mirrored redundant array information and the bitmap information are written into the backup area.

6. The multi-system disk redundancy method according to claim 5, characterized in that: After writing the backup partition table into the backup area, the method further includes: When the system is restarted, if the mirrored redundant array information of the mirrored redundant array is damaged, resulting in the failure of the mirrored redundant array reorganization, the mirrored redundant array information and the bitmap information of the backup area are read and verified; When the mirrored redundant array information of the backup area passes the verification, the mirrored redundant array information of the mirrored redundant array is replaced with the mirrored redundant array information of the backup area; When the bitmap information of the backup area passes the verification, the bitmap information of the mirrored redundant array is replaced with the bitmap information of the backup area; The mirrored redundant array is reorganized again.

7. The multi-system disk redundancy method according to claim 5, characterized in that: After writing the backup partition table into the backup area, the method further includes: When the mirrored redundant array information of the mirrored redundant array changes and is refreshed, the mirrored redundant array information loading field is assigned a value to refresh the mirrored redundant array information backup; When it is detected that the mirrored redundant array information loading field is to refresh the mirrored redundant array information backup, refreshing the mirrored redundant array information of the backup area; When the bitmap information of the mirrored redundant array changes and is flushed, it is determined whether the first field and the second field are set, and if so, the third field is set; the first field is used to determine whether to enable; the second field is used to control whether to reserve backup space for the bitmap information; the third field is used to control whether the bitmap information is updated; When it is detected that the third field is set, the bitmap information of the backup area is refreshed.

8. A multi-system disk redundancy device, characterized in that: include: A backup area determination module, used to use the end area of ​​the target system disk as the backup area, and the number of the target system disks is greater than or equal to 2; A combining module, used for taking other areas in the target system disk except the backup area as combined areas, and combining the combined areas to obtain the mirrored redundant array; The partition module is used to partition the mirrored redundant array to obtain a primary partition table and a backup partition table, write the primary partition table into the head end area of ​​the mirrored redundant array, and write the backup partition table into the backup area.

9. A multi-system disk redundant device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the multi-system disk redundancy method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the multi-system disk redundancy method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Data synchronization method and device, electronic equipment, storage medium and program product

    CN120744010A

  • Data synchronization methods, devices, electronic equipment, storage media, and software products

    CN120744010B