[go: up one dir, main page]

CN103268269A - Data Recovery Method of RAID-5 - Google Patents

Data Recovery Method of RAID-5 Download PDF

Info

Publication number
CN103268269A
CN103268269A CN2013101683222A CN201310168322A CN103268269A CN 103268269 A CN103268269 A CN 103268269A CN 2013101683222 A CN2013101683222 A CN 2013101683222A CN 201310168322 A CN201310168322 A CN 201310168322A CN 103268269 A CN103268269 A CN 103268269A
Authority
CN
China
Prior art keywords
disk
sector
mft
dbr
mbr
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
CN2013101683222A
Other languages
Chinese (zh)
Other versions
CN103268269B (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 CN201310168322.2A priority Critical patent/CN103268269B/en
Publication of CN103268269A publication Critical patent/CN103268269A/en
Application granted granted Critical
Publication of CN103268269B publication Critical patent/CN103268269B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data recovery method for RAID-5 (redundant array of independent disks 5). The method includes: acquiring a MBR (master boot record); judging whether a file record number exists or not; if not, acquiring an SSN (strip size number), and according to the MBR, acquiring an SSS (strip starting sector), left-right structure of disks, disk sequence, synchronous and asynchronous conditions of the disks, and a data starting sector BSN; and performing data recovery according to the SSN, the SSS, the left-right structure of disks, the disk sequence, the synchronous and asynchronous conditions of the disks, and the data darting sector BSN. The method has the advantages that RAID information of the RAID-5 can be analyzed accurately and data is recovered with the RAID information while no file record number exists in an NTFS (new technology file system), and accordingly the problems of low accuracy, low success rate and poor universality in the existing RAID-5 data recovery method are solved.

Description

RAID-5的数据恢复方法Data Recovery Method of RAID-5

技术领域 technical field

 本发明涉及数据恢复领域,特别地,涉及一种RAID-5的数据恢复方法。 The present invention relates to the field of data recovery, in particular, to a RAID-5 data recovery method.

背景技术 Background technique

独立冗余磁盘阵列(Redundant Array of Independent Disks,RAID),是指通过RAID控制器以硬件或软件的方式将多台实体磁盘驱动器结合成一台大容量的虚拟磁盘驱动器。RAID的基本原理是利用位带(Bit Striping)及目前主流的区块带(Block Striping)的分割方式,将相同的数据分散存储至各磁盘驱动器中的不同数据块(Data Blocks),以在任一磁盘驱动器的数据块受损时,通过XOR运算对存储在其他磁盘驱动器内的校验磁盘分段(Parity Blocks)及数据块内的数据进行比对及运算,以重建(Rebuild)受损的数据。 Redundant Array of Independent Disks (RAID) refers to combining multiple physical disk drives into a large-capacity virtual disk drive in hardware or software through a RAID controller. The basic principle of RAID is to use Bit Striping (Bit Striping) and the current mainstream Block Striping (Block Striping) segmentation method to disperse and store the same data into different data blocks (Data Blocks) in each disk drive. When the data block of the disk drive is damaged, the XOR operation is used to compare and calculate the parity disk segments (Parity Blocks) and the data in the data block stored in other disk drives to reconstruct (Rebuild) the damaged data .

由于将数据存储于RAID时,通过多台实体磁盘驱动器上的多个读写头执行数据的存储动作,因此,不仅其写入数据的速度相当快,且因相同数据存储在多台实体磁盘驱动器驱动器中不同的数据块位置,RAID也具备数据的容错功能,为数据存储提供的较佳的安全保障。 When data is stored in RAID, data storage is performed by multiple read-write heads on multiple physical disk drives. Therefore, not only the speed of writing data is very fast, but also because the same data is stored in multiple physical disk drives. For different data block positions in the drive, RAID also has data fault tolerance function, which provides better security guarantee for data storage.

目前,普遍使用的RAID主要包括RAID-0,RAID-1,RAID-1E,RAID-5,RAID-6,RAID-7,RAID-10,RAID-50等。其中,由于RAID-5兼顾了存储性能、数据安全和存储成本等方面,因此其使用最为广泛。 Currently, commonly used RAID mainly includes RAID-0, RAID-1, RAID-1E, RAID-5, RAID-6, RAID-7, RAID-10, RAID-50, etc. Among them, RAID-5 is the most widely used because it takes into account storage performance, data security, and storage cost.

但是,当RAID-5的RAID控制器出现物理故障导致RAID信息出错或人为误操作将配置信息丢失时,将导致RAID-5逻辑盘丢失或不可访问。一旦出现上述情况,将导致磁盘数据的丢失和损坏,其损失往往相当严重。在上述情况下,需要对RAID-5进行数据恢复。数据恢复的关键点在于对RAID结构进行分析以获得RAID信息,一旦RAID信息恢复,则根据其信息读取磁盘中的数据,从而达到对RAID-5的数据恢复。 However, when the RAID controller of RAID-5 has a physical failure and causes RAID information to be wrong or configuration information is lost due to human misoperation, the RAID-5 logical disk will be lost or inaccessible. Once the above situation occurs, it will lead to the loss and damage of disk data, and the loss is often quite serious. In the above cases, data recovery for RAID-5 is required. The key point of data recovery is to analyze the RAID structure to obtain RAID information. Once the RAID information is recovered, read the data in the disk according to the information, so as to achieve the data recovery of RAID-5.

目前,使用Windows操作系统的服务器大多都采用NTFS文件系统,对NTFS文件系统下的RAID-5数据恢复主要是利用某些工具进行手动恢复,如专业人员利用WinHex并依据NTFS文件系统的特征将RAID信息恢复,但是该方法存在偶然性和极强的专业性,不具有普遍的适用性。另外,也有通过软件对RAID结构进行分析,如RAID Reconstructor,但是该类软件对RAID结构分析的准确率极低,从而造成数据恢复成功率较低。此外,也有通过文件记录编号对RAID信息进行分析,再通过RAID信息进行数据恢复的,但在NTFS文件系统中没有文件记录编号的情况下,是无法进行操作的。 At present, most of the servers using the Windows operating system use the NTFS file system. The recovery of RAID-5 data under the NTFS file system is mainly to use some tools for manual recovery. Information recovery, but this method is accidental and highly professional, and does not have universal applicability. In addition, there are also software to analyze the RAID structure, such as RAID Reconstructor, but the accuracy rate of this type of software for RAID structure analysis is extremely low, resulting in a low success rate of data recovery. In addition, it is also possible to analyze the RAID information through the file record number, and then perform data recovery through the RAID information, but it cannot be operated without the file record number in the NTFS file system.

发明内容 Contents of the invention

本发明所要解决的技术问题是提供一种RAID-5的数据恢复方法,在NTFS文件系统没有文件记录编号的情况下,通过准确的分析出RAID-5的RAID信息,并利用RAID信息进行数据恢复,以解决现有RAID-5数据恢复方法准确率低,成功率低和普适性差的问题。 The technical problem to be solved by the present invention is to provide a data recovery method of RAID-5. Under the situation that the NTFS file system does not have a file record number, the RAID information of RAID-5 can be accurately analyzed, and data recovery can be performed using the RAID information. , to solve the problems of low accuracy, low success rate and poor universality of existing RAID-5 data recovery methods.

本发明提出一种RAID-5的数据恢复方法,包括: The present invention proposes a data recovery method of RAID-5, comprising:

获取主引导记录MBR; Get the master boot record MBR;

判断是否有文件记录编号; Determine whether there is a file record number;

如果判断结果为否,则获取条带大小SSN,且根据所述MBR获取条带开始扇区SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和数据开始扇区BSN; If the judgment result is no, then obtain the stripe size SSN, and obtain the stripe start sector SSS, the left and right structure of the disk, the disk sequence, the synchronization and asynchronous situation of the disk and the data start sector BSN according to the MBR;

根据所述SSN、SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和BSN进行数据恢复。 Data recovery is performed according to the SSN, SSS, left and right structure of the disk, disk sequence, synchronous and asynchronous conditions of the disk, and BSN.

进一步的,判断是否有文件记录编号的步骤具体为: Further, the steps for judging whether there is a file record number are specifically as follows:

根据所述MBR获取文件记录MFT; Obtaining a file record MFT according to the MBR;

根据所述MFT判断是否有文件记录编号。 Determine whether there is a file record number according to the MFT.

进一步的,根据所述MBR获取条带开始扇区SSS的步骤具体为: Further, the step of obtaining the stripe start sector SSS according to the MBR is specifically:

获取所述MBR所在扇区SNMBRObtain the SN MBR of the sector where the MBR is located;

设置条带开始扇区为SNMBRSet the stripe start sector to SN MBR .

进一步的,根据所述MBR获取磁盘的左右结构的步骤具体为: Further, the step of obtaining the left and right structures of the disk according to the MBR is specifically:

判断所述MBR的个数是否为1; Judging whether the number of the MBR is 1;

如果判断结果为否,则剔除校验的MBR; If the judgment result is no, the verified MBR is removed;

如果判断结果为是,则获取MBR所在磁盘的任一校验信息所在的扇区SN; If the judgment result is yes, obtain the sector SN where any verification information of the disk where the MBR is located;

根据(SN-SNMBR)%(SSN×i)/SSN的值获取磁盘的左右结构; Obtain the left and right structures of the disk according to the value of (SN-SN MBR )%(SSN×i)/SSN;

其中,i 为磁盘数量。 where i is the number of disks.

进一步的,获取条带大小SSN的步骤具体为: Further, the steps for obtaining the stripe size SSN are as follows:

获取NTFS分区的DOS引导记录DBR; Obtain the DOS boot record DBR of the NTFS partition;

根据所述DBR获取主文件表$MFT所在扇区的位置判定值D1Obtain the position judgment value D1 of the sector where the master file table $MFT is located according to the DBR;

根据所述$MFT的第一参数获取文件记录MFT较多的区域RMFTAccording to the first parameter of the $MFT, obtain the region RMFT with more file record MFTs ;

在RMFT内获取第n个磁盘第一次出现校验信息P的扇区PSn;  Obtain the sector PSn where the verification information P appears for the first time on the nth disk in the RMFT ;

根据所述PSn获取条带大小SSN; Obtain the stripe size SSN according to the PSn;

其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1); Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1);

其中,i为磁盘数量,1≤n≤i。 Wherein, i is the number of disks, 1≤n≤i.

进一步的,获取NTFS分区的DOS引导记录DBR的步骤具体为: Further, the steps for obtaining the DOS boot record DBR of the NTFS partition are as follows:

根据所述MBR中的硬盘分区表DPT获取所述DBR所在扇区的位置判定值D2According to the hard disk partition table DPT in the MBR, obtain the position judgment value D 2 of the sector where the DBR is located;

根据所述判定值D2获取所述DBR所在扇区的位置; Acquire the location of the sector where the DBR is located according to the decision value D2 ;

其中,D2= SNMBR +MBR中的NFTS分区的隐藏扇区数/(i-1)。 Among them, D 2 = number of hidden sectors of SN MBR + NFTS partition in MBR / (i-1).

进一步的,根据所述MBR获取盘序的步骤具体为: Further, the step of obtaining the disk sequence according to the MBR is specifically:

根据(PSn- SNMBR)%(SSN×i)的值获取盘序。 Obtain the disk sequence according to the value of (PSn- SN MBR )%(SSN×i).

进一步的,根据所述MBR获取磁盘的同步异步情况的步骤具体为: Further, the steps for obtaining the synchronous and asynchronous conditions of the disk according to the MBR are as follows:

根据所述盘序、条带开始扇区和$MFT的第一参数获取MFT数据流结束位置所在的扇区; Obtain the sector where the end position of the MFT data stream is located according to the disk sequence, the stripe start sector, and the first parameter of $MFT;

根据所述MFT数据流结束位置所在的扇区判断是否能获取磁盘的同步异步情况; According to the sector where the end position of the MFT data stream is located, it is judged whether the synchronous and asynchronous situation of the disk can be obtained;

如果判断结果为是,则根据所述MFT数据流结束位置所在的扇区获取磁盘的同步异步情况。 If the judgment result is yes, the synchronous and asynchronous conditions of the disk are obtained according to the sector where the end position of the MFT data stream is located.

进一步的,本发明的方法还包括: Further, the method of the present invention also includes:

在根据所述MFT数据流结束位置所在的扇区判断出不能获取磁盘的同步异步情况下,进行如下步骤获取磁盘的同步异步情况: When it is judged that the asynchronous situation of the disk cannot be obtained according to the sector where the MFT data stream end position is located, the following steps are performed to obtain the asynchronous situation of the disk:

假设磁盘为同步,并判断所述MFT的第二参数的文件后缀名是否与$MFT的第一参数的数据特征头匹配; Assume that the disk is synchronous, and judge whether the file suffix name of the second parameter of the MFT matches the data signature header of the first parameter of $MFT;

如果判断结果为否,则判定磁盘为异步; If the judgment result is no, it is judged that the disk is asynchronous;

如果判断结果为是,则假设磁盘为异步,并判断所述MFT的第二参数的文件后缀名是否与第一参数的数据特征头匹配; If the judgment result is yes, it is assumed that the disk is asynchronous, and it is judged whether the file suffix name of the second parameter of the MFT matches the data signature header of the first parameter;

如果判断结果为否,则判定磁盘为同步; If the judgment result is no, it is judged that the disk is synchronous;

如果判断结果为是,则获取下个MFT并重复上述步骤,直至获取到正确的磁盘同步异步情况或获取不到所述MFT为止。 If the judgment result is yes, the next MFT is obtained and the above steps are repeated until the correct disk synchronization and asynchronous conditions are obtained or the MFT cannot be obtained.

进一步的,获取数据开始扇区BSN的步骤具体为: Further, the steps of obtaining the data start sector BSN are specifically:

设置数据开始扇区BSN为0。 Set data start sector BSN to 0.

进一步的,在所述获取主引导记录MBR之前,还包括如下步骤: Further, before obtaining the master boot record MBR, the following steps are also included:

搜索磁盘中的主引导记录MBR。 Search the disk for the Master Boot Record MBR.

进一步的,在没有搜索到所述MBR的情况下,通过以下步骤获取所述SSN、SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和BSN,其中: Further, if the MBR is not found, the SSN, SSS, the left and right structure of the disk, the disk sequence, the synchronous and asynchronous conditions of the disk and the BSN are obtained through the following steps, wherein:

获取所述SSN的步骤具体为: The steps for obtaining the SSN are as follows:

获取NTFS分区的DOS引导记录DBR; Obtain the DOS boot record DBR of the NTFS partition;

根据所述DBR获取主文件表$MFT所在扇区的位置判定值D1Obtain the position judgment value D1 of the sector where the master file table $MFT is located according to the DBR;

根据所述$MFT的第一参数获取文件记录MFT较多的区域RMFTAccording to the first parameter of the $MFT, obtain the region RMFT with more file record MFTs ;

在RMFT内获取第n个磁盘第一次出现校验信息P的扇区PSn;  Obtain the sector PSn where the verification information P appears for the first time on the nth disk in the RMFT ;

根据所述PSn获取条带大小SSN; Obtain the stripe size SSN according to the PSn;

其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1); Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1);

获取所述SSS的步骤具体为: The steps for obtaining the SSS are as follows:

判断RAID-5是否由动态磁盘组成; Determine whether RAID-5 is composed of dynamic disks;

如果判断结果为是,则设置条带开始扇区为第一个NTFS文件系统分区开始 If the judgment result is yes, set the stripe start sector to the start of the first NTFS file system partition

所在的扇区; the sector in which it is located;

如果判断结果为否,则设置SSS为0; If the judgment result is no, set SSS to 0;

获取所述磁盘的盘序、左右结构和同步异步情况的步骤,具体为: The steps for obtaining the disk sequence, left-right structure, and synchronous and asynchronous conditions of the disk are as follows:

根据PSn%(SSN×i)/SSN的值获取磁盘的盘序; Obtain the disk sequence of the disk according to the value of PSn%(SSN×i)/SSN;

根据所述$MFT的第一参数获取MFT数据流结束位置所在的扇区; Obtain the sector where the MFT data stream ends according to the first parameter of the $MFT;

根据所述MFT数据流结束位置所在扇区判断是否能获取磁盘的左右结构和同步异步情况; According to the sector where the end position of the MFT data stream is located, it is judged whether the left and right structure and the synchronous and asynchronous situation of the disk can be obtained;

如果判断结果为是,则根据所述MFT数据流结束位置所在扇区获取磁盘左右结构和同步异步情况,在获取所述左右结构和/或同步异步情况失败的情况下,根据所述MFT的第二参数的文件后缀名与$MFT的第一参数的数据特征头是否相匹配的情况,获取正确的磁盘左右结构和同步异步情况;  If the judgment result is yes, then obtain the disk left and right structure and synchronous and asynchronous situation according to the sector where the end position of the MFT data stream is located; Whether the file suffix name of the second parameter matches the data characteristic header of the first parameter of $MFT, and obtain the correct left and right disk structure and synchronous and asynchronous conditions;

如果判断结果为否,则根据所述MFT的第二参数的文件后缀名与第一参数的数据特征头是否相匹配的情况,获取正确的磁盘左右结构和同步异步情况; If the judgment result is no, then according to the situation of whether the file suffix name of the second parameter of the MFT matches the data characteristic head of the first parameter, obtain the correct left and right disk structure and synchronous asynchronous situation;

获取所述BSN的步骤具体为: The specific steps for obtaining the BSN are as follows:

若磁盘为右结构,则判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于DBR所在盘的盘序; If the disk is a right structure, then judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence of the disk where the DBR is located;

如果判断结果为是,则所述DBR为校验的DBR并进行剔除; If the judgment result is yes, the DBR is a checked DBR and eliminated;

如果判断结果为否,则所述DBR中隐藏的扇区数为所述BSN; If the judgment result is no, the number of sectors hidden in the DBR is the BSN;

若磁盘为左结构,则判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于N-DBR所在盘的盘序-1; If the disk is of the left structure, then judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence of the disk where the N-DBR is located-1;

如果判断结果为是,则所述DBR为校验的DBR并进行剔除; If the judgment result is yes, the DBR is a checked DBR and eliminated;

如果判断结果为否,则所述DBR中隐藏的扇区数为所述BSN; If the judgment result is no, the number of sectors hidden in the DBR is the BSN;

其中,i为磁盘数量,1≤n≤i。 Wherein, i is the number of disks, 1≤n≤i.

本发明提供的RAID-5的数据恢复方法实施例,可在NTFS文件系统没有文件记录编号的情况下,通过准确的分析出RAID-5的RAID信息,并利用RAID信息进行数据恢复,以解决现有RAID-5数据恢复方法准确率低,成功率低和普适性差的问题。 The embodiment of the data recovery method of RAID-5 provided by the present invention can accurately analyze the RAID information of RAID-5 under the situation that the NTFS file system has no file record number, and use the RAID information to perform data recovery to solve the problem There are the problems of low accuracy rate, low success rate and poor universality of the RAID-5 data recovery method.

附图说明 Description of drawings

图1是本发明RAID-5的数据恢复方法第一实施例的流程图; Fig. 1 is the flowchart of the first embodiment of the data recovery method of RAID-5 of the present invention;

图2是本发明RAID-5的数据恢复方法第二实施例中根据MBR获取磁盘的左右结构的流程图; Fig. 2 is the flow chart of obtaining the left and right structures of the disk according to the MBR in the second embodiment of the data recovery method of RAID-5 of the present invention;

图3是本发明RAID-5的数据恢复方法第二实施例中根据MBR获取磁盘的同步异步情况的流程图; Fig. 3 is the flow chart that obtains the synchronous and asynchronous situation of disk according to MBR in the data restoration method of RAID-5 of the present invention second embodiment;

图4是本发明RAID-5的数据恢复方法第三实施例中获取SSS的流程图; Fig. 4 is the flow chart of obtaining SSS in the third embodiment of the data recovery method of RAID-5 of the present invention;

图5是本发明RAID-5的数据恢复方法第三实施例中获取磁盘的左右结构和同步异步情况的流程图。 FIG. 5 is a flow chart of obtaining the left-right structure and synchronous and asynchronous conditions of the disk in the third embodiment of the RAID-5 data recovery method of the present invention.

具体实施方式 Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。 In order to make the above objects, features and advantages of the present invention more comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

参照图1,示出了本发明RAID-5的数据恢复方法第一实施例的流程图,包括如下步骤: With reference to Fig. 1, show the flow chart of the first embodiment of the data recovery method of RAID-5 of the present invention, comprise the steps:

S1,获取主引导记录MBR。 S1, acquiring a master boot record MBR.

S2,判断是否有文件记录编号。如果判断结果为否,即没有文件记录编号,则转S3。 S2, judging whether there is a file record number. If the judgment result is no, that is, there is no file record number, then go to S3.

S3,在没有文件记录编号的情况下,获取条带大小SSN,且根据MBR获取条带开始扇区SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和数据开始扇区BSN。 S3, if there is no file record number, obtain the stripe size SSN, and obtain the stripe start sector SSS, the left and right structure of the disk, the disk sequence, the synchronization and asynchrony of the disk, and the data start sector BSN according to the MBR.

S4,根据SSN、SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和BSN进行数据恢复。 S4. Perform data recovery according to the SSN, SSS, left and right structure of the disk, disk sequence, synchronization and asynchronous conditions of the disk, and BSN.

根据本发明RAID-5的数据恢复方法第一实施例,可实现在NTFS文件系统没有文件记录编号的情况下,通过准确的分析出RAID-5的RAID信息,并利用RAID信息进行数据恢复,其中RAID信息包括条带大小SSN、条带开始扇区SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和数据开始扇区BSN,该方法第一实施例不但具有较强的普适性,且具有较高的恢复准确率和恢复成功率。 According to the first embodiment of the data recovery method of RAID-5 of the present invention, it can be realized that when the NTFS file system does not have a file record number, the RAID information of RAID-5 can be accurately analyzed, and data recovery can be performed using the RAID information, wherein The RAID information includes the stripe size SSN, the stripe start sector SSS, the left and right structure of the disk, the disk sequence, the synchronization and asynchronous conditions of the disk, and the data start sector BSN. The first embodiment of the method not only has strong universality, And it has high recovery accuracy and recovery success rate.

进一步的,本发明提供的RAID-5的数据恢复方法第二实施例是在上述方法第一实施例基础上的改进,其中,在S3中获取条带大小SSN的步骤具体为: Further, the second embodiment of the RAID-5 data recovery method provided by the present invention is an improvement on the basis of the first embodiment of the above method, wherein the step of obtaining the stripe size SSN in S3 is specifically:

S11,根据NTFS分区的DBR特征依次搜索磁盘中的的DOS引导记录DBR并获取DOS引导记录DBR。 S11, according to the DBR characteristics of the NTFS partition, search for the DOS boot record DBR in the disk in sequence and obtain the DOS boot record DBR.

其中,该DBR包含DBR的位置信息和记录信息,DBR的位置信息包括DBR所在扇区等,DBR记录信息包括DBR中$MFT的起始簇号和DBR中每簇的扇区数等。 Wherein, the DBR includes location information and record information of the DBR, the location information of the DBR includes the sector where the DBR is located, etc., and the record information of the DBR includes the starting cluster number of $MFT in the DBR and the number of sectors of each cluster in the DBR, etc.

S12,根据DBR获取主文件表$MFT所在扇区的位置判定值D1,主文件表$MFT的扇区即位于D1附近。 S12. According to the DBR, the position determination value D 1 of the sector where the master file table $MFT is located is obtained, and the sector of the master file table $MFT is located near D 1 .

其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1)。其中,本文中的i均表示RAID-5包含的磁盘数量。 Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1). Wherein, i in this article represents the number of disks included in RAID-5.

S13,根据主文件表$MFT的第一参数0x80属性获取文件记录MFT较多的区域RMFTS13. According to the attribute of the first parameter 0x80 of the master file table $MFT, the region RMFT with more file records MFT is acquired.

S14,在RMFT内依次搜索,获取第n个磁盘第一次出现校验信息P的扇区PSn,其中,1≤n≤i。 S14. Search sequentially in the RMFT to obtain the sector PSn where the parity information P appears for the first time on the nth disk, where 1≤n≤i.

其中,判定磁盘第一次出现校验信息P的扇区的方式是:在该扇区上,除去该磁盘的信息不是文件记录MFT且非全0之外,其他磁盘上的信息都是文件记录MFT。 Among them, the way to determine the sector where the verification information P appears for the first time on the disk is: on this sector, except that the information of the disk is not a file record MFT and is not all 0, the information on other disks are all file records MFT.

S15,根据PSn获取条带大小SSN。 S15. Obtain the stripe size SSN according to the PSn.

获取方式具体为:首先剔除值最小的PSn,然后求出剩余PSn的公差,该公差就是条带的大小SSN。 The acquisition method is specifically as follows: firstly, the PSn with the smallest value is eliminated, and then the tolerance of the remaining PSn is calculated, and the tolerance is the size SSN of the stripe.

由于不能保证值最小的PSn是某个条带的开始位置,为了更准确的获取条带的开始位置,将值最小的PSn剔除。 Since it cannot be guaranteed that the PSn with the smallest value is the start position of a certain band, in order to obtain the start position of the band more accurately, the PSn with the smallest value is eliminated.

进一步,在RAID-5的数据恢复方法的第二实施例中,S11的步骤具体包括: Further, in the second embodiment of the data recovery method of RAID-5, the steps of S11 specifically include:

S111,根据MBR中的硬盘分区表DPT中记录的分区信息,获取DBR所在扇区的位置判定值D2,该DBR所在扇区即位于D2附近。 S111, according to the partition information recorded in the hard disk partition table DPT in the MBR, obtain the position judgment value D 2 of the sector where the DBR is located, and the sector where the DBR is located is located near D 2 .

其中,D2=MBR所在扇区+MBR中的NFTS分区的隐藏扇区数/(i-1)。 Wherein, D 2 =the sector where the MBR is located+the number of hidden sectors of the NFTS partition in the MBR/(i-1).

S112,根据D2获取DBR所在扇区的位置。 S112. Acquire the location of the sector where the DBR is located according to D2 .

进一步的,在RAID-5的数据恢复方法的第二实施例中,S2判断是否有文件记录编号的步骤具体为: Further, in the second embodiment of the data recovery method of RAID-5, the step of S2 judging whether there is a file record number is specifically:

S21,根据MBR获取文件记录MFT。 S21. Acquire the file record MFT according to the MBR.

S22,根据MFT判断是否有文件记录编号。 S22. Determine whether there is a file record number according to the MFT.

进一步的,在RAID-5的数据恢复方法的第二实施例中,根据MBR获取条带开始扇区SSS的步骤具体为: Further, in the second embodiment of the data recovery method of RAID-5, the step of obtaining the stripe start sector SSS according to the MBR is specifically:

S301,获取MBR所在扇区SNMBRS301, obtain the sector SN MBR where the MBR is located;

S302,设置条带开始扇区为SNMBRS302. Set the start sector of the stripe as the SN MBR .

进一步的,参看图2为本发明RAID-5的数据恢复方法第二实施例中根据MBR获取磁盘的左右结构的流程图,具体包括如下步骤: Further, referring to FIG. 2, it is a flow chart of obtaining the left and right structures of the disk according to the MBR in the second embodiment of the RAID-5 data recovery method of the present invention, which specifically includes the following steps:

S311,判断MBR的个数是否为1。 S311. Determine whether the number of MBRs is 1.

如果判断结果为否,则转S312,如果判断结果为是,则转S313。 If the judgment result is no, go to S312, and if the judgment result is yes, go to S313.

S312,剔除校验的MBR。 S312. Delete the verified MBR.

其中,判断(PSn-SNMBR)%(i×SSN)/SSN的值是否为O,如果为O,则该MBR为校验的MBR,如果不为O,则为真实的MBR。 Among them, it is judged whether the value of (PSn-SN MBR )%(i×SSN)/SSN is 0, if it is 0, then the MBR is the verified MBR, if not 0, then it is the real MBR.

S313,获取MBR所在磁盘的任一校验信息所在的扇区SN。 S313. Obtain the sector SN where any check information of the disk where the MBR is located is located.

S314,根据(SN-SNMBR)%(SSN×i)/SSN的值获取磁盘的左右结构。 S314. Acquire the left and right structures of the disk according to the value of (SN−SN MBR )%(SSN×i)/SSN.

其中,如果该值等于1,则磁盘为右结构;如果该值不等于1,则磁盘为左结构。 Wherein, if the value is equal to 1, the disk is a right structure; if the value is not equal to 1, the disk is a left structure.

进一步的,在RAID-5的数据恢复方法第二实施例中,根据MBR获取盘序的步骤具体为: Further, in the second embodiment of the data recovery method of RAID-5, the step of obtaining the disk sequence according to the MBR is specifically:

S321,根据(PSn-SNMBR)%(SSN×i)的值获取盘序。 S321. Obtain the disk sequence according to the value of (PSn-SN MBR )%(SSN×i).

其中,如果磁盘为右结构,则该值即为盘序;如果磁盘为左结构,则所述盘序与该值相反。 Wherein, if the disk is of the right structure, the value is the disk sequence; if the disk is of the left structure, the disk sequence is opposite to the value.

进一步的,参看图3为本发明RAID-5的数据恢复方法第二实施例中根据MBR获取磁盘的同步异步情况的流程图,具体包括如下步骤: Further, referring to FIG. 3, it is a flow chart of obtaining the synchronous and asynchronous conditions of the disk according to the MBR in the second embodiment of the RAID-5 data recovery method of the present invention, which specifically includes the following steps:

S331,根据盘序、条带开始扇区和$MFT的第一参数0x80中记录的数据流信息获取MFT数据流结束位置所在的扇区。 S331. Obtain the sector where the end position of the MFT data stream is located according to the disk sequence, the stripe start sector, and the data stream information recorded in the first parameter 0x80 of $MFT.

S332,根据MFT数据流结束位置所在的扇区判断是否能获取磁盘的同步异步情况,如果判断结果为是,则转S333。 S332, judging whether the synchronization and asynchrony of the disk can be obtained according to the sector where the MFT data stream ends, if the judging result is yes, go to S333.

其中,不能获取磁盘的同步异步情况如下:第一,结束扇区为任一条带的结束扇区,并且除了校验信息所在磁盘外,其余磁盘在该条带上均为MFT;第二,在盘序中,结束扇区所在的条带上,MFT所在磁盘全部位于校验信息所在磁盘的某一边并且校验信息所在盘为盘序中的第一个盘或者最后一个盘。 Among them, the synchronous and asynchronous conditions of the disk that cannot be obtained are as follows: first, the end sector is the end sector of any stripe, and except for the disk where the verification information is located, all other disks on the stripe are MFT; second, in the In the disk sequence, on the stripe where the end sector is located, the disk where the MFT is located is located on one side of the disk where the verification information is located, and the disk where the verification information is located is the first disk or the last disk in the disk sequence.

S333,根据MFT数据流结束位置所在的扇区获取磁盘的同步异步情况。 S333. Obtain the synchronous and asynchronous conditions of the disk according to the sector where the end position of the MFT data stream is located.

进一步的,当S332的判断结果为否时,则根据以下步骤来获取磁盘的同步异步情况。 Further, when the determination result of S332 is no, the synchronous and asynchronous conditions of the disk are obtained according to the following steps.

如果S332的判断结果为否,即根据MFT数据流结束位置所在的扇区判断出不能获取磁盘的同步异步情况,则根据如下步骤获取磁盘的同步异步情况: If the judgment result of S332 is no, that is, it is judged that the synchronous and asynchronous situation of the disk cannot be obtained according to the sector where the MFT data stream end position is located, then the synchronous and asynchronous situation of the disk is obtained according to the following steps:

S334,假设磁盘为同步,并判断MFT的第二参数Ox30中的文件后缀名是否与$MFT的第一参数0x80指向数据的特征头匹配。如果判断结果为否,则转S335,如果判断结构为是,则转S336。 S334, assuming that the disk is synchronous, and judging whether the file extension in the second parameter 0x30 of the MFT matches the signature header of the data pointed to by the first parameter 0x80 of $MFT. If the judgment result is no, then go to S335, if the judging structure is yes, then go to S336.

该判断是根据RAID-5磁盘中的文件类型与数据特征头对应关系数据库来进行的。其中,每种文件类型在存储于磁盘上的时候,其数据头的值即数据特征头都是固定的,该数据特征头与文件类型是相对应的。 The judgment is made according to the database of the corresponding relationship between the file type and the data characteristic header in the RAID-5 disk. Wherein, when each file type is stored on the disk, the value of the data header, that is, the data characteristic header is fixed, and the data characteristic header corresponds to the file type.

S335,判定磁盘为异步。 S335. Determine that the disk is asynchronous.

S336,假设磁盘为异步,并判断MFT的第二参数0x30中的文件后缀名是否与$MFT的第一参数0x80指向数据的特征头相匹配。如果判断结果为否,则转S337,如果判断结果为是,则获取下个MFT并重复上述步骤即返回到S334,直至获取到正确的磁盘同步异步情况或再也获取不到MFT为止。 S336, assuming that the disk is asynchronous, and judging whether the file extension in the second parameter 0x30 of the MFT matches the characteristic header of the data pointed to by the first parameter 0x80 of $MFT. If the judgment result is no, then go to S337, if the judgment result is yes, then obtain the next MFT and repeat the above steps to return to S334 until the correct disk synchronization and asynchronous situation is obtained or no MFT can be obtained any more.

S337,判定磁盘为同步。 S337. Determine that the disk is synchronous.

进一步的,在RAID-5的数据恢复方法第二实施例中,获取数据开始扇区BSN的步骤具体为:设置数据开始扇区BSN为0。 Further, in the second embodiment of the RAID-5 data recovery method, the step of obtaining the data start sector BSN is specifically: setting the data start sector BSN to 0.

进一步的,在RAID-5的数据恢复方法第二实施例中,在S1获取主引导记录MBR之前,还包括如下步骤:根据MBR的特征值搜索磁盘中的主引导记录MBR。 Further, in the second embodiment of the RAID-5 data recovery method, before S1 acquires the master boot record MBR, the following step is further included: searching for the master boot record MBR in the disk according to the characteristic value of the MBR.

更进一步的,下面将介绍本发明RAID-5的数据恢复方法第三实施例,该方法第三实施例是在上述方法第二实施例基础上的改进。 Furthermore, the third embodiment of the RAID-5 data recovery method of the present invention will be introduced below. The third embodiment of the method is an improvement on the basis of the second embodiment of the above method.

在没有搜索到MBR的情况下,采取以下步骤获取条带大小SSN、条带开始扇区SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和数据开始扇区BSN。 If the MBR is not found, take the following steps to obtain the stripe size SSN, stripe start sector SSS, disk left and right structure, disk sequence, disk synchronization and asynchronous conditions, and data start sector BSN.

在RAID-5的数据恢复方法第三实施例中,获取条带大小SSN的步骤具体为: In the third embodiment of the data recovery method of RAID-5, the steps of obtaining the stripe size SSN are specifically:

S501,根据NTFS分区的DBR特征依次搜索磁盘中的的DOS引导记录DBR并获取DOS引导记录DBR。 S501. Search for the DOS boot record DBR in the disk sequentially according to the DBR characteristics of the NTFS partition and acquire the DOS boot record DBR.

其中,该DBR包含DBR的位置信息和记录信息,DBR的位置信息包括DBR所在扇区等,DBR记录信息包括DBR中$MFT的起始簇号和DBR中每簇的扇区数等。 Wherein, the DBR includes location information and record information of the DBR, the location information of the DBR includes the sector where the DBR is located, etc., and the record information of the DBR includes the starting cluster number of $MFT in the DBR and the number of sectors of each cluster in the DBR, etc.

S502,根据DBR获取主文件表$MFT所在扇区的位置判定值D1,主文件表$MFT的扇区即位于D1附近。 S502. According to the DBR, the position judgment value D 1 of the sector where the master file table $MFT is located is obtained, and the sector of the master file table $MFT is located near D 1 .

其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1)。其中,本文中的i均表示RAID-5包含的磁盘数量。 Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1). Wherein, i in this article represents the number of disks included in RAID-5.

S503,根据主文件表$MFT的第一参数0x80属性获取文件记录MFT较多的区域RMFTS503. According to the first parameter 0x80 attribute of the master file table $MFT, acquire the region RMFT with more file record MFTs .

S504,在RMFT内依次搜索,获取第n个磁盘第一次出现校验信息P的扇区PSn,其中,1≤n≤i。 S504. Search sequentially in the RMFT to acquire the sector PSn where the parity information P appears for the first time on the nth disk, where 1≤n≤i.

其中,判定磁盘第一次出现校验信息P的扇区的方式是:在该扇区上,除去该磁盘的信息不是文件记录MFT且非全0之外,其他磁盘上的信息都是文件记录MFT。 Among them, the way to determine the sector where the verification information P appears for the first time on the disk is: on this sector, except that the information of the disk is not a file record MFT and is not all 0, the information on other disks are all file records MFT.

S505,根据PSn获取条带大小SSN。 S505. Acquire the stripe size SSN according to the PSn.

获取方式具体为:首先剔除值最小的PSn,然后求出剩余PSn的公差,该公差就是条带的大小SSN。 The acquisition method is specifically as follows: firstly, the PSn with the smallest value is eliminated, and then the tolerance of the remaining PSn is calculated, and the tolerance is the size SSN of the stripe.

由于不能保证值最小的PSn是某个条带的开始位置,为了更准确的获取条带的开始位置,将值最小的PSn剔除。 Since it cannot be guaranteed that the PSn with the smallest value is the start position of a certain band, in order to obtain the start position of the band more accurately, the PSn with the smallest value is eliminated.

参看图4,为本发明RAID-5的数据恢复方法第三实施例中获取SSS的流程图,具体包括如下步骤: Referring to Fig. 4, it is the flowchart of obtaining SSS in the third embodiment of the data recovery method of RAID-5 of the present invention, specifically comprises the following steps:

S511,判断RAID-5是否由动态磁盘组成。如果判断结果,则转S502,如果判断结果为否,则转S503。 S511. Determine whether the RAID-5 is composed of dynamic disks. If the result is judged, go to S502; if the result is no, go to S503.

S512,设置条带开始扇区为第一个文件系统(例如,FAT,NTFS等)分区开 S512, set the stripe start sector as the first file system (for example, FAT, NTFS, etc.)

始所在的扇区。 sector where it starts.

S513,设置SSS为0。 S513, set SSS to 0.

在本发明RAID-5的数据恢复方法第三实施例中,获取磁盘盘序的步骤具体为:根据PSn%(SSN×i)/SSN的值获取磁盘的盘序。 In the third embodiment of the RAID-5 data recovery method of the present invention, the step of obtaining the disk sequence is specifically: obtaining the disk sequence according to the value of PSn%(SSN×i)/SSN.

其中,如果磁盘为右结构,则该值即为磁盘的盘序。如果磁盘为左结构,则磁盘的盘序与该值相反。 Among them, if the disk is a right structure, then this value is the disk sequence of the disk. If the disk is a left structure, the disk order of the disk is opposite to this value.

参看图5,为本发明RAID-5的数据恢复方法第三实施例中获取磁盘的左右结构和同步异步情况的流程图,具体包括如下步骤: Referring to Fig. 5, it is a flow chart of obtaining the left and right structure of the disk and the synchronous and asynchronous situation in the third embodiment of the data recovery method of RAID-5 of the present invention, specifically comprising the following steps:

S521, 根据盘序、条带开始扇区和$MFT的第一参数0x80中记录的数据流信息获取MFT数据流结束位置所在的扇区。 S521. Acquire the sector where the end position of the MFT data stream is located according to the disk sequence, the stripe start sector, and the data stream information recorded in the first parameter 0x80 of $MFT.

S522,根据MFT数据流结束位置所在扇区判断是否能获取磁盘的左右结构和同步异步情况。如果判断结果为是,则转S523,如果判断结果为否,则转S524。 S522. Determine whether the left-right structure of the disk and the synchronous and asynchronous conditions of the disk can be obtained according to the sector where the end position of the MFT data stream is located. If the judgment result is yes, then go to S523, if the judgment result is no, then go to S524.

其中,不能获取获取磁盘的左右结构和同步异步情况的场景如下:结束扇区为任一条带的结束扇区,并且除了校验信息所在磁盘外,其余磁盘在该条带上均为MFT;  Among them, the scenario where the left and right structure of the disk and the synchronous and asynchronous conditions cannot be obtained is as follows: the end sector is the end sector of any stripe, and except for the disk where the verification information is located, all other disks are MFT on the stripe;

S523,根据MFT数据流结束位置所在扇区获取磁盘左右结构和同步异步情况,在获取左右结构和/或同步异步情况失败的情况下,根据MFT的第二参数Ox30的文件后缀名与$MFT的第一参数Ox80的数据特征头是否相匹配的情况,获取正确的磁盘左右结构和/或同步异步情况。 S523, obtain the left and right structure and synchronous and asynchronous situation of the disk according to the sector where the MFT data stream end position is located, in the case of failing to obtain the left and right structure and/or the synchronous and asynchronous situation, according to the file suffix name of the second parameter 0x30 of MFT and $MFT Whether the data characteristic head of the first parameter Ox80 matches the situation, obtains the correct disk left and right structure and/or synchronous asynchronous situation.

其中,在盘序中,结束扇区上,校验信息所在磁盘的前后面的磁盘中,含有任一磁盘未出现MFT,即可以判断出同步和异步情况;具体的是,如果前面磁盘中任一磁盘出现MFT并且后面磁盘未出现MFT或者前面磁盘都是MFT,后面磁盘中任一磁盘未出现MFT,则为异步;反之为同步; Among them, in the disk sequence, on the end sector, in the disks before and after the disk where the verification information is located, if there is no MFT on any disk, the synchronous and asynchronous conditions can be judged; specifically, if any of the previous disks If a disk has MFT and the following disk does not have MFT, or the front disks are all MFT, and any of the following disks does not have MFT, it is asynchronous; otherwise, it is synchronous;

在盘序中,结束扇区上,校验信息所在磁盘的前面或者后面的磁盘中,出现部分磁盘含有MFT,既可以判断出左右结构情况;具体的是,根据左右结构情况,获取的盘序,其特征在于盘序在前的磁盘有MFT,后面的磁盘有可能有MFT,如果违反此特征,则证明结构是错误的。 In the disk sequence, on the end sector, in the front or back of the disk where the verification information is located, some disks contain MFT, which can determine the left and right structures; specifically, according to the left and right structures, the obtained disk sequence , which is characterized in that the disk with the first disk sequence has MFT, and the disk behind may have MFT. If this characteristic is violated, it proves that the structure is wrong.

S524,根据MFT的第二参数Ox30的文件后缀名是否与$MFT的第一参数0x80指向数据的特征头相匹配的情况,获取正确的磁盘左右结构和同步异步情况。 S524. According to whether the file suffix name of the second parameter Ox30 of the MFT matches the characteristic header of the data pointed to by the first parameter 0x80 of the $MFT, obtain the correct left and right structure of the disk and the synchronous and asynchronous conditions.

其中,如果MFT的第二参数Ox30的文件后缀名与$MFT的第一参数指向数据的特征头相匹配,则说明获得的磁盘左右结构和同步异步情况有可能是准确的。如果MFT的第二参数Ox30的文件后缀名与$MFT的第一参数Ox80的数据特征头不相匹配,则说明获得的磁盘左右结构和同步异步情况是不准确,从而进行排除。当排除到只有一种左右结构与同步异步组合或者当获取不到MFT为止 Wherein, if the file suffix name of the second parameter Ox30 of MFT matches the characteristic head of the data pointed to by the first parameter of $MFT, it means that the obtained disk left-right structure and synchronous and asynchronous conditions may be accurate. If the file suffix name of the second parameter Ox30 of MFT does not match the data feature header of the first parameter Ox80 of $MFT, it means that the obtained disk left and right structure and synchronous and asynchronous situation are inaccurate, so it is excluded. When it is ruled out that there is only one left and right structure combined with synchronous and asynchronous or when the MFT cannot be obtained

在本发明RAID-5的数据恢复方法第三实施例中,获取BSN的步骤具体为: In the third embodiment of the data recovery method of RAID-5 of the present invention, the steps of obtaining the BSN are specifically:

S531,在磁盘为右结构的情况下,判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于DBR所在盘的盘序。如果判断结果为是,则所述DBR为校验的DBR并进行剔除;如果判断结果为否,则设置DBR中隐藏的扇区数为BSN。 S531 , in the case that the disk has a right structure, judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence of the disk where the DBR is located. If the judging result is yes, the DBR is a checked DBR and removed; if the judging result is no, the number of hidden sectors in the DBR is set as the BSN.

S532,在磁盘为左结构的情况下,判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于N-DBR所在盘的盘序-1。如果判断结果为是,则确认DBR为校验的DBR并进行剔除;如果判断结果为否,则设置DBR中隐藏的扇区数为BSN。 S532, if the disk is of the left structure, judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence-1 of the disk where the N-DBR is located. If the judgment result is yes, then confirm that the DBR is a verified DBR and remove it; if the judgment result is no, set the number of hidden sectors in the DBR as the BSN.

对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域的技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为根据本发明,某些步骤可以采用其他顺序或同时执行;其次,本领域技术人员也应该知悉,上述方法实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。 For the aforementioned method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention , some steps can be performed in other orders or simultaneously; secondly, those skilled in the art should also know that the above method embodiments are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。 Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.

以上对本发明所提供的一种RAID-5的数据恢复方法进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。 The data recovery method of a kind of RAID-5 provided by the present invention has been introduced in detail above. The principles and implementation methods of the present invention have been explained by using specific examples in this paper. The description of the above embodiments is only used to help understand the present invention. method and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood as Limitations on the Invention.

Claims (12)

1.一种RAID-5的数据恢复方法,其特征在于,包括: 1. A data recovery method of RAID-5, characterized in that, comprising: 获取主引导记录MBR; Get the master boot record MBR; 判断是否有文件记录编号; Determine whether there is a file record number; 如果判断结果为否,则获取条带大小SSN,且根据所述MBR获取条带开始扇区SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和数据开始扇区BSN; If the judgment result is no, then obtain the stripe size SSN, and obtain the stripe start sector SSS, the left and right structure of the disk, the disk sequence, the synchronization and asynchronous situation of the disk and the data start sector BSN according to the MBR; 根据所述SSN、SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和BSN进行数据恢复。 Data recovery is performed according to the SSN, SSS, left and right structure of the disk, disk sequence, synchronous and asynchronous conditions of the disk, and BSN. 2.如权利要求1所述的方法,其特征在于,判断是否有文件记录编号的步骤具体为: 2. The method according to claim 1, wherein the step of judging whether there is a file record number is specifically: 根据所述MBR获取文件记录MFT; Obtaining a file record MFT according to the MBR; 根据所述MFT判断是否有文件记录编号。 Determine whether there is a file record number according to the MFT. 3.如权利要求1所述的方法,其特征在于,根据所述MBR获取条带开始扇区SSS的步骤具体为: 3. The method according to claim 1, wherein the step of obtaining the start sector SSS of a stripe according to the MBR is specifically: 获取所述MBR所在扇区SNMBRObtain the SN MBR of the sector where the MBR is located; 设置条带开始扇区为SNMBRSet the stripe start sector to SN MBR . 4.如权利要求3所述的方法,其特征在于,根据所述MBR获取磁盘的左右结构的步骤具体为: 4. The method according to claim 3, wherein the step of obtaining the left and right structures of the disk according to the MBR is specifically: 判断所述MBR的个数是否为1; Judging whether the number of the MBR is 1; 如果判断结果为否,则剔除校验的MBR; If the judgment result is no, the verified MBR is removed; 如果判断结果为是,则获取MBR所在磁盘的任一校验信息所在的扇区SN; If the judgment result is yes, obtain the sector SN where any verification information of the disk where the MBR is located; 根据(SN-SNMBR)%(SSN×i)/SSN的值获取磁盘的左右结构; Obtain the left and right structures of the disk according to the value of (SN-SN MBR )%(SSN×i)/SSN; 其中,i 为磁盘数量。 where i is the number of disks. 5.如权利要求3所述的方法,其特征在于,获取条带大小SSN的步骤具体为: 5. The method according to claim 3, wherein the step of obtaining the stripe size SSN is specifically: 获取NTFS分区的DOS引导记录DBR; Obtain the DOS boot record DBR of the NTFS partition; 根据所述DBR获取主文件表$MFT所在扇区的位置判定值D1Obtain the position judgment value D1 of the sector where the master file table $MFT is located according to the DBR; 根据所述$MFT的第一参数获取文件记录MFT较多的区域RMFTAccording to the first parameter of the $MFT, obtain the region RMFT with more file record MFTs ; 在RMFT内获取第n个磁盘第一次出现校验信息P的扇区PSn;  Obtain the sector PSn where the verification information P appears for the first time on the nth disk in the RMFT ; 根据所述PSn获取条带大小SSN; Obtain the stripe size SSN according to the PSn; 其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1); Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1); 其中,i为磁盘数量,1≤n≤i。 Wherein, i is the number of disks, 1≤n≤i. 6.如权利要求5所述的方法, 其特征在于,获取NTFS分区的DOS引导记录DBR的步骤具体为: 6. the method as claimed in claim 5, is characterized in that, the step of obtaining the DOS boot record DBR of NTFS partition is specifically: 根据所述MBR中的硬盘分区表DPT获取所述DBR所在扇区的位置判定值D2According to the hard disk partition table DPT in the MBR, obtain the position judgment value D 2 of the sector where the DBR is located; 根据所述判定值D2获取所述DBR所在扇区的位置; Acquire the location of the sector where the DBR is located according to the decision value D2 ; 其中,D2=MBR所在扇区+MBR中的NFTS分区的隐藏扇区数/(i-1)。 Wherein, D 2 =the sector where the MBR is located+the number of hidden sectors of the NFTS partition in the MBR/(i-1). 7.如权利要求5所述的方法,其特征在于,根据所述MBR获取盘序的步骤具体为: 7. The method according to claim 5, wherein the step of obtaining the disk sequence according to the MBR is specifically: 根据(PSn- SNMBR)%(SSN×i)的值获取盘序。 Obtain the disk sequence according to the value of (PSn- SN MBR )%(SSN×i). 8.如权利要求7所述的方法,其特征在于,根据所述MBR获取磁盘的同步异步情况的步骤具体为: 8. The method according to claim 7, wherein the step of obtaining the synchronous and asynchronous conditions of the disk according to the MBR is specifically: 根据所述盘序、条带开始扇区和$MFT的第一参数获取MFT数据流结束位置所在的扇区; Obtain the sector where the end position of the MFT data stream is located according to the disk sequence, the stripe start sector, and the first parameter of $MFT; 根据所述MFT数据流结束位置所在的扇区判断是否能获取磁盘的同步异步情况; According to the sector where the end position of the MFT data stream is located, it is judged whether the synchronous and asynchronous situation of the disk can be obtained; 如果判断结果为是,则根据所述MFT数据流结束位置所在的扇区获取磁盘的同步异步情况。 If the judgment result is yes, the synchronous and asynchronous conditions of the disk are obtained according to the sector where the end position of the MFT data stream is located. 9.如权利要求8所述的方法,其特征在于,还包括: 9. The method of claim 8, further comprising: 在根据所述MFT数据流结束位置所在的扇区判断出不能获取磁盘的同步异步情况下,进行如下步骤获取磁盘的同步异步情况: When judging that the synchronous and asynchronous situation of the disk cannot be obtained according to the sector where the MFT data stream end position is located, the following steps are performed to obtain the synchronous and asynchronous situation of the disk: 假设磁盘为同步,并判断所述MFT的第二参数的文件后缀名是否与$MFT的第一参数的数据特征头匹配; Assume that the disk is synchronous, and judge whether the file suffix name of the second parameter of the MFT matches the data signature header of the first parameter of $MFT; 如果判断结果为否,则判定磁盘为异步; If the judgment result is no, it is judged that the disk is asynchronous; 如果判断结果为是,则假设磁盘为异步,并判断所述MFT的第二参数的文件后缀名是否与第一参数的数据特征头匹配; If the judgment result is yes, it is assumed that the disk is asynchronous, and it is judged whether the file suffix name of the second parameter of the MFT matches the data signature header of the first parameter; 如果判断结果为否,则判定磁盘为同步; If the judgment result is no, it is judged that the disk is synchronous; 如果判断结果为是,则获取下个MFT并重复上述步骤,直至获取到正确的磁盘同步异步情况或获取不到所述MFT为止。 If the judgment result is yes, the next MFT is obtained and the above steps are repeated until the correct disk synchronization and asynchronous conditions are obtained or the MFT cannot be obtained. 10.如权利要求1所述的方法,其特征在于,获取数据开始扇区BSN的步骤具体为: 10. The method according to claim 1, wherein the step of obtaining the data start sector BSN is specifically: 设置数据开始扇区BSN为0。 Set data start sector BSN to 0. 11.如权利要求5所述的方法,其特征在于,在所述获取主引导记录MBR之前,还包括如下步骤: 11. The method according to claim 5, further comprising the steps of: 搜索磁盘中的主引导记录MBR。 Search the disk for the Master Boot Record MBR. 12.如权利要求11所述的方法,其特征在于, 12. The method of claim 11, wherein, 在没有搜索到所述MBR的情况下,通过以下步骤获取所述SSN、SSS、磁盘的左右结构、盘序、磁盘的同步异步情况和BSN,其中: In the case that the MBR is not searched, the SSN, SSS, left and right structure of the disk, disk sequence, synchronous and asynchronous situation of the disk and BSN are obtained through the following steps, wherein: 获取所述SSN的步骤具体为: The steps for obtaining the SSN are as follows: 获取NTFS分区的DOS引导记录DBR; Obtain the DOS boot record DBR of the NTFS partition; 根据所述DBR获取主文件表$MFT所在扇区的位置判定值D1Obtain the position judgment value D1 of the sector where the master file table $MFT is located according to the DBR; 根据所述$MFT的第一参数获取文件记录MFT较多的区域RMFTAccording to the first parameter of the $MFT, obtain the region RMFT with more file record MFTs ; 在RMFT内获取第n个磁盘第一次出现校验信息P的扇区PSn;  Obtain the sector PSn where the verification information P appears for the first time on the nth disk in the RMFT ; 根据所述PSn获取条带大小SSN; Obtain the stripe size SSN according to the PSn; 其中, D1=DBR所在扇区+(DBR中$MFT的起始簇号×DBR中每簇的扇区数)/(i-1); Among them, D 1 = the sector where the DBR is located + (the starting cluster number of $MFT in the DBR × the number of sectors in each cluster in the DBR) / (i-1); 获取所述SSS的步骤具体为: The steps for obtaining the SSS are as follows: 判断RAID-5是否由动态磁盘组成; Determine whether RAID-5 is composed of dynamic disks; 如果判断结果为是,则设置条带开始扇区为第一个NTFS文件系统分区开始 If the judgment result is yes, set the stripe start sector to the start of the first NTFS file system partition 所在的扇区; the sector in which it is located; 如果判断结果为否,则设置SSS为0; If the judgment result is no, set SSS to 0; 获取所述磁盘的盘序、左右结构和同步异步情况的步骤具体为: The steps for obtaining the disk sequence, left and right structure, and synchronous and asynchronous conditions of the disk are as follows: 根据PSn%(SSN×i)/SSN的值获取磁盘的盘序; Obtain the disk sequence of the disk according to the value of PSn%(SSN×i)/SSN; 根据所述$MFT的第一参数获取MFT数据流结束位置所在的扇区; Obtain the sector where the MFT data stream ends according to the first parameter of the $MFT; 根据所述MFT数据流结束位置所在扇区判断是否能获取磁盘的左右结构和同步异步情况; According to the sector where the end position of the MFT data stream is located, it is judged whether the left and right structure and the synchronous and asynchronous situation of the disk can be obtained; 如果判断结果为是,则根据所述MFT数据流结束位置所在扇区获取磁盘左右结构和同步异步情况,在获取所述左右结构和/或同步异步情况失败的情况下,根据所述MFT的第二参数的文件后缀名与$MFT的第一参数的数据特征头是否相匹配的情况,获取正确的磁盘左右结构和同步异步情况;  If the judgment result is yes, then obtain the disk left and right structure and synchronous and asynchronous situation according to the sector where the end position of the MFT data stream is located; Whether the file suffix name of the second parameter matches the data characteristic header of the first parameter of $MFT, and obtain the correct left and right disk structure and synchronous and asynchronous conditions; 如果判断结果为否,则根据所述MFT的第二参数的文件后缀名与第一参数的数据特征头是否相匹配的情况,获取正确的磁盘左右结构和同步异步情况; If the judgment result is no, then according to the situation of whether the file suffix name of the second parameter of the MFT matches the data characteristic head of the first parameter, obtain the correct left and right disk structure and synchronous asynchronous situation; 获取所述BSN的步骤具体为: The specific steps for obtaining the BSN are as follows: 若磁盘为右结构,则判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于DBR所在盘的盘序; If the disk is a right structure, then judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence of the disk where the DBR is located; 如果判断结果为是,则所述DBR为校验的DBR并进行剔除; If the judgment result is yes, the DBR is a checked DBR and eliminated; 如果判断结果为否,则所述DBR中隐藏的扇区数为所述BSN; If the judgment result is no, the number of sectors hidden in the DBR is the BSN; 若磁盘为左结构,则判断(DBR所在扇区-SSS)%(SSN×i)/SSN是否等于N-DBR所在盘的盘序-1; If the disk is of the left structure, judge whether (the sector where the DBR is located-SSS)%(SSN×i)/SSN is equal to the disk sequence of the disk where the N-DBR is located-1; 如果判断结果为是,则所述DBR为校验的DBR并进行剔除; If the judgment result is yes, the DBR is a checked DBR and is eliminated; 如果判断结果为否,则所述DBR中隐藏的扇区数为所述BSN; If the judgment result is no, the number of sectors hidden in the DBR is the BSN; 其中,i为磁盘数量,1≤n≤i。 Wherein, i is the number of disks, 1≤n≤i.
CN201310168322.2A 2013-05-09 2013-05-09 The data reconstruction method of RAID-5 Expired - Fee Related CN103268269B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310168322.2A CN103268269B (en) 2013-05-09 2013-05-09 The data reconstruction method of RAID-5

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310168322.2A CN103268269B (en) 2013-05-09 2013-05-09 The data reconstruction method of RAID-5

Publications (2)

Publication Number Publication Date
CN103268269A true CN103268269A (en) 2013-08-28
CN103268269B CN103268269B (en) 2016-04-06

Family

ID=49011901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310168322.2A Expired - Fee Related CN103268269B (en) 2013-05-09 2013-05-09 The data reconstruction method of RAID-5

Country Status (1)

Country Link
CN (1) CN103268269B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678044A (en) * 2013-12-30 2014-03-26 厦门市美亚柏科信息股份有限公司 Data recovery method and device of RAID5 in EXT3 file system
CN104794017A (en) * 2015-04-27 2015-07-22 四川效率源信息安全技术有限责任公司 Data recovery method for RAID5 with odd number of disks
CN105760254A (en) * 2016-01-27 2016-07-13 四川效率源信息安全技术股份有限公司 Data recovery method based on RAID 1E
US10210062B2 (en) 2017-06-08 2019-02-19 International Business Machines Corporation Data storage system comprising an array of drives

Citations (2)

* 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
US20060074954A1 (en) * 2004-09-30 2006-04-06 International Business Machines Corporation System and method for enabling efficient recovery of data in a storage array

Patent Citations (2)

* 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
US20060074954A1 (en) * 2004-09-30 2006-04-06 International Business Machines Corporation System and method for enabling efficient recovery of data in a storage array

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
赵振洲、乔明秋: "RAID5数据重组及过程研究", 《深圳信息职业技术学院学报》, vol. 8, no. 2, 30 June 2010 (2010-06-30), pages 89 - 92 *
鲁恩铭等: "RAID5结构剖析及其数据恢复策略研究", 《电脑开发与应用》, vol. 25, no. 1, 31 January 2012 (2012-01-31) *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103678044A (en) * 2013-12-30 2014-03-26 厦门市美亚柏科信息股份有限公司 Data recovery method and device of RAID5 in EXT3 file system
CN103678044B (en) * 2013-12-30 2016-08-17 厦门市美亚柏科信息股份有限公司 The data reconstruction method of the RAID5 under EXT3 file system and device
CN104794017A (en) * 2015-04-27 2015-07-22 四川效率源信息安全技术有限责任公司 Data recovery method for RAID5 with odd number of disks
CN104794017B (en) * 2015-04-27 2018-05-04 四川效率源信息安全技术股份有限公司 A kind of data reconstruction method for odd number disk RAID5
CN105760254A (en) * 2016-01-27 2016-07-13 四川效率源信息安全技术股份有限公司 Data recovery method based on RAID 1E
CN105760254B (en) * 2016-01-27 2019-08-06 四川效率源信息安全技术股份有限公司 A kind of data reconstruction method based on RAID1E
US10210062B2 (en) 2017-06-08 2019-02-19 International Business Machines Corporation Data storage system comprising an array of drives

Also Published As

Publication number Publication date
CN103268269B (en) 2016-04-06

Similar Documents

Publication Publication Date Title
US8392791B2 (en) Unified data protection and data de-duplication in a storage system
CN103678044B (en) The data reconstruction method of the RAID5 under EXT3 file system and device
US8719619B2 (en) Performance enhancement technique for raids under rebuild
US9727411B2 (en) Method and processor for writing and error tracking in a log subsystem of a file system
CN103150233B (en) A kind of data reconstruction method of RAID-5
US9223509B2 (en) File processing method and storage device
JP2011515746A (en) Apparatus and method for selecting a deduplication protocol for a data storage library
CN104199888B (en) The data reconstruction method and device of Resilient file system
CN103268269B (en) The data reconstruction method of RAID-5
CN111813609B (en) Data recovery method, data recovery system and related equipment in a storage medium
US9990261B2 (en) System and method for recovering a storage array
JP6666540B2 (en) Storage control device and program
US20190205223A1 (en) Metadata recovery for de-duplicated data
JP2012103795A5 (en)
WO2016141785A1 (en) Processing method and apparatus for high-performance redundant array of inexpensive disks (raid) mechanism
CN110555055A (en) A Data Mining Method for Oracle Database Redo Log Files
WO2017087760A1 (en) Selective data roll-back and roll-forward
WO2017143843A1 (en) Metadata recovery method and device
US20140379649A1 (en) Distributed storage system and file synchronization method
JP6160679B2 (en) Method for recovering data, method for storing data, and tape storage system
CN102270102A (en) Method for optimizing writing performance of RAID6 (Redundant Array of Independent Disks) disk array
US8418029B2 (en) Storage control device and storage control method
RU2502124C1 (en) Method of recovering records in storage device and system for realising said method
JP6113816B1 (en) Information processing system, information processing apparatus, and program
CN105573862B (en) Method and equipment for recovering file system

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right

Effective date of registration: 20170324

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.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160406