CN112231151A - Data recovery method and system - Google Patents
Data recovery method and system Download PDFInfo
- Publication number
- CN112231151A CN112231151A CN202011205538.8A CN202011205538A CN112231151A CN 112231151 A CN112231151 A CN 112231151A CN 202011205538 A CN202011205538 A CN 202011205538A CN 112231151 A CN112231151 A CN 112231151A
- Authority
- CN
- China
- Prior art keywords
- disk
- information
- file
- data
- physical sector
- 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
Links
- 238000011084 recovery Methods 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000005192 partition Methods 0.000 claims abstract description 29
- 230000015654 memory Effects 0.000 claims abstract description 20
- 239000007787 solid Substances 0.000 claims abstract description 10
- 238000001514 detection method Methods 0.000 claims description 3
- 241000700605 Viruses Species 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000006378 damage Effects 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1469—Backup restoration techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1456—Hardware arrangements for backup
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a data recovery method and a system, wherein all partitions of a disk are traversed to determine whether the disk is a solid disk of the system, if so, the disk is further read, and if not, the disk is skipped to read the next disk; further reading data information in the disk, obtaining initial physical sector addresses of all partitions on the current disk, serial numbers and/or total sector numbers of the disk where the current partition is located, and storing the initial physical sector addresses, the serial numbers and/or the total sector numbers; and reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read. The embodiment of the invention provides a data recovery method and a data recovery system, which aim to solve the problem that in the prior art, data is difficult to completely recover due to data loss caused by disk software problems.
Description
Technical Field
The embodiment of the invention relates to the technical field of data recovery, in particular to a data recovery method and a data recovery system.
Background
With the rapid development of information technology and the arrival of big data era, the utilization rate of computers has become widespread and plays an increasingly important role in our work and life, people increasingly acquire and process a large amount of information through computers, and simultaneously store the most important information of themselves in computer disks in the form of data files, the disks are used as the most common external memories of the computers for storing information of operating systems and a large amount of data information, the safety and reliability of the computers are very important, whether the computers are in normal operation or not directly relate to the work efficiency and the life order of people, and once the important data are damaged, the important data cause great loss to individuals or enterprises. Therefore, after data is lost, it is important to protect the data site well and retrieve the lost data. And the user misoperation, the defects of some application software and the attack of computer viruses can destroy useful data on the disk. Backup of disk data is important so that critical data can be restored when necessary.
Data recovery refers to a process of reading data by recovery software or a special means when data is invisible, unreadable, or lost due to damage of a storage medium or misoperation of personnel or a fault of an operating system. Simply put, data recovery is the process of restoring lost or abnormally inaccessible data due to hardware corruption, mis-partitioning, mis-formatting, mis-deletion, virus corruption, or other causes to a normal state.
Disclosure of Invention
Therefore, embodiments of the present invention provide a data recovery method and system, so as to solve the problem in the prior art that data is difficult to completely recover due to data loss caused by disk software problems.
In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:
the data recovery method disclosed by the embodiment of the invention comprises the following steps:
s101, traversing all partitions of the disk, determining whether the disk is a solid disk of the system, if so, reading the disk further, and if not, skipping the disk and reading the next disk;
s102, further reading data information in the disk, obtaining initial physical sector addresses of all partitions on the current disk, serial numbers and/or total sector numbers of the disk where the current partition is located, and storing the initial physical sector addresses and the serial numbers and/or the total sector numbers;
s103, acquiring cluster distribution information of files in the disk partition, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information, and storing the physical sector distribution information into a memory;
s104, finishing traversal after traversing all data files in the disk, storing the generated information file in a memory, and adding an index mark to the generated information file;
and S105, reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read.
Further, when adding an index mark to the generated information file, calculating physical sector distribution information of the generated information file, generating an information frame with the size of each sector from the physical sector distribution information, adding the index mark to the information frame, and storing the information file with the index mark added.
Further, when the file information is acquired, the physical sector distribution information, the file name and/or the actual size of the file of the acquired file may be calculated at the same time, and these information may be stored in the information file.
A data recovery system comprising: the detection module is used for traversing all the partitions of the disk, determining whether the disk is a solid disk of the system, if the disk is judged to be the solid disk, further reading the disk, and if the disk is judged not to be skipped, reading the next disk; the reading module is used for further reading data information in the disk, obtaining initial physical sector addresses of all partitions on the current disk, serial numbers and/or total sector numbers of the disk where the current partition is located, and storing the initial physical sector addresses, the serial numbers and/or the total sector numbers; the data reading module is used for acquiring cluster distribution information of files in the disk partition, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information and storing the physical sector distribution information into the memory; the storage module finishes traversing after traversing all data files in the disk, stores the generated information file in a memory, and adds an index mark to the generated information file; and the recovery module is used for reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read.
Further, in the storage module, when an index mark is added to the generated information file, physical sector distribution information of the generated information file is calculated, the physical sector distribution information is generated into an information frame with the size of a sector, the index mark is added to the information frame, and the information file with the index mark is stored.
Further, in the recovery module, the physical sector distribution information of the file, the file name and/or the actual size of the file may be calculated and stored on the information file at the same time.
The embodiment of the invention has the following advantages:
the invention backups the physical sector of the data information in the disk in advance, directly carries out index recovery according to the backup file when recovery is needed, is influenced by file encryption, can accurately and quickly recover the data even if a user does not know the data storage principle, and can completely recover the data according to the physical sector distribution information.
Drawings
Fig. 1 is a schematic flowchart of a data recovery method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data recovery method and system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention discloses a data recovery method, including the following steps: s101, traversing all partitions of the disk, determining whether the disk is a solid disk of the system, if so, reading the disk further, and if not, skipping the disk and reading the next disk; s102, further reading data information in the disk, obtaining initial physical sector addresses of all partitions on the current disk, serial numbers and/or total sector numbers of the disk where the current partition is located, and storing the initial physical sector addresses and the serial numbers and/or the total sector numbers; s103, acquiring cluster distribution information of files in the disk partition, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information, and storing the physical sector distribution information into a memory; s104, finishing traversal after traversing all data files in the disk, storing the generated information file in a memory, and adding an index mark to the generated information file; and S105, reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read. When data is lost due to operations such as deletion, formatting or virus destruction, before other data is not written into a disk record of a file, the data of the file is still in fact, the real storage location of the file data is not changed, only a system cannot be started or an operating system cannot identify the file, the capacity of the disk is larger and larger, the data in a personal disk is massive, and the data backup only needs to be performed through a network disk or an external storage device, so that the effort is not taken, and a lot of resources and time are wasted. When data cannot be read, recovery effect is not ideal due to the fact that recovery software is not good and bad, and particularly when a file system in a disk partition cannot be identified, a piece of self-defined file name data is displayed before a file system in a disk partition after a scanning process of the recovery software is finished. The invention backups the physical sector of the data information in the disk in advance, directly carries out index recovery according to the backup file when recovery is needed, is influenced by file encryption, can accurately and quickly recover the data even if a user does not know the data storage principle, and can completely recover the data according to the physical sector distribution information.
When the index mark is added to the generated information file, calculating the physical sector distribution information of the generated information file, generating an information frame with the size of the sector according to the physical sector distribution information, adding the index mark to the information frame, and storing the information file with the index mark. When the file information is acquired, the physical sector distribution information, the file name and/or the actual size of the file of the acquired file can be calculated at the same time, and the information is stored in the information file.
Selecting different reading modes according to the difference of the file types, and if the file type is FAT, obtaining the initial physical sector number of the file as follows: s1, the returned cluster number is calculated with respect to the start address of the root directory, and it is assumed that the cluster number returned by the file is: [ c1, c2, c3, c4, c5], hidden sector: h1, number of allocation tables: n, the allocation table size is: fs, number of sectors contained per cluster: t, then the starting physical sector with cluster number c1 is S1+ h1+ n Fs + c1 t, and the other clusters are calculated in a similar manner.
Referring to fig. 2, the present embodiment discloses a data recovery system, which includes: the detection module is used for traversing all the partitions of the disk, determining whether the disk is a solid disk of the system, if the disk is judged to be the solid disk, further reading the disk, and if the disk is judged not to be skipped, reading the next disk; the reading module is used for further reading the data information in the disk, obtaining the initial physical sector addresses of all the partitions on the current disk, the serial numbers and/or the total sector number of the disk where the current partition is located, storing the data information, reading the module, obtaining cluster distribution information of files in the disk partitions, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information, and storing the physical sector distribution information into a memory; the storage module finishes traversing after traversing all data files in the disk, stores the generated information file in a memory, and adds an index mark to the generated information file; and the recovery module is used for reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read.
In the storage module, when adding an index mark to the generated information file, calculating physical sector distribution information of the generated information file, generating an information frame with the size of the sector from the physical sector distribution information, adding the index mark to the information frame, and storing the information file with the index mark added. In the recovery module, the physical sector distribution information of the file, the file name and/or the actual size of the file may be calculated and stored on the information file.
The invention backups the physical sector of the data information in the disk in advance, directly carries out index recovery according to the backup file when recovery is needed, is influenced by file encryption, can accurately and quickly recover the data even if a user does not know the data storage principle, and can completely recover the data according to the physical sector distribution information.
And finally: the above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that are within the spirit and principle of the present invention are intended to be included in the scope of the present invention.
Claims (6)
1. A method for data recovery, comprising the steps of:
s101, traversing all partitions of the disk, determining whether the disk is a solid disk of the system, if so, reading the disk further, and if not, skipping the disk and reading the next disk;
s102, further reading data information in the disk, obtaining initial physical sector addresses of all partitions on the current disk, serial numbers and/or total sector numbers of the disk where the current partition is located, and storing the initial physical sector addresses and the serial numbers and/or the total sector numbers;
s103, acquiring cluster distribution information of files in the disk partition, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information, and storing the physical sector distribution information into a memory;
s104, finishing traversal after traversing all data files in the disk, storing the generated information file in a memory, and adding an index mark to the generated information file;
and S105, reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read.
2. A data recovery method as claimed in claim 1, characterized in that: when the index mark is added to the generated information file, calculating the physical sector distribution information of the generated information file, generating an information frame with the size of the sector according to the physical sector distribution information, adding the index mark to the information frame, and storing the information file with the index mark.
3. A data recovery method as claimed in claim 1, characterized in that: when the file information is acquired, the physical sector distribution information, the file name and/or the actual size of the file of the acquired file can be calculated at the same time, and the information is stored in the information file.
4. A data recovery system, comprising:
the detection module is used for traversing all the partitions of the disk, determining whether the disk is a solid disk of the system, if the disk is judged to be the solid disk, further reading the disk, and if the disk is judged not to be skipped, reading the next disk;
the reading module is used for further reading the data information in the disk, obtaining the initial physical sector addresses of all the partitions on the current disk, the serial numbers and/or the total sector number of the disk where the current partition is located, storing the data information, reading the module, obtaining cluster distribution information of files in the disk partitions, further selecting different reading modes according to the difference of file types, converting the cluster distribution information into physical sector distribution information, and storing the physical sector distribution information into a memory;
the storage module finishes traversing after traversing all data files in the disk, stores the generated information file in a memory, and adds an index mark to the generated information file;
and the recovery module is used for reading the marking information according to the information file stored in the memory, matching the corresponding data information in the magnetic disk according to the marking information, and finishing data recovery after all the data information in the magnetic disk is read.
5. A data recovery system according to claim 4, wherein: in the storage module, when adding an index mark to the generated information file, calculating the physical sector distribution information of the generated information file, generating an information frame with the size of the sector from the physical sector distribution information, adding the index mark to the information frame, and storing the information file with the index mark added.
6. A data recovery system according to claim 4, wherein: in the recovery module, the physical sector distribution information of the file, the file name and/or the actual size of the file may be calculated and stored on the information file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011205538.8A CN112231151A (en) | 2020-11-02 | 2020-11-02 | Data recovery method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011205538.8A CN112231151A (en) | 2020-11-02 | 2020-11-02 | Data recovery method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112231151A true CN112231151A (en) | 2021-01-15 |
Family
ID=74122002
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011205538.8A Pending CN112231151A (en) | 2020-11-02 | 2020-11-02 | Data recovery method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112231151A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116166472A (en) * | 2023-03-01 | 2023-05-26 | 上海威固信息技术股份有限公司 | Data recovery method and system for stored data |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1330322A (en) * | 2001-04-29 | 2002-01-09 | 北京瑞星科技股份有限公司 | Method for protecting and restoring data on hard disk |
US20050081004A1 (en) * | 2001-11-12 | 2005-04-14 | Zhang Jianhui | Method for backing up and recovering data in a hard disk |
CN104751076A (en) * | 2015-04-15 | 2015-07-01 | 四川神琥科技有限公司 | Method for recovering disk data |
CN107704341A (en) * | 2017-08-31 | 2018-02-16 | 湖北灰科信息技术有限公司 | File access pattern method, apparatus and electronic equipment |
CN112052121A (en) * | 2020-09-03 | 2020-12-08 | 北京尖晶尖科技有限公司 | Hard disk data recovery method and system |
-
2020
- 2020-11-02 CN CN202011205538.8A patent/CN112231151A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1330322A (en) * | 2001-04-29 | 2002-01-09 | 北京瑞星科技股份有限公司 | Method for protecting and restoring data on hard disk |
US20050081004A1 (en) * | 2001-11-12 | 2005-04-14 | Zhang Jianhui | Method for backing up and recovering data in a hard disk |
CN104751076A (en) * | 2015-04-15 | 2015-07-01 | 四川神琥科技有限公司 | Method for recovering disk data |
CN107704341A (en) * | 2017-08-31 | 2018-02-16 | 湖北灰科信息技术有限公司 | File access pattern method, apparatus and electronic equipment |
CN112052121A (en) * | 2020-09-03 | 2020-12-08 | 北京尖晶尖科技有限公司 | Hard disk data recovery method and system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116166472A (en) * | 2023-03-01 | 2023-05-26 | 上海威固信息技术股份有限公司 | Data recovery method and system for stored data |
CN116166472B (en) * | 2023-03-01 | 2024-04-16 | 上海威固信息技术股份有限公司 | Data recovery method and system for stored data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112052121B (en) | Hard disk data recovery method and system | |
CN106201338B (en) | Date storage method and device | |
CN100530125C (en) | Safety storage method for data | |
CN103019890B (en) | Block-level disk data protection system and method thereof | |
JP2010049488A (en) | Storage system and data management method | |
CN104077380A (en) | Method and device for deleting duplicated data and system | |
US10572335B2 (en) | Metadata recovery method and apparatus | |
CN107315659A (en) | The redundancy backup method and device of a kind of metadata | |
CN110597779A (en) | Data reading and writing method in distributed file system and related device | |
CN105354109A (en) | Backup method and apparatus for video monitoring index data | |
CN112231151A (en) | Data recovery method and system | |
US7600151B2 (en) | RAID capacity expansion interruption recovery handling method and system | |
CN116483284B (en) | Method, device, medium and electronic equipment for reading and writing virtual hard disk | |
WO2019037587A1 (en) | Data restoration method and device | |
TWI461904B (en) | Recovery method and device for linux using fat file system | |
CN110457163B (en) | Data recovery method and device for distributed block storage and storage medium | |
CN115599589B (en) | Data recovery method and related device | |
CN115309591B (en) | Recovery method and related device of full flash memory system | |
CN114138208B (en) | Processing method for preventing DRBD brain cracking and related components | |
CN107704208B (en) | Method, device and medium for repairing metadata | |
CN107545022B (en) | Disk management method and device | |
CN113391941B (en) | RAID read-write timeout processing method, device, equipment and medium | |
CN101192174A (en) | Rehabilitation processing method and system for magnetic disc array device capacity expansion interruption | |
CN105242985B (en) | Data recovery method and device | |
CN105324764A (en) | Storing backup data separate from catalog data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210115 |
|
RJ01 | Rejection of invention patent application after publication |