CN103678044A - Data recovery method and device of RAID5 in EXT3 file system - Google Patents

Data recovery method and device of RAID5 in EXT3 file system Download PDF

Info

Publication number
CN103678044A
CN103678044A CN201310739833.5A CN201310739833A CN103678044A CN 103678044 A CN103678044 A CN 103678044A CN 201310739833 A CN201310739833 A CN 201310739833A CN 103678044 A CN103678044 A CN 103678044A
Authority
CN
China
Prior art keywords
disk
sector number
data
boot record
band
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.)
Granted
Application number
CN201310739833.5A
Other languages
Chinese (zh)
Other versions
CN103678044B (en
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.)
Xiamen Information Security Research Institute Co., Ltd.
Original Assignee
Xiamen Meiya Pico Information 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 Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201310739833.5A priority Critical patent/CN103678044B/en
Publication of CN103678044A publication Critical patent/CN103678044A/en
Application granted granted Critical
Publication of CN103678044B publication Critical patent/CN103678044B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a data recovery method and device of an RAID5 in an EXT3 file system. The data recovery method includes the steps of obtaining a master boot record, obtaining superblock information according to the master boot record, obtaining the size of a band according to the superblock information, obtaining the number of a beginning sector of the band, a left-right structure of a magnetic disk, a disk sequence, synchronization-asynchronization conditions of the magnetic disk and the number of a data beginning sector according to the master boot record, and carrying out data recovery according to the size of the band, the number of the beginning sector of the band, the left-right structure of the magnetic disk, the disk sequence, the synchronization-asynchronization conditions of the magnetic disk and the number of the data beginning sector. According to the data recovery method of the RAID5 in the EXT3 file system, the RAID information such as the size of the band, the number of the beginning sector of the band and the left-right structure of the magnetic disk are accurately obtained, data recovery is carried out on the RAID5 through the obtained RAID information, and compared with the prior art, the data recovery method has the high general applicability and the high recovery success rate.

Description

The data reconstruction method of RAID5 under EXT3 file system and device
Technical field
The present invention relates to data and recover field, especially, relate to data reconstruction method and the device of a kind of RAID5 under EXT3 file system.
Background technology
Aspect operating system, Linux, aspect high efficiency and dirigibility, has obvious advantage with respect to other operating system (as Windows), and it is adopted by a lot of workstations.In (SuSE) Linux OS, because EXT3 file system has the security stronger than alternative document system, become the most widely used file system under (SuSE) Linux OS.
Aspect storage, because workstation is to data security, data rate memory with fault-tolerantly have higher requirement, therefore usually adopt Redundant Array of Independent Disks (RAID) (RAID, Redundant Array of Independent Disk) technology to process data.Wherein, in RAID memory technology, because RAID5 is the memory technology that a kind of memory property, data security and carrying cost are taken into account, become the most widely used a kind of RAID rank.
Amid all these factors, in the situation that workstation has specific (special) requirements to data, make being combined into for inevitable of EXT3 file system and RAID5 memory technology.
But, when the server of RAID5 occurs that physical fault causes RAID information to make mistakes, or because people is for maloperation is while losing configuration information etc. in situation, all will causes loss of data or damage on disk, thereby bring quite serious consequence.Therefore, the data for the RAID5 under EXT3 file system are restored to assistant officer's problem to be solved.
The key point of recovering for the data of RAID5 is the analysis of its structure to obtain RAID information, according to RAID information, carry out data recovery, wherein RAID information comprises: data start the left and right structure of sector, stripe size, dish order, disk, the synchronous asynchronous situation of disk etc.
In prior art, data reset mode to the RAID5 under EXT3 file system, have the superblock according to SuperBlock(), piece group descriptor, bitmap block, i-node(index node) architectural feature etc. of bitmap, i-node table etc. obtains RAID information, then carries out data data by the RAID information getting.But there is following problem in said method:
That certain structures information False Rate is very high, as bitmap block information, i-node bitmap etc. on the one hand; Another one aspect is, the sequencing of certain structures is difficult to accuracy of judgement, and as i-node, himself is difficult to the sequencing of judgement i-node node without sign.Above-mentioned these factors all may cause the failure of RAID5 structure analysis or mistake, and cause data to revert to power, data, recover the situation such as inaccurate.
summary of the invention
Technical matters to be solved by this invention is to provide data reconstruction method and the device of a kind of RAID5 under EXT3 file system, can analyze accurately the RAID information of RAID5, and utilize the RAID information getting to carry out data recovery, existing poor to the general applicability of RAID5 data reconstruction method under EXT3 file system to solve, revert to the low and low problem of accuracy rate of power.
On the one hand, the invention provides the data reconstruction method of a kind of RAID5 under EXT3 file system, described method comprises:
Obtain Main Boot Record;
According to described Main Boot Record, obtain superblock information;
According to the size of described superblock acquisition of information band;
Synchronous asynchronous situation and the data of according to described Main Boot Record, obtaining left and right structure that band starts sector number, disk, dish order, disk start sector number;
According to the size of the band getting, band, start the left and right structure of sector number, disk and carry out data recovery, the synchronous asynchronous situation of dish order, disk and data start sector number.
Further, according to described Main Boot Record, obtain superblock information, comprising:
According to the location determination value D1 of superblock place sector number described in the hard disk partition table acquisition of information in described Main Boot Record;
According to described D1, obtain superblock information;
Wherein, the hiding sector number of the EXT3 subregion of D1=Main Boot Record place sector number+Main Boot Record/(i-1);
I is number of disks.
Further, the size according to described superblock acquisition of information band, comprising:
Obtain the reference position of index node in described superblock;
According to the reference position of described index node, obtain the skew sector number of each disk;
According to the tolerance of the skew sector number of all disks, obtain the size of band.
Further, according to described Main Boot Record, obtain band and start sector number, comprising:
The sector number that described Main Boot Record place is set is that band starts sector number.
Further, according to described Main Boot Record, obtain the left and right structure of disk, comprising:
Whether the number that judges described Main Boot Record is 1;
If the number of described Main Boot Record is 1, obtain arbitrary verification sector number SN of Main Boot Record place disk;
Judgement (SN-stripe size) %(stripe size * i) whether the value of/stripe size equals 1, i=number of disks;
If judgment result is that to be, it is right structure that disk is set; If the determination result is NO, it is left structure that disk is set.
Further, described method also comprises:
If the number of described Main Boot Record is not 1, obtain the sector number P at arbitrary check information place of Main Boot Record place disk mBR;
Judgement (P mBR-band starts sector number) %(stripe size * i) whether the value of/stripe size equal 0;
If be not equal to 0, this Main Boot Record is real Main Boot Record; If equal 0, the Main Boot Record that this Main Boot Record is verification;
Reject the Main Boot Record of verification.
Further, according to described Main Boot Record, obtain dish order, comprising:
Obtain the sector number PSN at arbitrary check information place in each disk;
According to calculating (PSN-band starts sector number) %(stripe size * i) value after/stripe size rounds obtains dish order;
Wherein, i=number of disks.
Further, according to described Main Boot Record, obtain the synchronous asynchronous situation of disk, comprising:
Step 1, judges whether the number of superblock equals 2;
Step 2, if the number of superblock equals 2, rejects the superblock of verification;
Step 3, according to described dish order calculate superblock for the sector number S of the sector that starts of RAID band superBlock;
Step 4, obtains index node record according to the structure feature information of default index node, and according to index node record, obtains the piece B of first direct blocks pointed of this index node inode.
Step 5, according to described S superBlockand B inodecalculate the skew sector number of the data block of first direct blocks pointed;
Step 6, according to the skew sector number of the data block of described first direct blocks pointed, calculate respectively disk be described first direct blocks pointed under synchronous situation data block positional information SYNSation and at disk the positional information ASYNStation of the data block of described first direct blocks pointed be asynchronous in the situation that;
Step 7, judges whether the data that start most in described SYNSation are file characteristic head;
Step 8 is simultaneously match number SYNMatchCount to be added to 1 if judgment result is that;
Step 9, judges whether the data that start most in described ASYNStation are file characteristic head;
Step 10 is asynchronous matching number ASYNMatchCount to be added to 1 if judgment result is that;
Step 11, in the situation that at least one in SYNMatchCount and ASYNMatchCount is greater than preset matching threshold value, judges whether SYNMatchCount equals ASYNMatchCount;
Step 12 is that repeated execution of steps 4 is to step 10 if judgment result is that; If the determination result is NO, judge whether SYNMatchCount is greater than ASYNMatchCount;
Step 13 is that disk is synchronization structure if judgment result is that; If the determination result is NO, disk is asynchronous structure.
Further, described method also comprises:
If SYNMatchCount and ASYNMatchCount are not more than preset matching threshold value, repeated execution of steps 4 is to step 10.
Further, according to described Main Boot Record, obtain data and start sector number, comprising:
Data are set, and to start sector number be 0.
Further, before obtaining Main Boot Record, also comprise:
Search for the Main Boot Record in all disks.
Further, in the situation that not searching described Main Boot Record, synchronous asynchronous situation and the data of by following steps, obtaining left and right structure that described band starts sector number, disk, dish order, disk start sector number;
Obtain described band and start sector number, comprising:
Described band is set, and to start sector number be 0;
Obtain described dish order, comprising:
Obtain the sector number PSN at arbitrary check information place in each disk;
According to (PSN-band starts sector number) %(stripe size * i) dish order when obtaining hypothesis disk and being left structure of the value of/stripe size and the hypothesis disk dish order while being right structure;
In the situation that synchronous, left asynchronous, the right synchronous and right asynchronous structure in a left side for hypothesis disk is all set up, obtain the left and right structure of described disk, synchronous asynchronous situation and the data of disk start sector number, comprising:
Step 21, judges whether the number of described superblock equals 2;
Step 22, if the number of described superblock equals 2, corresponding according to the left and right structure of hypothesis
Dish order is rejected the superblock of verification;
Step 23, according to described dish order, synchronous, left asynchronous, the right synchronous and right asynchronous structure in the left side supposed, obtains the sector number of described superblock skew band starting position;
Step 24, obtains the piece number of the first direct blocks pointed of arbitrary index node, and according to this piece number, obtains the skew sector number that starts sector for band in RAID;
Step 25, the left side of disk of calculating respectively hypothesis according to described skew sector number is synchronous, under left asynchronous, the right synchronous and right asynchronous corresponding dish order of structure, positional information LSYNSation, LASYNSation, RSYNSation and the RASYNSation of the blocks of data information of first direct blocks pointed of index node;
Step 26, judges respectively whether the data of described LSYNSation, LASYNSation, RSYNSation and RASYNSation positional information are file characteristic heads;
Step 27, if the data that start most of above-mentioned arbitrary positional information are file characteristic heads, adds 1 by matching times corresponding to this positional information;
Step 28, when existing certain matching times be greater than other matching times and surpass default matching threshold, the left and right structure of disk corresponding to this matching times and synchronous asynchronous situation are left and right structure and the synchronous asynchronous situations of real disk.
Further, described method also comprises:
When not existing certain matching times to be greater than other matching times, repeat S24 to S27.
On the other hand, the invention provides the Data Recapture Unit of a kind of RAID5 under EXT3 file system, described device comprises:
The first acquiring unit, for obtaining Main Boot Record;
Second acquisition unit, for obtaining superblock information according to described Main Boot Record;
The 3rd acquiring unit, for according to the size of described superblock acquisition of information band;
The 4th acquiring unit, starts sector number for obtain synchronous asynchronous situation and the data of left and right structure that band starts sector number, disk, dish order, disk according to described Main Boot Record;
Data recovery unit, carries out data recovery for start left and right structure, the dish order of sector number, disk according to size, the band of the band that gets, the synchronous asynchronous situation of disk and data start sector number.
The data reconstruction method of RAID5 under EXT3 file system provided by the invention and device, by Obtaining Accurate, comprise that band starts the left and right structure of sector number, stripe size, dish order, disk, the RAID information that the synchronous asynchronous situation of disk and data start sector, and utilize the RAID information getting to carry out data recovery to RAID5, with respect to prior art, method provided by the invention has stronger general applicability, and has higher reverting to power and recover accuracy rate.
 
accompanying drawing explanation
Fig. 1 is the process flow diagram of data reconstruction method the first embodiment of the RAID5 of the present invention under EXT3 file system;
Fig. 2 is the structural representation of Data Recapture Unit the first embodiment of the RAID5 of the present invention under EXT3 file system.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the present invention is further detailed explanation.
Referring to Fig. 1, it is the process flow diagram of data reconstruction method the first embodiment of the RAID5 of the present invention under EXT3 file system.
In the present embodiment, can set in advance file characteristic head storehouse, in this document feature storehouse, comprise file type feature header, such as 0,x52 61 72 21 1A 07 00 are the feature head of compressed file (file that suffix is .RAR), 0xFF F8 is that the feature of picture file (file that suffix is .jpg) is first-class.
The method comprises the steps:
S101, obtains Main Boot Record (being MBR).
Such as, can be by utilizing default MBR characteristic information to search for MBR information in all disks, until find MBR information.
S102, obtains superblock (being SuperBlock) information according to Main Boot Record (being MBR).
Wherein, SuperBlock information can be by utilizing default SuperBlock characteristic information to search for SuperBlock information in all disks.In this example, be to obtain SuperBlock information by MBR information.
Specifically can be, according to the partition information of record in the hard disk partition table in MBR (being DPT), obtain the location determination value D1 of SuperBlock place sector number, wherein, the location determination value of SuperBlock place sector number can be regarded as the approximate range of SuperBlock place sector number.
In this approximate range, utilize default SuperBlock characteristic information to obtain SuperBlock information.
Wherein, the hiding sector number of the EXT3 subregion of D1=MBR place sector number+MBR/(i-1), i is number of disks.Wherein, symbol "+", "-", "/" represent respectively " adding ", " subtracting ", " divided by ", those symbols are also implication for this reason hereinafter.
S103, according to the size of superblock acquisition of information band.
This step specifically can be: the reference position of obtaining index node in SuperBlock (being i-node), and according to the reference position of i-node, obtain the skew sector number of each disk, namely, according to default i-node structure feature information, the position from SuperBlock in all disks starts to search for successively the skew sector number that i-node occurs backward.
After obtaining the skew sector number of all disks, calculate the tolerance of these skew sector numbers, this tolerance value calculating is the size of band.Wherein, in order to improve the big or small accuracy rate of obtaining band, minimum skew sector number can be removed, namely when calculating the tolerance of skew sector number, not comprise the skew sector number of this minimum, because can not determine that the skew sector number of this minimum is the beginning sector of a band.
S104, synchronous asynchronous situation and the data of according to Main Boot Record, obtaining left and right structure that band starts sector number, disk, dish order, disk start sector number.
This step comprise according to MBR obtain step that band starts sector number, according to MBR obtain the left and right structure of disk step, according to MBR obtain dish order step, according to MBR, obtain disk synchronous asynchronous situation step and according to MBR, obtain the step that data start sector number.
Wherein, according to MBR, obtain the step that band starts sector number, can be and according to MBR place sector number, band is set and starts sector number, namely the sector number at MBR place is set to band and starts sector number.
Wherein, the step of obtaining the left and right structure of disk according to MBR, can comprise:
According to the MBR getting, judge whether the number of MBR is 1.
If the number of MBR is 1, obtain arbitrary verification sector number SN of MBR place disk.
Judgement (SN-stripe size) %(stripe size * i) whether the value of/stripe size equals 1, wherein, i=number of disks, symbol " % ", " * " represent respectively " remainder number ", " being multiplied by ", those symbols are also implication for this reason hereinafter.
If judgment result is that to be, this value equals 1, and it is right structure that disk is set; If the determination result is NO, this value is not equal to 1, and it is left structure that disk is set.
If the number of MBR is not 1, there is the MBR information of verification in explanation, needs to reject the MBR information of verification, wherein, rejects the MBR information of verification and can carry out in the following manner:
Obtain the sector number P at arbitrary check information place of MBR place disk mBR; Judgement (P mBR-band starts sector number) %(stripe size * i) whether the value of/stripe size equal 0.
If this value is not equal to 0, this MBR is real MBR, is retained; If this value equals 0, the MBR that this MBR is verification, is rejected.
Wherein, the step of obtaining dish order according to MBR, can comprise:
First obtain the sector number PSN at arbitrary check information place in each disk, then according to the formula of following calculating dial order, obtain dish order.
Can be according to calculating (PSN-band starts sector number) %(stripe size * i) value after/stripe size rounds obtains dish order, wherein, i=number of disks.If disk is right structure, this value value after rounding is identical with dish order, if disk is left structure, just contrary; For example: if disk is right structure, and the value that formula calculates is 0, and this disk is just the 0th dialer.
Wherein, the step of obtaining the synchronous asynchronous situation of disk according to MBR, can comprise:
Step 1, according to the SuperBlock getting, judges whether the number of SuperBlock equals 2.
Step 2, in the situation that the number of superblock equals 2, there is the SuperBlock of verification in explanation, needs the superblock of verification to be rejected.
The method of rejecting can be: first calculate (PSN-band starts sector number) %(stripe size * i) value V after/stripe size rounds, the relation according to V with dish order, the left and right structure of disk, judges whether it is the superblock of verification, wherein, i=number of disks.
Be specially, if disk is right structure V, equal its dish order, be the superblock of verification, otherwise be not the superblock of verification; If disk is left structure V, equal i-dish order-1(namely, number of disks subtracts dish order and subtracts 1), be the superblock of verification, otherwise be not the superblock of verification.
Step 3, supposes that the synchronous and asynchronous situation of disk is all set up, according to dish order calculate SuperBlock for the sector number S of the sector that starts of RAID band superBlock.
Wherein, can be according to the RAID information of having obtained (left and right structure situation, stripe size, beginning sector, band starts sector) and the synchronous asynchronous situation of disk of hypothesis, those skilled in the art can very easily calculate the sector number of the sector that SuperBlock starts for RAID band.
Step 4, obtains i-node record according to default i-node structure feature information, and according to i-node record, reads the piece B of first direct blocks pointed of this i-node inode.
Wherein, i-node comprises that the data of the file that it records stored number (wherein, file may be deposited in a plurality of, in i-node, can comprise a plurality of pointers, to indicate deposit data in which piece), wherein, first pointer just becomes first direct blocks pointer, and the deposit data starting most in this first direct blocks pointer meeting specified document is in which piece.
Step 5, according to S superBlockand B inodecalculate the skew sector number of the data block of first direct blocks pointed.
Wherein, in SuperBlock, block size description value is ntime, this skew sector number can be by calculating S superBlock+ B inode* (2 n * 1024/ each sector byte number)-2 and obtain.
Step 6, according to the skew sector number of the data block of first direct blocks pointed, calculate respectively disk be the sensing under synchronous situation data block positional information SYNSation and at disk the positional information ASYNStation of the data block of the sensing be asynchronous in the situation that.Wherein, positional information comprises the information such as place disk and place sector number.
Step 7, judges whether the data that start most in SYNSation are file characteristic head.
Step 8 is simultaneously match number SYNMatchCount to be added to 1 if judgment result is that.
Step 9, judges whether the data that start most in ASYNStation are file characteristic head.
Step 10 is asynchronous matching number ASYNMatchCount to be added to 1 if judgment result is that.
Step 11, in the situation that at least one in SYNMatchCount and ASYNMatchCount is greater than preset matching threshold value, judges whether SYNMatchCount equals ASYNMatchCount.
Step 12, if judgment result is that and be, SYNMatchCount equals ASYNMatchCount, repeated execution of steps 4 is to step 10, until SYNMatchCount is not equal to ASYNMatchCount.
If the determination result is NO, SYNMatchCount is not equal to ASYNMatchCount, judges whether SYNMatchCount is greater than ASYNMatchCount.
Step 13, if judgment result is that and be, SYNMatchCount is greater than ASYNMatchCount, disk is synchronization structure; If the determination result is NO, SYNMatchCount is less than ASYNMatchCount, and disk is asynchronous structure.
Also having a kind of situation is that SYNMatchCount and ASYNMatchCount are not more than preset matching threshold value, in this case, repeated execution of steps 4 is to step 10, until at least one is greater than preset matching threshold value in SYNMatchCount and ASYNMatchCount.
Wherein, according to MBR, obtaining step that data start sector number can be and data are set to start sector number be 0.
S105, the left and right structure, dish order, the synchronous asynchronous situation of disk and the RAID information that data start sector number that according to the size that comprises band, the band that get, start sector number, disk are carried out data recovery.
In the data reconstruction method embodiment of RAID5 under EXT3 file system provided by the invention, by Obtaining Accurate, comprise that band starts the left and right structure of sector number, stripe size, dish order, disk, the RAID information that the synchronous asynchronous situation of disk and data start sector, and utilize the RAID information getting to carry out data recovery to RAID5, with respect to prior art, this method has stronger general applicability, and has higher reverting to power and recover accuracy rate.
To introduce data reconstruction method the second embodiment of the RAID5 under EXT3 file system of the present invention below, this second embodiment is the improvement on the basis of above-mentioned the first embodiment.
In this second embodiment, before S101, also can comprise the Main Boot Record (be MBR) of search in disk, such as can be by utilizing default MBR characteristic information to search for MBR information in all disks, until search for complete in all disks.
Search for completely, may search MBR, also may search for less than MBR.In search less than MBR in the situation that, the obtain manner of stripe size with above-mentioned in the situation that searching MBR, be identical.
Obtaining the synchronous asynchronous situation of left and right structure that band starts sector number, disk, dish order, disk and data starts sector number etc. and can be undertaken by following steps.
Wherein, obtain the step that band starts sector number, can be: band is set, and to start sector number be 0.
Wherein, obtain the step of dish order, can comprise:
First obtain the sector number PSN at arbitrary check information place in each disk, then according to calculating (PSN-band starts sector number) %(stripe size * i) dish order when obtaining hypothesis disk and being left structure of the value of/stripe size and the hypothesis disk dish order while being right structure.
Can be according to calculating (PSN-band starts sector number) %(stripe size * i) value V after/stripe size rounds, obtains dish order, wherein i=number of disks.When disk is right structure, V is dish order, and when disk is left structure, the dish order of disk is that the i-V-1(value that namely number of disks subtracts after rounding subtracts 1 again).
Wherein, in the situation that synchronous, left asynchronous, the right synchronous and right asynchronous structure in a left side for hypothesis disk is all set up, obtain the left and right structure of disk, the step that the synchronous asynchronous situation of disk and data start sector number can comprise:
Step 21, according to the SuperBlock getting, judges whether the number of SuperBlock equals 2.
Step 22, if the number of SuperBlock equals 2, there is the SuperBlock of verification in explanation,
Can reject according to the dish order of the left and right structural correspondence of the hypothesis of disk the SuperBlock of verification.
The method of rejecting can be: first calculate (PSN-band starts sector number) %(stripe size * i) value V after/stripe size rounds, relation according to V with dish order, the left and right structure of disk, judge whether it is the SuperBlock of verification, i=number of disks wherein, PSN is the sector number at SuperBlock place.
Be specially, if disk is right structure V, equal its dish order, be the SuperBlock of verification, otherwise be not the SuperBlock of verification; If disk is left structure V, equal i-dish order-1, be the SuperBlock of verification, otherwise be not the SuperBlock of verification.
Step 23, the structure synchronous according to a left side for the disk that coils order, supposes, a left side is asynchronous, synchronously right and the right side is asynchronous, obtains the sector number of SuperBlock skew band starting position.
Wherein, according to the RAID information of having obtained, (left and right structure situation, stripe size start sector, band starts sector) and the synchronous asynchronous situation of disk of hypothesis, those skilled in the art can very easily calculate the sector number of the sector that SuperBlock starts for RAID band.
Step 24, obtains the piece number of the first direct blocks pointed of arbitrary index node, and according to this piece number, obtains the skew sector number that starts sector for band in RAID.
Step 25, the left side of disk of calculating respectively hypothesis according to this skew sector number is synchronous, under left asynchronous, the right synchronous and right asynchronous corresponding dish order of structure, positional information LSYNSation, LASYNSation, RSYNSation and the RASYNSation of the blocks of data information of first direct blocks pointed of i-node, wherein, positional information comprises the information such as sector at place disk and place.
Step 26, judges respectively whether the data that start most of LSYNSation, LASYNSation, RSYNSation and RASYNSation positional information are file characteristic heads.
Step 27, if the data of any information are file characteristic head in above-mentioned four positional informations, adds 1 by matching times corresponding to this positional information.Wherein, LSYNSation, LASYNSation, RSYNSation and corresponding matching times LSYNMatch, LASYNMatch, the RSYNMatch of RASYNSation difference, namely in LSYNSation, LASYNSation, RSYNSation and RASYNSation, the data that start most of any are file characteristic head, matching times corresponding to this positional information are added to 1.
Step 28, when existing certain matching times be greater than other matching times and surpass default matching threshold, left and right structure and the synchronous asynchronous situation of disk corresponding to this matching times are set up, and get left and right structure and the synchronous asynchronous situation of real disk.
Also having a kind of situation is not exist certain matching times to be greater than other matching times, in this case, repeat S24 to S27, until the matching times of arbitrary positional information is greater than the matching times of other positional informations and surpasses default matching threshold, and then get left and right structure and the synchronous asynchronous situation of real disk.
In addition shown in Fig. 2, be the structural representation of Data Recapture Unit the first embodiment of the RAID5 of the present invention under EXT3 file system.
The present invention also provides the Data Recapture Unit of a kind of RAID5 under EXT3 file system, and as shown in Figure 2, this device comprises:
The first acquiring unit 31, for obtaining Main Boot Record.
Second acquisition unit 32, for obtaining superblock information according to described Main Boot Record.
The 3rd acquiring unit 33, for according to the size of described superblock acquisition of information band.
The 4th acquiring unit 34, starts sector number for obtain synchronous asynchronous situation and the data of left and right structure that band starts sector number, disk, dish order, disk according to described Main Boot Record.
Data recovery unit 35, carries out data recovery for start left and right structure, the dish order of sector number, disk according to size, the band of the band that gets, the synchronous asynchronous situation of disk and data start sector number.
In the Data Recapture Unit embodiment of RAID5 under EXT3 file system provided by the invention, by Obtaining Accurate, comprise that band starts the left and right structure of sector number, stripe size, dish order, disk, the RAID information that the synchronous asynchronous situation of disk and data start sector, and utilize the RAID information getting to carry out data recovery to RAID5, with respect to prior art, this method has stronger general applicability, and has higher reverting to power and recover accuracy rate.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Above to the data reconstruction method of a kind of RAID5 under EXT3 file system provided by the present invention and device, be described in detail, applied specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.

Claims (14)

1. a data reconstruction method of the RAID5 under EXT3 file system, is characterized in that, the method comprises:
Obtain Main Boot Record;
According to described Main Boot Record, obtain superblock information;
According to the size of described superblock acquisition of information band;
Synchronous asynchronous situation and the data of according to described Main Boot Record, obtaining left and right structure that band starts sector number, disk, dish order, disk start sector number;
According to the size of the band getting, band, start the left and right structure of sector number, disk and carry out data recovery, the synchronous asynchronous situation of dish order, disk and data start sector number.
2. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 1, is characterized in that, according to described Main Boot Record, obtains superblock information, comprising:
According to the location determination value D1 of superblock place sector number described in the hard disk partition table acquisition of information in described Main Boot Record;
According to described D1, obtain superblock information;
Wherein, the hiding sector number of the EXT3 subregion of D1=Main Boot Record place sector number+Main Boot Record/(i-1);
I is number of disks.
3. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 1, is characterized in that, the size according to described superblock acquisition of information band, comprising:
Obtain the reference position of index node in described superblock;
According to the reference position of described index node, obtain the skew sector number of each disk;
According to the tolerance of the skew sector number of all disks, obtain the size of band.
4. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 3, is characterized in that, obtains band start sector number according to described Main Boot Record, comprising:
The sector number that described Main Boot Record place is set is that band starts sector number.
5. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 4, is characterized in that, obtains the left and right structure of disk according to described Main Boot Record, comprising:
Whether the number that judges described Main Boot Record is 1;
If the number of described Main Boot Record is 1, obtain arbitrary verification sector number SN of Main Boot Record place disk;
Judgement (SN-stripe size) %(stripe size * i) whether the value of/stripe size equals 1, i=number of disks;
If judgment result is that to be, it is right structure that disk is set; If the determination result is NO, it is left structure that disk is set.
6. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 5, is characterized in that, also comprises:
If the number of described Main Boot Record is not 1, obtain the sector number P at arbitrary check information place of Main Boot Record place disk mBR;
Judgement (P mBR-band starts sector number) %(stripe size * i) whether the value of/stripe size equal 0;
If be not equal to 0, this Main Boot Record is real Main Boot Record; If equal 0, the Main Boot Record that this Main Boot Record is verification;
Reject the Main Boot Record of verification.
7. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 5, is characterized in that, according to described Main Boot Record, obtains dish order, comprising:
Obtain the sector number PSN at arbitrary check information place in each disk;
According to calculating (PSN-band starts sector number) %(stripe size * i) value after/stripe size rounds obtains dish order;
Wherein, i=number of disks.
8. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 7, is characterized in that, obtains the synchronous asynchronous situation of disk according to described Main Boot Record, comprising:
Step 1, judges whether the number of superblock equals 2;
Step 2, if the number of superblock equals 2, rejects the superblock of verification;
Step 3, according to described dish order calculate superblock for the sector number S of the sector that starts of RAID band superBlock;
Step 4, obtains index node record according to the structure feature information of default index node, and according to index node record, obtains the piece B of first direct blocks pointed of this index node inode;
Step 5, according to described S superBlockand B inodecalculate the skew sector number of the data block of first direct blocks pointed;
Step 6, according to the skew sector number of the data block of described first direct blocks pointed, calculate respectively disk be described first direct blocks pointed under synchronous situation data block positional information SYNSation and at disk the positional information ASYNStation of the data block of described first direct blocks pointed be asynchronous in the situation that;
Step 7, judges whether the data that start most in described SYNSation are file characteristic head;
Step 8 is simultaneously match number SYNMatchCount to be added to 1 if judgment result is that;
Step 9, judges whether the data that start most in described ASYNStation are file characteristic head;
Step 10 is asynchronous matching number ASYNMatchCount to be added to 1 if judgment result is that;
Step 11, in the situation that at least one in SYNMatchCount and ASYNMatchCount is greater than preset matching threshold value, judges whether SYNMatchCount equals ASYNMatchCount;
Step 12 is that repeated execution of steps 4 is to step 10 if judgment result is that; If the determination result is NO, judge whether SYNMatchCount is greater than ASYNMatchCount;
Step 13 is that disk is synchronization structure if judgment result is that; If the determination result is NO, disk is asynchronous structure.
9. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 8, is characterized in that, also comprises:
If SYNMatchCount and ASYNMatchCount are not more than preset matching threshold value, repeated execution of steps 4 is to step 10.
10. the data reconstruction method of the RAID5 under EXT3 file system as claimed in claim 1, is characterized in that, obtains data start sector number according to described Main Boot Record, comprising:
Data are set, and to start sector number be 0.
The data reconstruction method of 11. RAID5 under EXT3 file system as claimed in claim 1, is characterized in that, before obtaining Main Boot Record, also comprises:
Search for the Main Boot Record in all disks.
The data reconstruction method of 12. RAID5 under EXT3 file system as claimed in claim 11, it is characterized in that, in the situation that not searching described Main Boot Record, synchronous asynchronous situation and the data of by following steps, obtaining left and right structure that described band starts sector number, disk, dish order, disk start sector number;
Obtain described band and start sector number, comprising:
Described band is set, and to start sector number be 0;
Obtain described dish order, comprising:
Obtain the sector number PSN at arbitrary check information place in each disk;
According to (PSN-band starts sector number) %(stripe size * i) dish order when obtaining hypothesis disk and being left structure of the value of/stripe size and the hypothesis disk dish order while being right structure;
In the situation that synchronous, left asynchronous, the right synchronous and right asynchronous structure in a left side for hypothesis disk is all set up, obtain the left and right structure of described disk, synchronous asynchronous situation and the data of disk start sector number, comprising:
Step 21, judges whether the number of described superblock equals 2;
Step 22, if the number of described superblock equals 2, corresponding according to the left and right structure of hypothesis
Dish order is rejected the superblock of verification;
Step 23, according to described dish order, synchronous, left asynchronous, the right synchronous and right asynchronous structure in the left side supposed, obtains the sector number of described superblock skew band starting position;
Step 24, obtains the piece number of the first direct blocks pointed of arbitrary index node, and according to this piece number, obtains the skew sector number that starts sector for band in RAID;
Step 25, the left side of disk of calculating respectively hypothesis according to described skew sector number is synchronous, under left asynchronous, the right synchronous and right asynchronous corresponding dish order of structure, positional information LSYNSation, LASYNSation, RSYNSation and the RASYNSation of the blocks of data information of first direct blocks pointed of index node;
Step 26, judges respectively whether the data of described LSYNSation, LASYNSation, RSYNSation and RASYNSation positional information are file characteristic heads;
Step 27, if the data that start most of above-mentioned arbitrary positional information are file characteristic heads, adds 1 by matching times corresponding to this positional information;
Step 28, when existing certain matching times be greater than other matching times and surpass default matching threshold, the left and right structure of disk corresponding to this matching times and synchronous asynchronous situation are left and right structure and the synchronous asynchronous situations of real disk.
The data reconstruction method of 13. RAID5 under EXT3 file system as claimed in claim 12, is characterized in that, also comprises:
When not existing certain matching times to be greater than other matching times, repeat S24 to S27.
The Data Recapture Unit of 14. 1 kinds of RAID5 under EXT3 file system, is characterized in that, this device comprises:
The first acquiring unit, for obtaining Main Boot Record;
Second acquisition unit, for obtaining superblock information according to described Main Boot Record;
The 3rd acquiring unit, for according to the size of described superblock acquisition of information band;
The 4th acquiring unit, starts sector number for obtain synchronous asynchronous situation and the data of left and right structure that band starts sector number, disk, dish order, disk according to described Main Boot Record;
Data recovery unit, carries out data recovery for start left and right structure, the dish order of sector number, disk according to size, the band of the band that gets, the synchronous asynchronous situation of disk and data start sector number.
CN201310739833.5A 2013-12-30 2013-12-30 The data reconstruction method of the RAID5 under EXT3 file system and device Active CN103678044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310739833.5A CN103678044B (en) 2013-12-30 2013-12-30 The data reconstruction method of the RAID5 under EXT3 file system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310739833.5A CN103678044B (en) 2013-12-30 2013-12-30 The data reconstruction method of the RAID5 under EXT3 file system and device

Publications (2)

Publication Number Publication Date
CN103678044A true CN103678044A (en) 2014-03-26
CN103678044B CN103678044B (en) 2016-08-17

Family

ID=50315689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310739833.5A Active CN103678044B (en) 2013-12-30 2013-12-30 The data reconstruction method of the RAID5 under EXT3 file system and device

Country Status (1)

Country Link
CN (1) CN103678044B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104794017A (en) * 2015-04-27 2015-07-22 四川效率源信息安全技术有限责任公司 Data recovery method for RAID5 with odd number of disks
CN104866241A (en) * 2015-05-28 2015-08-26 四川效率源信息安全技术有限责任公司 Data recovery method for RAID6
CN104991926A (en) * 2015-06-29 2015-10-21 浪潮(北京)电子信息产业有限公司 File system recovery method and system
CN106155845A (en) * 2016-08-02 2016-11-23 四川效率源信息安全技术股份有限公司 A kind of restructuring restoration methods based on XFS file system data
CN108090168A (en) * 2017-12-14 2018-05-29 厦门市美亚柏科信息股份有限公司 A kind of general F2FS file system analytic method, terminal device and storage medium
CN108153604A (en) * 2017-12-29 2018-06-12 四川巧夺天工信息安全智能设备有限公司 A kind of method for restoring deleted file in F2FS file system
CN110532136A (en) * 2019-08-30 2019-12-03 四川效率源信息安全技术股份有限公司 A kind of raid data reconstruction method based on metadata
CN110659160A (en) * 2019-09-06 2020-01-07 厦门市美亚柏科信息股份有限公司 RAID5 data recovery method, device, system and storage medium
CN111400103A (en) * 2020-03-23 2020-07-10 北亚企安科技(北京)有限公司 Data recovery method for infotrend storage
CN111752765A (en) * 2020-05-28 2020-10-09 苏州浪潮智能科技有限公司 Method and system for recovering damaged data of RAID5

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5088081A (en) * 1990-03-28 1992-02-11 Prime Computer, Inc. Method and apparatus for improved disk access
US20020073279A1 (en) * 2000-12-08 2002-06-13 Kabushiki Kaisha Toshiba Method for regenerating data in disk array
CN101840360A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Rapid reconstruction method and device of RAID (Redundant Array of Independent Disk) system
CN101984399A (en) * 2010-10-29 2011-03-09 中兴通讯股份有限公司 Management method and system of soft redundant array of independent disk
CN103150233A (en) * 2013-03-18 2013-06-12 厦门市美亚柏科信息股份有限公司 Data recovery method of RAID-5
CN103268269A (en) * 2013-05-09 2013-08-28 厦门市美亚柏科信息股份有限公司 Data recovery method for RAID-5 (redundant array of independent disks 5)
CN103309773A (en) * 2013-07-03 2013-09-18 厦门市美亚柏科信息股份有限公司 Data recovery method of RAID0 under EXT3 file system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5088081A (en) * 1990-03-28 1992-02-11 Prime Computer, Inc. Method and apparatus for improved disk access
US20020073279A1 (en) * 2000-12-08 2002-06-13 Kabushiki Kaisha Toshiba Method for regenerating data in disk array
CN101840360A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Rapid reconstruction method and device of RAID (Redundant Array of Independent Disk) system
CN101984399A (en) * 2010-10-29 2011-03-09 中兴通讯股份有限公司 Management method and system of soft redundant array of independent disk
CN103150233A (en) * 2013-03-18 2013-06-12 厦门市美亚柏科信息股份有限公司 Data recovery method of RAID-5
CN103268269A (en) * 2013-05-09 2013-08-28 厦门市美亚柏科信息股份有限公司 Data recovery method for RAID-5 (redundant array of independent disks 5)
CN103309773A (en) * 2013-07-03 2013-09-18 厦门市美亚柏科信息股份有限公司 Data recovery method of RAID0 under EXT3 file system

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104794017B (en) * 2015-04-27 2018-05-04 四川效率源信息安全技术股份有限公司 A kind of data reconstruction method for odd number disk RAID5
CN104794017A (en) * 2015-04-27 2015-07-22 四川效率源信息安全技术有限责任公司 Data recovery method for RAID5 with odd number of disks
CN104866241A (en) * 2015-05-28 2015-08-26 四川效率源信息安全技术有限责任公司 Data recovery method for RAID6
CN104991926A (en) * 2015-06-29 2015-10-21 浪潮(北京)电子信息产业有限公司 File system recovery method and system
CN106155845A (en) * 2016-08-02 2016-11-23 四川效率源信息安全技术股份有限公司 A kind of restructuring restoration methods based on XFS file system data
CN108090168B (en) * 2017-12-14 2021-01-12 厦门市美亚柏科信息股份有限公司 Universal F2FS file system parsing method, terminal device and storage medium
CN108090168A (en) * 2017-12-14 2018-05-29 厦门市美亚柏科信息股份有限公司 A kind of general F2FS file system analytic method, terminal device and storage medium
CN108153604B (en) * 2017-12-29 2021-03-02 四川巧夺天工信息安全智能设备有限公司 Method for recovering deleted files in F2FS file system
CN108153604A (en) * 2017-12-29 2018-06-12 四川巧夺天工信息安全智能设备有限公司 A kind of method for restoring deleted file in F2FS file system
CN110532136A (en) * 2019-08-30 2019-12-03 四川效率源信息安全技术股份有限公司 A kind of raid data reconstruction method based on metadata
CN110532136B (en) * 2019-08-30 2023-05-02 四川效率源信息安全技术股份有限公司 Raid data recovery method based on metadata
CN110659160A (en) * 2019-09-06 2020-01-07 厦门市美亚柏科信息股份有限公司 RAID5 data recovery method, device, system and storage medium
CN110659160B (en) * 2019-09-06 2022-05-20 厦门市美亚柏科信息股份有限公司 RAID5 data recovery method, device, system and storage medium
CN111400103A (en) * 2020-03-23 2020-07-10 北亚企安科技(北京)有限公司 Data recovery method for infotrend storage
CN111400103B (en) * 2020-03-23 2023-03-14 北亚企安科技(北京)有限公司 Data recovery method for infotrend storage
CN111752765A (en) * 2020-05-28 2020-10-09 苏州浪潮智能科技有限公司 Method and system for recovering damaged data of RAID5

Also Published As

Publication number Publication date
CN103678044B (en) 2016-08-17

Similar Documents

Publication Publication Date Title
CN103678044A (en) Data recovery method and device of RAID5 in EXT3 file system
CN107766575B (en) Read-write separation database access method and device
US10002142B2 (en) Method and apparatus for generating schema of non-relational database
CN104484131B (en) The data processing equipment of multiple disks server and corresponding processing method
CN104090882A (en) Method, system and server for fast clustering advertising orders
CN105260464A (en) Data storage structure conversion method and apparatus
CN104809250B (en) A kind of loose formula data consistency verification method
CN105763205A (en) Spiral interleaver parameter blind estimation method based on Gauss column elimination
CN107957918A (en) Data reconstruction method and device
CN104636401A (en) Data rollback method and device for SCADA system
CN102201882B (en) Blind identification method for coding parameters of linear block codes
CN103150233B (en) A kind of data reconstruction method of RAID-5
CN107436938B (en) The additional log analytic method of image before a kind of relational database
CN104461774A (en) Asynchronous replication method, device and system
CN104283932A (en) File synchronization system and method
CN113377580A (en) Method for repairing overflow and error code detection of ground-based telemetry data frame counting
CN103268269B (en) The data reconstruction method of RAID-5
CN116319815B (en) Cloud data placement policy management system introducing SaaS features
CN110765321B (en) Data storage path generation method and device and readable storage medium
CN105302889B (en) The conversion method and device of data store organisation
CN116989973A (en) Temporary impact type high-speed wind tunnel continuous variable attack angle pressure measurement test data processing method
CN103309773B (en) The data reconstruction method of the RAID0 under EXT3 file system
CN103177112A (en) Backup file browsing system
CN106599326B (en) Recorded data duplication eliminating processing method and system under cloud architecture
CN104615948A (en) Method for automatically recognizing file completeness and restoring

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20170322

Address after: View of the road Xiamen city Fujian province 361000 Software Park No. 14

Patentee after: Xiamen Information Security Research Institute Co., Ltd.

Address before: AIU Cupressaceae No. 12 building, 361008 Fujian province Xiamen software park two sunrise Road

Patentee before: Xiamen Meiya Pico Information Co., Ltd.

TR01 Transfer of patent right