CN111737049A - RAID 6-based disk array data recovery method and device - Google Patents

RAID 6-based disk array data recovery method and device Download PDF

Info

Publication number
CN111737049A
CN111737049A CN202010506506.5A CN202010506506A CN111737049A CN 111737049 A CN111737049 A CN 111737049A CN 202010506506 A CN202010506506 A CN 202010506506A CN 111737049 A CN111737049 A CN 111737049A
Authority
CN
China
Prior art keywords
disk
damaged
data
sector
recovered
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010506506.5A
Other languages
Chinese (zh)
Inventor
刘红泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010506506.5A priority Critical patent/CN111737049A/en
Publication of CN111737049A publication Critical patent/CN111737049A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/18Error detection or correction of the data by redundancy in hardware using passive fault-masking of the redundant circuits
    • G06F11/181Eliminating the failing redundant component

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention relates to a disk array data recovery method and device based on RAID6, which is characterized in that the method comprises the following steps: cloning the first damaged disk by using the first new disk, and determining the address offset of the damaged sector of the first damaged disk; reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to determine whether the sectors are damaged; in response to that the corresponding sectors of the second damaged disk and the third damaged disk are not damaged, verifying the corresponding sectors by using the address offset of the disks except the first damaged disk in the disk array to obtain the recovery data of the damaged sector of the first damaged disk; and writing the recovered data into the sector corresponding to the address offset of the first new disk to obtain a recovered first damaged disk. The scheme of the invention realizes the data recovery of the magnetic disk under the condition that three magnetic disks are damaged and the damage of two magnetic disks does not exceed the same sector area, and effectively improves the safety and reliability of using the magnetic disk array to store data.

Description

RAID 6-based disk array data recovery method and device
Technical Field
The invention relates to the technical field of data storage, in particular to a disk array data recovery method and device based on RAID6, computer equipment and a storage medium.
Background
RAID is widely applied to a disk Array, wherein RAID6 is a level standard of RAID technology and is collectively called an Independent Data Disks (Independent Data Disks With Two Independent distributed Parity Schemes).
The redundancy of the existing RAID6 disk array model is 2, namely two disks are allowed to be damaged simultaneously without affecting the integrity of data, after two disks are damaged, two hot spare disks can replace the damaged disks and then are converted into member disks, however, the RAID6 cannot realize the fault scene of simultaneously damaging three disks, when three bad disks simultaneously appear, the RAID cannot access, the repair of the data cannot be completed through the RAID, and the data face to be lost.
Disclosure of Invention
In view of the above, it is necessary to provide a method, an apparatus, a computer device and a storage medium for recovering data of a disk array based on RAID 6.
According to an aspect of the present invention, there is provided a RAID 6-based disk array data recovery method, including:
cloning the first damaged disk by using the first new disk, and determining the address offset of the damaged sector of the first damaged disk;
reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to determine whether the sectors are damaged;
in response to that the sectors corresponding to the second damaged disk and the third damaged disk are not damaged, verifying the sectors corresponding to the address offsets of the disks except the first damaged disk in the disk array to obtain recovered data of the damaged sectors of the first damaged disk;
and writing the recovered data into a sector corresponding to the address offset of the first new disk to obtain a recovered first damaged disk.
In one embodiment, the cloning a first damaged disk with a first new disk and determining an address offset of a damaged sector of the first damaged disk comprises:
reading all sector data of the first damaged disk by using a first reading instruction;
responding to the first reading instruction to return success, and writing the read data into the first new disk;
and responding to the failure of the first reading instruction return, acquiring the information of the current sector, and determining the address offset according to the information of the current sector.
In one embodiment, the step of obtaining information of a current sector if the first read instruction returns a failure, and determining the address offset according to the information of the current sector includes:
acquiring a first reading speed according to the first reading instruction;
in response to that the first reading rate is greater than a preset reading rate, re-reading the information of the current sector by using a second reading instruction, wherein the reading rate of the second reading instruction is the preset reading rate;
and if the second reading instruction returns failure, the information of the current sector is acquired again, and the address offset is determined according to the acquired information of the current sector.
In one embodiment, the predetermined read rate is 512 bytes per second.
In one embodiment, the step of performing row check on the sector corresponding to the address offset of the disk other than the first damaged disk in the disk array to obtain the recovered data of the damaged sector of the first damaged disk includes:
determining a first distribution position of a first check code by using the address offset, the number of the disks of the disk array, a data start sector of each disk and the block size of the disk array;
determining a second distribution position of a second check code by using the first distribution position and the number of the disks;
and calculating the recovery data by using the first distribution position, the second distribution position and a preset formula.
In one embodiment, the method further comprises:
replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk respectively; and
and starting the RAID, and reconstructing data of the second new disk and the third new disk by using a preset data recovery instruction to obtain a recovered second damaged disk and a recovered third damaged disk.
According to another aspect of the present invention, there is provided a RAID 6-based disk array data recovery apparatus, the apparatus including:
the disk cloning module is used for cloning the first damaged disk by using the first new disk and determining the address offset of the damaged sector of the first damaged disk;
the data reading module is used for reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to determine whether the sectors are damaged;
the data recovery module is used for responding that the corresponding sectors of the second damaged disk and the third damaged disk are not damaged, and verifying the corresponding sectors of the address offsets of the disks except the first damaged disk in the disk array to obtain recovered data of the damaged sectors of the first damaged disk;
and the data writing module is used for writing the recovered data into a sector corresponding to the address offset of the first new disk so as to obtain a recovered first damaged disk.
In one embodiment, the apparatus further comprises:
the disk replacement module is used for replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk respectively; and
the data writing module is further configured to start the RAID, and reconstruct data of the second new disk and the third new disk by using a preset data recovery instruction, so as to obtain a recovered second damaged disk and a recovered third damaged disk.
According to another aspect of the present invention, there is provided a RAID 6-based disk array data recovery apparatus, the apparatus including:
in still another aspect of the present invention, there is also provided a computer apparatus, including:
at least one processor; and
a memory storing a computer program operable on the processor, the processor executing the computer program to perform the aforementioned RAID 6-based disk array data recovery method.
In still another aspect of the present invention, a computer-readable storage medium is further provided, where a computer program is stored, and when executed by a processor, the computer program performs the foregoing RAID 6-based disk array data recovery method.
According to the disk array data recovery method, device, computer equipment and storage medium based on RAID6, the first damaged disk is cloned through the new disk, the address offset of the damaged sector is determined, and the data of the second damaged disk, the third damaged disk and the corresponding area of the rest disks are used for verification under the condition that two disks do not exceed the same damaged sector, so that the data of the first damaged disk is recovered, the disk data recovery under the condition that three disks are damaged is realized, and the safety and reliability of the data stored by using the disk array are effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for recovering data of a disk array based on RAID6 according to an embodiment of the present invention;
FIG. 2 is a diagram of a RAID6 configuration with six disks in one embodiment;
fig. 3 is a schematic flow chart of a method for recovering data of a disk array based on RAID6 according to another embodiment of the present invention;
FIG. 4 is a schematic sub-flow chart of step 100 according to another embodiment of the present invention;
FIG. 5 is a schematic sub-flow chart of step 130 according to another embodiment of the present invention;
FIG. 6 is a schematic sub-flow chart of step 300 in another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a RAID 6-based disk array data recovery apparatus according to another embodiment of the present invention;
fig. 8 is an internal structural view of a computer device in another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In an embodiment, referring to fig. 1, the present invention provides a method for recovering data of a disk array based on RAID6, and specifically the method includes the following steps:
s100, cloning the first damaged disk by using the first new disk, and determining the address offset of the damaged sector of the first damaged disk.
The first new magnetic disk is a magnetic disk which is not damaged in any sector of the magnetic disk and can be read normally; cloning refers to writing data of one disk into another disk, for example, writing data of a first damaged disk into any new disk, and the data of a damaged sector does not need to be written into the new disk during cloning.
And S200, reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to confirm whether the sectors are damaged.
And S300, in response to that the corresponding sectors of the second damaged disk and the third damaged disk are not damaged, verifying the corresponding sectors by using the address offsets of the disks except the first damaged disk in the disk array to obtain the recovery data of the damaged sector of the first damaged disk.
The damaged areas of the second damaged disk and the third damaged disk may be the same or different, and this embodiment does not limit them.
S400, writing the recovery data into the sector corresponding to the address offset of the first new disk to obtain the recovered first damaged disk.
According to the RAID 6-based disk array data recovery method, the first damaged disk is cloned through the new disk, the address offset of the damaged sector is determined, and the data of the second damaged disk, the third damaged disk and the data of the corresponding area of the rest disks are used for verification under the condition that no more than two disks damage the same sector, so that the data of the first damaged disk is recovered, the disk data recovery under the condition that three disks are damaged is realized, and the safety and the reliability of the data stored by using the disk array are effectively improved.
In another embodiment, please refer to fig. 2, in order to facilitate understanding of the present embodiment of the present invention, for example, by using six disks, it is assumed that disk1 is the first damaged disk, disk2 and disk3 are the second new disk and the third new disk, respectively, and disk4, disk5 and disk6 are not damaged, and the first damaged disk in which the disk data of disk1 is recovered on the basis of the foregoing embodiment, further referring to fig. 3, the method further includes the following steps:
and S500, replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk.
In the specific implementation process, the drive marks of the second new disk and the third new disk which are not capable of being read and written normally can be respectively marked as sdp and sdq, and the drive mark of the recovered first damaged disk can be marked as sdx.
S600, starting the RAID, and reconstructing data of the second new disk and the third new disk by using a preset data recovery instruction to obtain a recovered second damaged disk and a recovered third damaged disk.
The specific preset data recovery instruction is' mddm-a/dev/md 0/dev/sdq; mdam-a/dev/md 0/dev/sdp ", after the command is executed, the RAID automatically reconstructs data to new disks sdp and sdq.
According to the disk array data recovery method based on RAID6, one damaged disk is replaced by the first damaged disk recovered in the previous step, so that RAID can be started, and data reconstruction of the remaining two damaged disks is further performed by using RAID.
In another embodiment, referring to fig. 4, the step 100 includes the following sub-steps:
s110, reading all sector data of the first damaged disk by using the first reading instruction.
S120, responding to the first reading instruction and returning success, and writing the read data into the first new disk.
Wherein, the read instruction adopts a read function; for example, two disks 1 and sdx are opened simultaneously in the process, data of disk1 can be read in a large block at the speed of 1 million per second, and if the read function returns success, the read data is written into sdx by the same disk address offset; it should be specially described that each read command is configured with a read/write speed, and the read speed in this embodiment may also be other existing read/write speeds, which is only used for illustration here.
S130, responding to the first reading instruction and returning failure, obtaining the information of the current sector, and determining the address offset according to the information of the current sector. Specifically, referring to fig. 5, the step 130 specifically includes the following sub-steps:
s131, a first reading rate is obtained according to the first reading instruction.
S132, in response to that the first reading rate is greater than the preset reading rate, re-reading the information of the current sector by using a second reading instruction, where the reading rate of the second reading instruction is the preset reading rate. Preferably, the predetermined read rate is 512 bytes per second.
And S133, in response to the failure of the second read instruction return, re-acquiring the information of the current sector, and determining the address offset according to the re-acquired information of the current sector.
For example, if the read function returns a failure, 512 bytes (i.e. a sector size) are used instead to read the failed 1M size data, when the disk1 is read with 512 bytes, if the read function returns a success, the data is written into sdx, and if the read function returns a failure, the address offset of the sector is recorded into the log file recovery.
According to the RAID 6-based disk array data recovery method, the data of the sector area which is not damaged is read and written by using a high read-write speed, and the damaged sector area is accurately found by using a low read-write speed, so that the damaged sector area can be accurately found, and the read-write efficiency of the undamaged sector area of the disk is also considered.
In another embodiment, referring to fig. 6, the step 300 includes the following sub-steps:
s310, determining a first distribution position of the first check code by using the address offset, the number of the disks of the disk array, the data start sector of each disk and the block size of the disk array. Specifically, the first distribution position is obtained by using the following formula 1 in the implementation process.
Equation 1:
diskNuP=cfg->raidDiskNumber-(nSectorIndex-cfg->mdStartSector)/cfg->chunkSize%cfg->raidDiskNumber-1;
wherein, the diskNuP is a first distribution position of the first check code; the raidDiskNumber is the number of raid6 member disks; nSectorIndex is the sector address; mdStartSector is the data start sector for each disk; chunkSize is the block size of the disk array; "+" is an exclusive OR operation.
S320, determining a second distribution position of the second check code by using the first distribution position and the number of the disks. Specifically, the second distribution position is obtained by using the following formula 2 in the implementation process.
Equation 2: (diskNuQ)% cfg- > raidDiskNumber; wherein, the diskNuQ is a second distribution position of the second check code.
And S330, calculating recovery data according to the first distribution position, the second distribution position and a preset formula. The specific preset formula comprises:
equation 3: p ═ X1+ X2+ X3+ X4;
equation 4: q ═ KX1+ KX2+ KX3+ KX 4;
wherein P, X1, X2, X3, X4, and Q are data stored in a disk1, disk2, disk3, disk4, and disk5 corresponding to a stripe, respectively, after calculating a data value on disk1, the data is written into a sector at the same position of a sdx disk, data recovery of all sectors of the disk1 is completed, and the sdx disk can replace a first damaged disk, i.e., disk1, it can be understood that if one of the disks 2 to disk6 is damaged, similarly, P, Q, X5-X9, X10-X14, X15-X19, and X20-X24 of each disk all calculate data in the above manner.
It should be understood that although the various steps in the flowcharts of fig. 1, and 3-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1, and 3-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
In another embodiment, referring to fig. 7, a RAID 6-based disk array data recovery apparatus 70 is provided, the apparatus comprising:
a disk cloning module 71, configured to clone the first damaged disk by using the first new disk, and determine an address offset of the damaged sector of the first damaged disk;
a data reading module 72, configured to determine whether corresponding sectors of the second damaged disk and the third damaged disk are damaged by using the address offset;
the data recovery module 73 is configured to, in response to that the sectors corresponding to the second damaged disk and the third damaged disk are not damaged, perform verification using the sector corresponding to the address offset of the disk other than the first damaged disk in the disk array to obtain recovered data of the damaged sector of the first damaged disk;
and a data writing module 74, configured to write the recovery data into the sector corresponding to the address offset of the first new disk, so as to obtain a recovered first damaged disk.
In another embodiment, the illustrated apparatus 70 further comprises:
the disk replacement module is used for replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk respectively; and
the data writing module 74 is further configured to start the RAID, and reconstruct the data of the second new disk and the third new disk by using a preset data recovery instruction, so as to obtain a recovered second damaged disk and a recovered third damaged disk.
It should be noted that, for specific limitations of the RAID 6-based disk array data recovery apparatus 70, reference may be made to the above limitations of the RAID 6-based disk array data recovery method, and details are not described here. The various modules in the apparatus 70 described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In another embodiment, please refer to fig. 8, which provides a computer device, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement the RAID 6-based disk array data recovery method described above.
According to yet another aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the RAID 6-based disk array data recovery method described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments may be implemented by a computer program to instruct related hardware to implement the methods, a program of the RAID 6-based disk array data recovery method may be stored in a computer readable storage medium, and when executed, the program may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Further, it should be appreciated that the computer-readable storage media (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The steps of a method or algorithm described in connection with the disclosure herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A disk array data recovery method based on RAID6, characterized in that the method comprises:
cloning the first damaged disk by using the first new disk, and determining the address offset of the damaged sector of the first damaged disk;
reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to determine whether the sectors are damaged;
in response to that the sectors corresponding to the second damaged disk and the third damaged disk are not damaged, verifying the sectors corresponding to the address offsets of the disks except the first damaged disk in the disk array to obtain recovered data of the damaged sectors of the first damaged disk;
and writing the recovered data into a sector corresponding to the address offset of the first new disk to obtain a recovered first damaged disk.
2. The method of claim 1, wherein cloning the first damaged disk with the first new disk and determining the address offset of the damaged sector of the first damaged disk comprises:
reading all sector data of the first damaged disk by using a first reading instruction;
responding to the first reading instruction to return success, and writing the read data into the first new disk;
and responding to the failure of the first reading instruction return, acquiring the information of the current sector, and determining the address offset according to the information of the current sector.
3. The method of claim 2, wherein the step of obtaining information of a current sector in response to the first read command returning a failure and determining the address offset based on the information of the current sector comprises:
acquiring a first reading speed according to the first reading instruction;
in response to that the first reading rate is greater than a preset reading rate, re-reading the information of the current sector by using a second reading instruction, wherein the reading rate of the second reading instruction is the preset reading rate;
and if the second reading instruction returns failure, the information of the current sector is acquired again, and the address offset is determined according to the acquired information of the current sector.
4. The method of claim 3, wherein the preset read rate is 512 bytes per second.
5. The method of claim 1, wherein the step of performing row check on sectors corresponding to the address offset of the disk array except the first damaged disk to obtain the recovery data of the damaged sector of the first damaged disk comprises:
determining a first distribution position of a first check code by using the address offset, the number of the disks of the disk array, a data start sector of each disk and the block size of the disk array;
determining a second distribution position of a second check code by using the first distribution position and the number of the disks;
and calculating the recovery data by using the first distribution position, the second distribution position and a preset formula.
6. The method according to any one of claims 1-5, further comprising:
replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk respectively; and
and starting the RAID, and reconstructing data of the second new disk and the third new disk by using a preset data recovery instruction to obtain a recovered second damaged disk and a recovered third damaged disk.
7. A RAID 6-based disk array data recovery apparatus, the apparatus comprising:
the disk cloning module is used for cloning the first damaged disk by using the first new disk and determining the address offset of the damaged sector of the first damaged disk;
the data reading module is used for reading corresponding sectors of the second damaged disk and the third damaged disk according to the address offset to determine whether the sectors are damaged;
the data recovery module is used for responding that the corresponding sectors of the second damaged disk and the third damaged disk are not damaged, and verifying the corresponding sectors of the address offsets of the disks except the first damaged disk in the disk array to obtain recovered data of the damaged sectors of the first damaged disk;
and the data writing module is used for writing the recovered data into a sector corresponding to the address offset of the first new disk so as to obtain a recovered first damaged disk.
8. The apparatus of claim 7, further comprising:
the disk replacement module is used for replacing the first damaged disk, the second damaged disk and the third damaged disk with the recovered first damaged disk, second new disk and third new disk respectively; and
the data writing module is further configured to start the RAID, and reconstruct data of the second new disk and the third new disk by using a preset data recovery instruction, so as to obtain a recovered second damaged disk and a recovered third damaged disk.
9. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor, when executing the program, performs the method of any of claims 1-6.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 6.
CN202010506506.5A 2020-06-05 2020-06-05 RAID 6-based disk array data recovery method and device Withdrawn CN111737049A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010506506.5A CN111737049A (en) 2020-06-05 2020-06-05 RAID 6-based disk array data recovery method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010506506.5A CN111737049A (en) 2020-06-05 2020-06-05 RAID 6-based disk array data recovery method and device

Publications (1)

Publication Number Publication Date
CN111737049A true CN111737049A (en) 2020-10-02

Family

ID=72650057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010506506.5A Withdrawn CN111737049A (en) 2020-06-05 2020-06-05 RAID 6-based disk array data recovery method and device

Country Status (1)

Country Link
CN (1) CN111737049A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463036A (en) * 2020-11-13 2021-03-09 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for calculating block stripes by disk
CN116149574A (en) * 2023-04-20 2023-05-23 苏州浪潮智能科技有限公司 RAID array management method and device, RAID card and storage medium
CN117312054A (en) * 2023-10-30 2023-12-29 广州鼎甲计算机科技有限公司 Target data recovery method and device of disk array and computer equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463036A (en) * 2020-11-13 2021-03-09 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for calculating block stripes by disk
CN112463036B (en) * 2020-11-13 2023-01-10 苏州浪潮智能科技有限公司 Method, system, terminal and storage medium for calculating block stripes by disk
CN116149574A (en) * 2023-04-20 2023-05-23 苏州浪潮智能科技有限公司 RAID array management method and device, RAID card and storage medium
CN117312054A (en) * 2023-10-30 2023-12-29 广州鼎甲计算机科技有限公司 Target data recovery method and device of disk array and computer equipment
CN117312054B (en) * 2023-10-30 2024-05-14 广州鼎甲计算机科技有限公司 Target data recovery method and device of disk array and computer equipment

Similar Documents

Publication Publication Date Title
CN111737049A (en) RAID 6-based disk array data recovery method and device
JP3226370B2 (en) Improvements on high availability disk arrays
CN102184129B (en) Fault tolerance method and device for disk arrays
US7464289B2 (en) Storage system and method for handling bad storage device data therefor
JP2000112831A (en) Disk recording/reproducing method and device therefor
JP2008033874A (en) Data salvation method for redundant array derogation of independent disk and its system
CN103970481A (en) Method and device for reconstructing memory array
JPH05505264A (en) Non-volatile memory storage of write operation identifiers in data storage devices
CN110399247B (en) Data recovery method, device and equipment and computer readable storage medium
US6192484B1 (en) Method and system for recovering lost data
CN105183590A (en) Disk array fault tolerance processing method
CN106933707B (en) Data recovery method and system of data storage device based on raid technology
CN109215726B (en) Memory test method and memory device thereof
TW201329701A (en) Automatic remapping in redundant array of independent disks and related raid
US10831601B2 (en) Reconstruction hard disk array and reconstruction method for to-be-reconstructed hard disks therein including comparing backup data with an access timestamp of first, second and third hard disks
JP2009151681A (en) Disk array device
CN111381997B (en) RAID reconstruction method and device
CN111857573A (en) Intelligent replacement method and system based on RAID (redundant array of independent disks) fault member disk
CN117008845B (en) Method and device for dividing read-write instruction, storage medium and electronic device
US10073735B1 (en) Seeding mechanism for error detection codes
JP5598124B2 (en) DATA RECORDING / REPRODUCING DEVICE, DATA RECORDING METHOD, AND DATA RECORDING PROGRAM
JP2007183808A (en) Magnetic disk unit
JP2009238337A (en) Information recording and reproduction control device
JP2005242708A (en) File restoration method and file recording device
JP2003167687A (en) Method and device for disk array control and disk array control program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201002