CN105893172A - Hard disk data recovery method and system - Google Patents

Hard disk data recovery method and system Download PDF

Info

Publication number
CN105893172A
CN105893172A CN201510854551.9A CN201510854551A CN105893172A CN 105893172 A CN105893172 A CN 105893172A CN 201510854551 A CN201510854551 A CN 201510854551A CN 105893172 A CN105893172 A CN 105893172A
Authority
CN
China
Prior art keywords
physical page
page
data
file
breakpoint
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.)
Pending
Application number
CN201510854551.9A
Other languages
Chinese (zh)
Inventor
孙方臣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Cloud Computing Co Ltd
Original Assignee
LeTV Cloud Computing 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 LeTV Cloud Computing Co Ltd filed Critical LeTV Cloud Computing Co Ltd
Priority to CN201510854551.9A priority Critical patent/CN105893172A/en
Publication of CN105893172A publication Critical patent/CN105893172A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present invention provide a hard disk data recovery method. A hard disk has a physical page with a data file recorded. The method comprises: reading a physical page with a data file recorded, and based on the data file in the physical page, generating a new log file relative to an original log file within a log region in a page boundary alignment manner; when a reading process of the physical page is interrupted, marking the physical page as a breakpoint physical page, and determining an address of the breakpoint physical page; and rolling back the new log file, and writing data file information that is aligned according to a page boundary and that corresponds to the address of the breakpoint physical page and that is in the new log file into the breakpoint physical page, so as to complete data recovery. The embodiments of the present invention further provide a hard disk data recovery system, which reduces the possibility of causing a data loss due to sudden interruption of hard disk reading, guarantees the reliability and integrity of data stored into the hard disk and increases usability of the hard disk.

Description

Hard disk data recovery and system
Technical field
The present embodiments relate to technical field of computer, particularly relate to a kind of hard disk data recovery and system.
Background technology
Hard disk is non-volatile holographic storage equipment on computer, is one of main storage medium of computer, and traditional mechanical hard disk is the one in hard disk, and the physical arrangement of mechanical hard disk includes magnetic head, hard disc;When hard disc rotates, magnetic head is maintained at a position, so magnetic head can mark a circular trace on hard disc surface, this track is exactly magnetic track, each magnetic track on hard disc is divided into several segmental arcs, these segmental arcs are the sectors of hard disk, and in traditional sector division mechanism, the information of 512 bytes typically can be deposited in each sector.
Under the pattern of " advanced form ", it is to use page to represent internal storage location on novel " 4K sector " hard disk, the size of page is 4096 bytes, and file system is generally configured to the operating unit that block is unit, these blocks save the information such as metadata, data, and the block size of file system is usually 4096 bytes, the block size of the file system size just with the page in internal memory is matched, simplifies the process workload that file system is mutual with page;The integral multiple being typically of size of sector of one Physical Page, it is software (OS, file system) in minimum operating unit, the Virtual File System of operating system reads a Physical Page from hardware memory, real process is then to read one or more sector from hard disk internal memory, in the file management of file system, the multiple Physical Page corresponding due to each file are probably discontinuous, therefore Physical Page is read the reading being finally still mapped to the data to the one or more sectors corresponding to Physical Page, such as: under the pattern of " advanced form ", one " 4K sector " corresponding this be exactly a Physical Page of hard disk, the sector now having 8 storage sizes to be 512 bytes in Physical Page.
Magnetic sheet at a hard disk, each sector can have a fixing check bit region, all can compare the verification of data with the most consistent when of reading data from sector every time, I O error will be reported if inconsistent, data are write the most again to sector, all can be again verification and write check bit region after write data to sector write data when, the defect of this kind of way is: if being written with data during write, but the electricity went off suddenly with when the most not to write verification, verification and part that so data division just and preserves are inconsistent, false bad block is become in the sector at this time read, if going to read these part data can not read out;Although now the data in sector cannot be read out, but if it is no problem for going to write this sector because the data of write sector can original all data in coverage sector, and by data original in sector and is preserved and verify and update in the lump.
Under normal circumstances, file system uses the file system (Journal File System) with Journal logging mode to keep the concordance reading and writing data, the maximum feature of the file system of Journal logging mode is: be written into the data of hard disk and the complete record of the metadata syslog file at hard disk, so as back jump tracking whenever necessary, when interrupting suddenly during disk read-write, system can be according to the directly backtracking of these records the part being interrupted of reforming, to accelerate the reformation speed of hard disc data;Thus any instant at disk read-write occurs that cause hard disk to read interrupts because of factors such as unexpected power down, and when restarting hard disk, as long as syslog file occurs without damage, can ensure the integrity of data;
But, data and the metadata of the hard disk recorded in syslog file under the pattern of " advanced form " do not go to preserve with the border of 4K, in hard disk reading exception during rollback system daily record, to when occurring that abnormal " 4k sector " is recovered, owing to file system is to interact with hard disk with the size of " 4K sector ", on the one hand, when rewind journal, need to read the data file in sector to be restored, then further according to journal file, the data of hard disk are recovered;On the other hand, owing to the data backed up in syslog file are not " 4K alignment ", during rewind journal reads sector data, if reading bad block, no matter read is false bad block or time the worst piece hard disk all can be caused to report I/O mistake, cause rewind journal failure, finally cannot recover hard disc data.
Summary of the invention
For above-mentioned at least one technical problem of the prior art, the embodiment of the present invention provides a kind of hard disk data recovery and system.
The embodiment of the present invention provides a kind of hard disk data recovery, and described hard disk has record and has the Physical Page of data file, it is characterised in that described method includes:
Read described record and have the Physical Page of data file, the data file in described Physical Page is generated the new journal file relative to raw log files according to the mode that page boundary is alignd in log region;
When the reading process of described Physical Page occurs to interrupt, Physical Page described in labelling is breakpoint Physical Page, and determines the address of described breakpoint Physical Page;
New journal file described in rollback, writes described breakpoint Physical Page by the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file, completes the recovery of data.
The embodiment of the present invention provides a kind of hard disk data recovery system, and described hard disk has record and has the Physical Page of data file, it is characterised in that described system includes:
New journal file signal generating unit, is used for: reading described record has the Physical Page of data file, according to the mode that page boundary is alignd, the data file in described Physical Page is generated in log region the new journal file relative to raw log files;
Breakpoint Physical Page determines unit, is used for: when the reading process of described Physical Page occurs to interrupt, and Physical Page described in labelling is breakpoint Physical Page, and determines the address of described breakpoint Physical Page;
Log rollback unit, is used for: new journal file described in rollback, the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file is write described breakpoint Physical Page, completes the recovery of data.
The data file information backed up in new journal file is alignd by said method and the system of the embodiment of the present invention according to page boundary, thus achieves:
One, when reading break during hard disk and again read hard disk, the new journal file of rollback also recovers hard disc data, the data file alignd according to page boundary utilizing new journal file to back up covers corresponding Physical Page, embodiment of the present invention method and system are compared to prior art, read the work of sector data when eliminating rewind journal, and improve the efficiency of disk recovery;
Two, further avoid during rewind journal, hard disc data cannot be recovered because reading I/O mistake produced by sector, thus reduce and cause the probability of loss of data because interrupting suddenly reading hard disk.
Three, utilize new journal file to repair the vacation bad block of hard disk, increase the availability of hard disk.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, the accompanying drawing used required in embodiment or description of the prior art will be briefly described below, apparently, accompanying drawing in describing below is some embodiments of the present invention, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is illustrated that the flow chart of the hard disk data recovery of one embodiment of the invention;
Fig. 2 shows the detailed execution figure of a kind of concrete executive mode of the S101 step in method shown in Fig. 1;
Fig. 3 shows the structural representation of the hard disk data recovery system of one embodiment of the invention.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art are obtained under not making creative work premise, broadly fall into the scope of protection of the invention.
Seeing the flow chart that Fig. 1 is illustrated that the hard disk data recovery of one embodiment of the invention method, described hard disk has record and has the Physical Page of data file, it is characterised in that described method includes:
S101: reading described record has the Physical Page of data file, generates the new journal file relative to raw log files by the data file in described Physical Page according to the mode that page boundary is alignd in log region;
S102: when the reading process of described Physical Page occurs to interrupt, Physical Page described in labelling is breakpoint Physical Page, and determines the address of described breakpoint Physical Page;
S103: new journal file described in rollback, writes described breakpoint Physical Page by the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file, completes the recovery of data.
About the triggering of the S103 step of the present embodiment method, including: interrupt in the process exception reading described Physical Page, and when starting to read hard disk again, trigger new journal file described in file system rollback.Further, file system judges whether to stop reading the work of one of them Physical Page according to normal program step, if judged result is no, the most all judges that the process exception reading described Physical Page is interrupted;Such as: the phenomenon that the instantaneous card of reading of hard disk pauses is not included in reading a kind of situation of aborted, unexpected power-off causes reading of one of them Physical Page to hard disk to interrupt being contained in a kind of situation reading aborted.
By embodiment of the present invention method, the data file backed up in new journal file is alignd according to page boundary, when reading break during hard disk and again read hard disk, the new journal file of rollback also recovers hard disc data, the data file alignd according to page boundary utilizing new journal file to back up covers corresponding Physical Page, embodiment of the present invention method and system are compared to prior art, read the work of sector data when eliminating rewind journal, and improve the efficiency of disk recovery;Further avoid during rewind journal, hard disc data cannot be recovered because reading I/O mistake produced by sector, thus reduce and cause the probability of loss of data because interrupting suddenly reading hard disk;Utilize new journal file to repair the vacation bad block of hard disk, increase the availability of hard disk.
As a kind of preferred implementation, with continued reference to Fig. 2, as the further optimization of embodiment illustrated in fig. 1 method, about the execution of described step S101 in Fig. 1, following sub-step can be included:
S1011: reading described record has the Physical Page of data file, obtains described data file starting position on described Physical Page and end position;
S1012: according to described starting position and described end position, determine beginning of the page boundary position and page footing boundary position according to the mode of 4K alignment;
S1013: the mode that the data file in described Physical Page is alignd according to described beginning of the page boundary position and page footing boundary position is generated the new journal file relative to raw log files in log region.
In a kind of embodiment of embodiment of the present invention method, described beginning of the page boundary position=Described starting position/4K* 4K, described page footing boundary position=(described end position+4K-1)/4K*4K。
Under the pattern of " advanced form ", novel " 4K sector " hard disk uses page to represent internal storage location, and the size of page is 4K byte, by embodiment of the present invention method by the data file that backed up in new journal file according to 4K boundary alignment;Thus achieve when the new journal file of rollback, the hard disc data being backed up the alignment of 4K in new journal file is write hard disk in the way of block, when eliminating the new journal file of rollback, read the step of the sector of hard disk.
In the present embodiment preferred implementation,Described starting position/4KRefer to is that size of data 4K according to one piece of data starting position on Physical Page and Physical Page rounds downwards,(described end position+4K-1)/4KRefer to is that size of data 4K according to one piece of data final position on Physical Page and Physical Page rounds downwards;Such as: acquiring data starting position on Physical Page is 10000, acquiring data final position on Physical Page is 20000, the most described beginning of the page boundary position=Described starting position/4K* 4K=10000/4096* 4096=2*4096=8192, described page footing boundary position=(described end position+4K-1)/4K=20000+4096-1)/4096=5*4096=20480.
Thus when reading one piece of data and being backed up the new journal file of write, the starting position that one piece of data corresponds to Physical Page is changed to the beginning of the page boundary position corresponding to Physical Page, the final position that one piece of data corresponds to Physical Page is changed to the page footing boundary position corresponding to Physical Page, it is achieved that the data file in Physical Page recorded data file backup to new journal file alignd according to page boundary.
As a kind of preferred implementation of one embodiment of the invention method, described S103 step includes:
When the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file cannot write described breakpoint Physical Page, the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file is remapping in the Physical Page of no data fileinfo, and correspondingly revise the physical page address of the data file information recording described breakpoint Physical Page in described new journal file, complete the recovery of data.
When breakpoint Physical Page has " the worst piece ", and when the data backed up in new journal file cannot be write described breakpoint Physical Page, the fileinfo that described breakpoint Physical Page is backed up in new journal file is remapping to except the Physical Page of other non-recording data files of breakpoint Physical Page, thus ensure the reliability of stored data in hard disk, even if making breakpoint Physical Page be physics bad block and data cannot being write, also can recover hard disc data according to the data of the breakpoint Physical Page that new journal file is backed up, greatly reduce hard disk and lose the probability of data.
Raw log files in a kind of preferred implementation of the inventive method, after the recovery completing data, in invalid described log region;
Owing to the data recorded in new journal file are the hard disc datas alignd according to page boundary, utilize new journal file that Physical Page is carried out data recovery, the data recorded in Physical Page after recovery should also be according to page boundary alignment, therefore the data file do not alignd according to page boundary recorded in raw log files has lost backup functionality;By the preferred implementation of the inventive method, after completing the recovery of the data to Physical Page, delete the raw log files of the Physical Page recovered, thus achieve after utilizing new journal file to recover number of physical pages evidence, when rewind journal carries out data recovery again to Same Physical page, avoid and utilize raw log files to cover Physical Page, and cause the data file entanglement recorded in the Physical Page that again recovers, thus ensure concordance and the integrity of data recorded in hard disc physical page.
About the hard disk data recovery of one embodiment of the invention method, more specifically, as a example by (SuSE) Linux OS, described method includes:
The application layer phase hard disk of file system initiates read-write requests, the Journal region that one section of data read-out to be written is come and is written in hard disk by request, and one piece of data is write start-pos to the end-pos corresponding to Journal region;After this one piece of data to be determined arrives Journal region, the data in this Journal region of labelling are effective, and know that this segment data by the address, initial sector Fs (start-pos) on the Physical Page mapping to hard disk of file system and terminates sevtor address Fs (end-pos);
The alignment 4K operation of new log file data: the address, initial sector Fs (start-pos) of this one piece of data is corresponded to the minimum sevtor address alignment of the Physical Page at Fs (start-pos) place, the maximum sector address align that sevtor address Fs (end-pos) corresponds to the Physical Page at Fs (end-pos) place will be terminated, the position of this one piece of data in Journal region of the record after alignment is correspondingly become (Fs (start-pos)/4K) * 4K to ((Fs (end-pos)+4K-1)/4K) * 4K from start-pos to end-pos;
After confirming the alignment 4K operation that described one piece of data all completes new log file data, start data to write in corresponding Physical Page with the form of block;
After confirming that described one piece of data all writes hard disk, invalid Journal region.
In described Journal region, storage has raw log files and new journal file, and the one piece of data read is start-pos and end-pos corresponding to the original position in raw log files and final position, and this one piece of data backs up the original position in new journal file and final position is Fs (start-pos)/4K and (Fs (end-pos)+4K-1)/4K;Wherein, Fs (start-pos)/4K and (Fs (end-pos)+4K-1)/4K are a kind of expression-forms of computer logic algorithm, what it referred to respectively the is address, initial sector according to this one piece of data and terminate sevtor address for physical page size go more than round;Such as: acquiring data address, initial sector Fs (start-pos) on Physical Page is 10000, acquiring data termination sevtor address Fs (end-pos) on Physical Page is 20000, then back up the beginning of the page boundary position of data in new daily record=Described starting position/4K* 4K=10000/4096* 4096=2*4096=8192, page footing boundary position=(described end position+4K-1)/4K=20000+4096-1)/4096=5*4096=20480.
When the unexpected power-off of hard disk and when restarting, hard disc data is recovered by rollback raw log files, when described raw log files cannot complete to recover hard disc data, new journal file is utilized to recover hard disc data file, raw log files is also deleted in the most invalid journal region, has thus ensured concordance and the integrity of the data that hard disk recovered.
Thus achieve: no matter something unexpected happened the power-off of which step on the one hand in superincumbent step, can recover data in a hard disk, even if cause hard disk to create bad sector because there is power-off, we can also recover to obtain complete data;Two aspects, then sector data is write further according to journal file compared to reading sector to be restored at rewind journal file access pattern hard disc data in prior art, the work that sector need not be read out by embodiment of the present invention, have only to the form of block, the data of Physical Page about place, sector recorded in Journal are write corresponding Physical Page, accordingly even when because power-off produces bad block, also can the write of monoblock re-powering and recover Journal when, can be to false bad block reparation, the worst piece of generation remaps.
In a kind of preferred implementation of the inventive method embodiment, make regular check on described Journal region, and the Journal region being likely to occur bad block is repaired;Thus reduce described Journal region and the risk of bad block occurs, only need to ensure that the Journal region of hard disk is not destroyed, just can ensure that the data recorded in hard disk will not be lost, improve and safeguard the efficiency of hard disc data and reduce the system resource safeguarded shared by hard disc data.
Seeing the structural representation that Fig. 3 is illustrated that the hard disk data recovery system of one embodiment of the invention, described hard disk has record and has the Physical Page of data file, it is characterised in that described system includes:
New journal file signal generating unit, has the Physical Page of data file for reading described record, according to the mode that page boundary is alignd, the data file in described Physical Page is generated in log region the new journal file relative to raw log files;
Breakpoint Physical Page determines unit, and for when the reading process of described Physical Page occurs to interrupt, Physical Page described in labelling is breakpoint Physical Page, and determines the address of described breakpoint Physical Page;
Log rollback unit, for journal file new described in rollback, writes described breakpoint Physical Page by the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file, completes the recovery of data.
Utilize embodiment of the present invention system to achieve the data file backed up in new journal file to be alignd according to page boundary, when reading break during hard disk and again read hard disk, the new journal file of rollback also recovers hard disc data, the data file alignd according to page boundary utilizing new journal file to back up covers corresponding Physical Page, embodiment of the present invention method and system are compared to prior art, read the work of sector data when eliminating rewind journal, and improve the efficiency of disk recovery;Further avoid during rewind journal, hard disc data cannot be recovered because reading I/O mistake produced by sector, thus reduce and cause the probability of loss of data because interrupting suddenly reading hard disk;Utilize new journal file to repair the vacation bad block of hard disk, increase the availability of hard disk.
As the further optimization of embodiment illustrated in fig. 3 system, described new journal file signal generating unit includes:
Data locking module, has the Physical Page of data file for reading described record, obtains described data file starting position on described Physical Page and end position;
Page boundary alignment module, is used for: according to described starting position and described end position, determine beginning of the page boundary position and page footing boundary position according to the mode of 4K alignment;
New daily record generation module, for generating the new journal file relative to raw log files by the mode that the data file in described Physical Page is alignd according to described beginning of the page boundary position and page footing boundary position in log region.
Under the pattern of " advanced form ", novel " 4K sector " hard disk uses page to represent internal storage location, and the size of page is 4K byte, by embodiment of the present invention method by the data file that backed up in new journal file according to 4K boundary alignment;Thus achieve when the new journal file of rollback, the hard disc data being backed up the alignment of 4K in new journal file is write hard disk in the way of block, when eliminating the new journal file of rollback, read the step of the sector of hard disk.
As the further optimization of embodiment illustrated in fig. 3 system, be connected with described log rollback unit also includes that original log clears up unit, and described original log cleaning unit is used for:
Raw log files after the recovery completing data, in invalid described log region.
By the preferred implementation of present system, after completing the recovery of the data to Physical Page, delete the raw log files of the Physical Page recovered, thus achieve after utilizing new journal file to recover number of physical pages evidence, when rewind journal carries out data recovery again to Same Physical page, avoid and utilize raw log files to cover Physical Page, and cause the data file entanglement recorded in the Physical Page that again recovers, thus ensure concordance and the integrity of data recorded in hard disc physical page.
Further as embodiment illustrated in fig. 3 system optimizes, and described beginning of the page boundary position=Described starting position/4K* 4K, described page footing boundary position=(described end position+4K-1)/4K*4K.About this preferred implementation, specifically can refer to foregoing invention embodiment of the method, therefore be not added with at this repeating.
As the further optimization of embodiment illustrated in fig. 3 system, also including of being connected with described log rollback unit remap unit, described in remap unit for:
When in described new journal file, the data file information according to page boundary alignd corresponding with the address of described breakpoint Physical Page cannot write described breakpoint Physical Page, the data file information alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file is remapping in the Physical Page of no data fileinfo, and correspondingly revises the physical page address of the data file information recording described breakpoint Physical Page in described new journal file.
When breakpoint Physical Page has " the worst piece ", and when the data backed up in new journal file cannot be write described breakpoint Physical Page, the fileinfo that described breakpoint Physical Page is backed up in new journal file is remapping to except the Physical Page of other non-recording data files of breakpoint Physical Page, thus ensure the reliability of stored data in hard disk, even if making breakpoint Physical Page be physics bad block and data cannot being write, also can recover hard disc data according to the data of the breakpoint Physical Page that new journal file is backed up, greatly reduce hard disk and lose the probability of data.
The embodiment of the present invention can be passed through hardware processor (hardware processor) and realize related function module unit.
Device embodiment described above is only schematically, the wherein said unit illustrated as separating component can be or may not be physically separate, the parts shown as unit can be or may not be physical location, i.e. may be located at a place, or can also be distributed on multiple NE.Some or all of module therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.Those of ordinary skill in the art, in the case of not paying performing creative labour, are i.e. appreciated that and implement.
Through the above description of the embodiments, those skilled in the art is it can be understood that can add the mode of required general hardware platform by software to each embodiment and realize, naturally it is also possible to pass through hardware.Based on such understanding, the part that prior art is contributed by technique scheme the most in other words can embody with the form of software product, this computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment or embodiment.
Last it is noted that above example is only in order to illustrate technical scheme, it is not intended to limit;Although the present invention being described in detail with reference to previous embodiment, it will be understood by those within the art that: the technical scheme described in foregoing embodiments still can be modified by it, or wherein portion of techniques feature is carried out equivalent;And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (10)

1. a hard disk data recovery, described hard disk has record and has the Physical Page of data file, its Being characterised by, described method includes:
Read described record and have the Physical Page of data file, by the data file in described Physical Page according to margin The neat mode of bound pair generates the new journal file relative to raw log files in log region;
When the reading process of described Physical Page occurs to interrupt, Physical Page described in labelling is breakpoint Physical Page, And determine the address of described breakpoint Physical Page;
New journal file described in rollback, by address phase with described breakpoint Physical Page in described new journal file The data file information according to page boundary alignment answered writes described breakpoint Physical Page, completes the recovery of data.
Method the most according to claim 1, it is characterised in that the described record of described reading has data literary composition The Physical Page of part, the mode data file in described Physical Page alignd according to page boundary is in log region Interior generation includes relative to the new journal file of raw log files:
Read described record and have the Physical Page of data file, obtain described data file on described Physical Page Starting position and end position;
According to described starting position and described end position, determine border, beginning of the page according to the mode of 4K alignment Position and page footing boundary position;
Data file in described Physical Page is alignd according to described beginning of the page boundary position and page footing boundary position Mode in log region, generate the new journal file relative to raw log files.
Method the most according to claim 2, it is characterised in that described beginning of the page boundary position=Described Starting position/4K* 4K, described page footing boundary position=(described end position+4K-1)/4K*4K。
Method the most according to claim 1, it is characterised in that after the recovery completing data, nothing Imitate the raw log files in described log region.
Method the most according to claim 1, it is characterised in that new journal file described in described rollback, By the data alignd according to page boundary corresponding with the address of described breakpoint Physical Page in described new journal file Fileinfo writes described breakpoint Physical Page, and the recovery completing data also includes:
Align according to page boundary when with the address of described breakpoint Physical Page corresponding in described new journal file When data file information cannot write described breakpoint Physical Page, by described new journal file with described breakpoint The address of Physical Page is remapping to no data file letter according to the data file information of page boundary alignment accordingly In the Physical Page of breath, and correspondingly revise the data recording described breakpoint Physical Page in described new journal file The physical page address of fileinfo, completes the recovery of data.
6. a hard disk data recovery system, described hard disk has record and has the Physical Page of data file, its Being characterised by, described system includes:
New journal file signal generating unit, is used for: reading described record has the Physical Page of data file, by described The mode that data file in Physical Page is alignd according to page boundary generates relative to original day in log region The new journal file of will file;
Breakpoint Physical Page positioning unit, is used for: when the reading process of described Physical Page occurs to interrupt, mark Remember that described Physical Page is breakpoint Physical Page, and determine the address of described breakpoint Physical Page;
Log rollback unit, is used for: new journal file described in rollback, by described new journal file with institute The address stating breakpoint Physical Page writes described breakpoint thing according to the data file information of page boundary alignment accordingly Reason page, completes the recovery of data.
System the most according to claim 6, it is characterised in that described new journal file signal generating unit Including:
Data locking module, has the Physical Page of data file for reading described record, obtains described data literary composition Part starting position on described Physical Page and end position;
Page boundary alignment module, for according to described starting position and described end position, according to 4K pair Neat mode determines beginning of the page boundary position and page footing boundary position;
New daily record generation module, is used for the data file in described Physical Page according to described beginning of the page boundary bit The mode with the alignment of page footing boundary position of putting generates the new day relative to raw log files in log region Will file.
System the most according to claim 7, it is characterised in that described beginning of the page boundary position=Described Starting position/4K* 4K, described page footing boundary position=(described end position+4K-1)/4K*4K。
System the most according to claim 6, it is characterised in that be connected with described log rollback unit Also include original log clear up unit, described original log cleaning unit be used for:
Raw log files after the recovery completing data, in invalid described log region.
System the most according to claim 6, it is characterised in that with described log rollback unit even Also including of connecing remap unit, described in remap unit for disconnected with described in described new journal file The address of some Physical Page cannot write described breakpoint thing according to the data file information of page boundary alignment accordingly During reason page, by corresponding according to page boundary pair with the address of described breakpoint Physical Page in described new journal file Neat data file information is remapping in the Physical Page of no data fileinfo, and correspondingly amendment is described New journal file records the physical page address of the data file information of described breakpoint Physical Page.
CN201510854551.9A 2015-11-30 2015-11-30 Hard disk data recovery method and system Pending CN105893172A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510854551.9A CN105893172A (en) 2015-11-30 2015-11-30 Hard disk data recovery method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510854551.9A CN105893172A (en) 2015-11-30 2015-11-30 Hard disk data recovery method and system

Publications (1)

Publication Number Publication Date
CN105893172A true CN105893172A (en) 2016-08-24

Family

ID=57001921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510854551.9A Pending CN105893172A (en) 2015-11-30 2015-11-30 Hard disk data recovery method and system

Country Status (1)

Country Link
CN (1) CN105893172A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542329A (en) * 2017-09-21 2019-03-29 阿里巴巴集团控股有限公司 Method, apparatus and system is written in log
CN109901799A (en) * 2019-02-28 2019-06-18 新华三信息安全技术有限公司 A kind of log reading/writing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1258913A (en) * 1998-12-30 2000-07-05 三星电子株式会社 Recording medium for memorizing information of every sector initial position and method for data management
US6453383B1 (en) * 1999-03-15 2002-09-17 Powerquest Corporation Manipulation of computer volume segments
CN102667740A (en) * 2009-11-20 2012-09-12 西部数据技术公司 Aligning data storage device partition to boundary of physical data sector

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1258913A (en) * 1998-12-30 2000-07-05 三星电子株式会社 Recording medium for memorizing information of every sector initial position and method for data management
US6453383B1 (en) * 1999-03-15 2002-09-17 Powerquest Corporation Manipulation of computer volume segments
CN102667740A (en) * 2009-11-20 2012-09-12 西部数据技术公司 Aligning data storage device partition to boundary of physical data sector

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542329A (en) * 2017-09-21 2019-03-29 阿里巴巴集团控股有限公司 Method, apparatus and system is written in log
CN109542329B (en) * 2017-09-21 2022-04-12 阿里云计算有限公司 Log writing method, storage management equipment and system
CN109901799A (en) * 2019-02-28 2019-06-18 新华三信息安全技术有限公司 A kind of log reading/writing method and device

Similar Documents

Publication Publication Date Title
US9836369B2 (en) Storage system to recover and rewrite overwritten data
CN102411523B (en) Method and device for storing file backups and backup method for file systems
CN100489808C (en) Storage system and bad storage device data maintenance method
JP2006268503A (en) Computer system, disk unit and data update control method
JP2008033874A (en) Data salvation method for redundant array derogation of independent disk and its system
CN104050056A (en) File system backup of multi-storage-medium device
CN105302665B (en) A kind of improved Copy on write Snapshot Method and system
CN102508733A (en) Disk array based data processing method and disk array manager
CN101782875A (en) Storage unit and data storage method
CN115793985B (en) Secure storage method, apparatus, device and storage medium
US9772782B2 (en) Non-volatile complement data cache
CN111984365B (en) Virtual machine virtual disk dual-live implementation method and system
US8938641B2 (en) Method and apparatus for synchronizing storage volumes
CN110597779A (en) Data reading and writing method in distributed file system and related device
US20100191944A1 (en) Data storage apparatus
US20210365318A1 (en) Using Erasure Coding in a Single Region to Reduce the Likelihood of Losing Objects Maintained in Cloud Object Storage
US20060215456A1 (en) Disk array data protective system and method
US9323622B2 (en) Progress recording method and recovering method for encoding operation on storage device
CN105893172A (en) Hard disk data recovery method and system
JP2005050073A (en) Data restoration method, and data recorder
US7600151B2 (en) RAID capacity expansion interruption recovery handling method and system
CN103092719A (en) Power-off protection method for file system
JP2010026812A (en) Magnetic disk device
CN105808386A (en) Hard disk data recovery verifying method
CN103605587A (en) Tape library data backup and filing method

Legal Events

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

Application publication date: 20160824

WD01 Invention patent application deemed withdrawn after publication