CN107526649B - Partition repairing method and device and electronic equipment - Google Patents

Partition repairing method and device and electronic equipment Download PDF

Info

Publication number
CN107526649B
CN107526649B CN201710788122.5A CN201710788122A CN107526649B CN 107526649 B CN107526649 B CN 107526649B CN 201710788122 A CN201710788122 A CN 201710788122A CN 107526649 B CN107526649 B CN 107526649B
Authority
CN
China
Prior art keywords
partition
hard disk
repaired
partitions
existing
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.)
Active
Application number
CN201710788122.5A
Other languages
Chinese (zh)
Other versions
CN107526649A (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.)
Hubei Grey Information Technology Co ltd
Original Assignee
Hubei Grey Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Grey Information Technology Co ltd filed Critical Hubei Grey Information Technology Co ltd
Priority to CN201710788122.5A priority Critical patent/CN107526649B/en
Publication of CN107526649A publication Critical patent/CN107526649A/en
Application granted granted Critical
Publication of CN107526649B publication Critical patent/CN107526649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0712Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

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

Abstract

The invention provides a partition repair method, a partition repair device and electronic equipment, and relates to the technical field of computer data repair, wherein the partition repair method comprises the steps of detecting whether a hard disk to be repaired can be normally identified; if so, recording the existing partitions in the hard disk, scanning sectors in the hard disk, and determining repairable partitions according to the scanning result, wherein the repairable partitions comprise the existing partitions; displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state; receiving a partition to be repaired selected by a user, and marking the partition to be repaired as a selected state; the partition marked as the selected state is repaired. The partition repairing method, the partition repairing device and the electronic equipment provided by the embodiment of the invention can automatically identify and protect the existing partition in the disk, prevent the existing partition from being damaged and prevent the user from missing the selection, and enhance the repairing effect.

Description

Partition repairing method and device and electronic equipment
Technical Field
The present invention relates to the field of computer data repair technologies, and in particular, to a partition repair method and apparatus, and an electronic device.
Background
Along with the increasing popularization of personal PCs and intelligent mobile terminals, the crime in the computer information field is also getting more and more fierce, the traditional software relying on manual auditing or foreigners (such as Encase and the like) is seriously not in accordance with the characteristics of domestic foreigners due to the characteristics of complicated data, secrecy or high use threshold (professional) and the like, and the development of electronic data foreigners is urgently required along with the continuous innovation and development of computer network technology and big data technology.
Partition repair is an important functional component of electronic data forensics, and is critical to facilitating electronic data forensics. For a read-write disk, under the condition of sudden power failure or erasing and clearing by malicious software, the entire disk cannot be normally identified by an operating system, and after a prompt formatted MBR (Master Boot Record) or a GPT (global Unique Identifier) Partition Table (disk Partition Table) is determined, the original Partition and Partition files are lost, and Partition repair is needed to retrieve the lost files.
The existing partition repair method carries out sector scanning on partitions in a whole disk and repairs the partitions selected by a user. Because the existing partitions in the disk cannot be identified in the prior art, the condition that the user selects the partitions in a missing manner is caused, the existing partitions are damaged, and the repairing effect is poor.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a partition repair method, device and electronic device, so as to automatically identify and protect an existing partition in a disk, prevent the existing partition from being damaged and users from selecting the existing partition, and enhance the repair effect.
In a first aspect, an embodiment of the present invention provides a partition repair method, including:
detecting whether the hard disk to be repaired can be normally identified;
if yes, recording the existing partitions in the hard disk;
scanning sectors in the hard disk and determining repairable partitions according to scanning results, wherein the repairable partitions comprise the existing partitions;
displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partitions in the hard disk are marked as a selected state;
receiving a partition to be repaired selected by a user, and marking the partition to be repaired as a selected state;
the partition marked as the selected state is repaired.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the scanning a sector in the hard disk includes:
determining the sector identifier and judging the sector partition attribute;
and determining the range of the scanned partition according to the sector identifier and the partition attribute.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the partition attributes include an NTFS partition, a FAT partition, and an ExFAT partition;
the judging the partition attribute of the sector comprises:
judging whether the sector belongs to the NTFS partition or not;
if not, judging whether the sector belongs to the FAT partition or not;
if not, judging whether the sector belongs to the ExFAT partition or not.
With reference to the first possible implementation manner of the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the determining, according to the scan result, a repairable partition includes:
judging whether the range of each scanned subarea has subarea overlap;
if so, a plurality of repairable partition combinations are determined based on the partition overlap.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where before repairing the partition marked as the selected state, the method further includes:
storing the current partition information of the hard disk;
and recording the current time and the repairing times, and creating a restoring point.
With reference to the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where before repairing the partition marked as the selected state, the method further includes:
and generating a disk partition distribution diagram according to the partition marked as the selected state.
With reference to the first aspect, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, where before scanning a sector in the hard disk, the method further includes:
and if the hard disk to be repaired is detected to be not normally identified, setting the partition type of the hard disk to be an MBR type, and repairing the boot sector of the hard disk.
In a second aspect, an embodiment of the present invention further provides a partition repair apparatus, including:
the detection module is used for detecting whether the hard disk to be repaired can be normally identified;
the recording module is used for recording the partitions existing in the hard disk when the hard disk can be normally identified;
a determining module, configured to scan sectors in the hard disk and determine a repairable partition according to a scan result, where the repairable partition includes the existing partition;
the display module is used for displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state;
the system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a partition to be repaired selected by a user and marking the partition to be repaired as a selected state;
and the repairing module is used for repairing the partition marked as the selected state.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the present invention further provides a computer-readable medium having a non-volatile program code executable by a processor, where the program code causes the processor to execute the method according to the first aspect.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the partition repairing method comprises the steps of detecting whether a hard disk to be repaired can be normally identified; if so, recording the existing partitions in the hard disk, scanning sectors in the hard disk, and determining repairable partitions according to the scanning result, wherein the repairable partitions comprise the existing partitions; displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state; receiving a partition to be repaired selected by a user, and marking the partition to be repaired as a selected state; the partition marked as the selected state is repaired. In the embodiment provided by the invention, after the hard disk is identified, the existing partition in the hard disk is recorded firstly; and then, carrying out sector scanning, and automatically marking the existing partition identified by scanning as a selected state, so that the existing partition can be protected and recovered no matter whether the user selects the existing partition at a later stage or not. Therefore, the partition repair method, the partition repair device and the electronic equipment provided by the embodiment of the invention can automatically identify and protect the existing partition in the disk, prevent the existing partition from being damaged and prevent the user from missing the selection, and enhance the repair effect.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a partition repair method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a sector scanning process in the partition repair method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a partitioned recovery device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. 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 existing partition repair method carries out sector scanning on the partitions in the whole disk and repairs the partitions selected by a user. Because the existing partitions in the disk cannot be identified in the prior art, the condition that the user selects the partitions in a missing manner is caused, the existing partitions are damaged, and the repairing effect is poor. Based on this, the partition repair method, the partition repair device and the electronic device provided by the embodiment of the invention can automatically identify and protect the existing partition in the disk, prevent the existing partition from being damaged and prevent the user from selecting the partition by mistake, and enhance the repair effect.
To facilitate understanding of the embodiment, a detailed description will be given to a partition repairing method disclosed in the embodiment of the present invention.
The first embodiment is as follows:
fig. 1 shows a flowchart of a partition repair method according to an embodiment of the present invention. As shown in fig. 1, the partition repair method includes the following steps:
step S101, detecting whether the hard disk to be repaired can be normally identified.
The hard disk to be repaired is checked whether to be normally identified, that is, the Partition type of the hard disk and each Partition divided on the hard disk can be normally identified, wherein the Partition type may be an MBR (Master Boot Record) type or a GPT (global Unique Identifier) Partition Table (raid) type.
Step S102, when detecting that the hard disk to be repaired can be normally identified, recording the partition existing in the hard disk.
Specifically, the hard disk to be repaired can be normally identified, and the partitioned partitions existing on the hard disk can be identified. For example, after loading the hard disk, it is displayed that the C partition and the D partition exist in the hard disk, and at this time, the existing partitions C partition and D partition need to be recorded.
In addition, if it is detected that the hard disk to be repaired cannot be normally identified, that is, after the hard disk is loaded, a loading error is prompted, at this time, the partition type of the hard disk may be set to be the MBR type, the boot sector of the hard disk is repaired, and then step S103 is executed.
Step S103, scanning sectors in the hard disk, and determining repairable partitions according to the scanning result, wherein the repairable partitions comprise the existing partitions.
Specifically, various sectors of the hard disk are scanned, thereby obtaining a repairable partition. Comparing the repairable partitions with the existing partitions recorded in step S102, it can be determined which repairable partitions are the corresponding existing partitions.
In one embodiment, the step S103 of scanning the partitions in the hard disk includes:
(a) and determining the identification of the sector and judging the partition attribute of the sector.
The partition attributes include NTFS (New Technology File System) partition, FAT (File Allocation Table) partition, and Extended File Allocation Table (Extended FAT) partition, where the FAT partition includes types of FAT12, FAT16, FAT32, and the like.
Specifically, the determining the partition attribute of the sector includes: judging whether the sector belongs to the NTFS partition or not; if not, judging whether the sector belongs to the FAT partition or not; if not, judging whether the sector belongs to the ExFAT partition or not. That is, whether a sector belongs to NTFS partition, FAT partition, and ExFAT partition is sequentially determined, and the specific determination sequence is not limited herein.
(b) And determining the range of the scanned partition according to the identification and the partition attribute of the sector.
The range of the partition includes a plurality of parameters, which may specifically include a size of each partition and an identifier of a starting sector of each partition.
Fig. 2 is a flowchart illustrating a sector scanning process in the partition repairing method according to an embodiment of the present invention. In an embodiment, the scanning the partition in the hard disk specifically includes:
step S201, determine whether the current sector belongs to the NTFS partition.
If yes, sequentially executing step S202 and step S207; if not, go to step S203.
Step S202, determining that the partition to be repaired of the NTFS exists, and recording the initial sector and the partition size of the partition to be repaired of the NTFS.
Specifically, the starting sector and size of the partition to be repaired by the NTFS may be determined by the NTFS primary sector.
Step S203, determine whether the current sector belongs to the FAT partition.
If yes, sequentially executing step S204 and step S207; if not, go to step S205.
Step S204, determining that the FAT partition to be repaired exists, and recording the initial sector and the partition size of the FAT partition to be repaired.
Step S205, determine whether the current sector belongs to the ExFAT partition.
If yes, executing step S206 and step S207 in sequence; if not, step S207 is directly performed.
Step S206, determining that the ExFAT partition to be repaired exists, and recording the initial sector and the partition size of the ExFAT partition to be repaired.
Step S207, reading the sector identifier.
Step S208, determine whether the current sector is the last sector.
Specifically, it is determined whether the sector corresponding to the sector id is the last sector through the sector id read in step S207. If yes, the execution process is ended; if not, step S209 and step S201 are executed in sequence.
Step S209 updates the sector identification.
In one embodiment, the sector identification is incremented by one and recorded, and then the next sector is scanned, step S201.
Therefore, through the sector scanning process, the size of each partition and the identifier of the start sector of each partition can be obtained, so as to obtain the range of each scanned partition.
Further, in order to improve the user experience, expand the selectable performance, and further meet the diversified requirements of the user, in step S103, determining the repairable partition according to the scanning result includes: judging whether the range of each scanned partition has partition overlapping; if so, a plurality of repairable partition combinations are determined based on the partition overlap.
Specifically, for example, the range of the partition C obtained by scanning is sector 0 to sector 30, the range of the partition D is sector 31 to sector 90, and the range of the partition E is sector 61 to sector 90, at this time, it may be determined that the partition D and the partition E overlap, and at this time, it may be determined that the partition C and the partition D are combined as follows (1); (2) partition C, partition D, and partition E. Therefore, the partition repairing method provided by the embodiment of the invention can automatically identify the unreasonable situation caused by partition range collision, and provide a plurality of choices for users.
It should be noted that the specific numerical values in the above embodiments are only exemplary and do not limit the scope of the present invention.
Step S104, displaying a selection interface of the partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state.
Specifically, after the repairable partition is determined, the user may be allowed to select the partition, so that the partition selected by the user is repaired. In one embodiment, a plurality of the above-described repairable partition combinations are displayed on a selection interface. In order to prevent the existing partition from being damaged due to the fact that the user selects the partition in a missing mode or in a wrong mode in the subsequent process, the existing partition in the hard disk is marked to be in a selected state.
Step S105, receiving the partition to be repaired selected by the user, and marking the partition to be repaired as a selected state.
Specifically, the user selects a partition to be repaired from the partition combination as the partition to be repaired. And marking the partition to be repaired so as to facilitate the subsequent repair processing.
And step S106, repairing the partition marked as the selected state.
Specifically, a partition table is created or updated for the partitions marked as selected (including the existing partitions and the partitions to be repaired selected by the user), and parameters of each partition marked as selected, such as partition size, end-of-sector mark, start sector, hidden sector and other items to be repaired, are modified. The specific repair process can be performed by referring to the existing scheme in the prior art.
In addition, if it is determined in step (a) above that there is an ExFAT partition to be repaired, the corresponding uppercase character file needs to be updated or created in step S106.
In the embodiment of the invention, the partition repairing method comprises the steps of detecting whether a hard disk to be repaired can be normally identified; if so, recording the existing partitions in the hard disk, scanning sectors in the hard disk, and determining repairable partitions according to the scanning result, wherein the repairable partitions comprise the existing partitions; displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state; receiving a partition to be repaired selected by a user, and marking the partition to be repaired as a selected state; the partition marked as the selected state is repaired. In the embodiment provided by the invention, after the hard disk is identified, the existing partition in the hard disk is recorded firstly; and then, carrying out sector scanning, and automatically marking the existing partition identified by scanning as a selected state, so that the existing partition can be protected and recovered no matter whether the user selects the existing partition at a later stage or not. Therefore, the partition repairing method provided by the embodiment of the invention can automatically identify and protect the existing partition in the disk, prevent the existing partition from being damaged and the phenomenon of selection omission of a user, and enhance the repairing effect.
Further, in order to provide a multi-repair/restoration repair function and prevent an error repair from occurring, before step S106, the partition repair method further includes: saving the current partition information of the hard disk; and recording the current time and the repairing times, and creating a restoring point. Preferably, the storage is performed before each repair, and the recovery point is created, so that a user can arbitrarily select the recovery point to be recovered to perform recovery after the error repair.
Further, in order to facilitate the user to preview, before step S106, the partition repairing method further includes: and generating a disk partition distribution diagram according to the partition marked as the selected state. Therefore, the user can clearly check the distribution condition of each partition after the hard disk is repaired.
Example two:
fig. 3 shows a schematic structural diagram of a partitioned recovery device according to an embodiment of the present invention. As shown in fig. 3, the partition repair apparatus includes:
the detection module 11 is used for detecting whether the hard disk to be repaired can be normally identified;
a recording module 12, configured to record an existing partition in a hard disk to be repaired when the hard disk can be normally identified;
a determining module 13, configured to scan sectors in the hard disk and determine a repairable partition according to a scan result, where the repairable partition includes an existing partition;
a display module 14, configured to display a selection interface of a partition to be repaired, where the selection interface includes all recoverable partitions, and a partition existing in the hard disk is marked as a selected state;
a receiving module 15, configured to receive a partition to be repaired selected by a user, and mark the partition to be repaired as a selected state;
and a repair module 16, configured to repair the partition marked in the selected state.
In the embodiment provided by the invention, after the hard disk is identified, the existing partition in the hard disk is recorded firstly; and then, carrying out sector scanning, and automatically marking the existing partition identified by scanning as a selected state, so that the existing partition can be protected and recovered no matter whether the user selects the existing partition at a later stage or not. Therefore, the partition repair device provided by the embodiment of the invention can automatically identify and protect the existing partition in the disk, prevent the existing partition from being damaged and prevent the user from selecting the partition, and enhance the repair effect.
Example three:
referring to fig. 4, an embodiment of the present invention further provides an electronic device 100, including: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected through the bus 42; the processor 40 is arranged to execute executable modules, such as computer programs, stored in the memory 41.
The Memory 41 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
The bus 42 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
The memory 41 is used for storing a program, the processor 40 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 40, or implemented by the processor 40.
The processor 40 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 40. The Processor 40 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the method in combination with the hardware thereof.
The partition repair device and the electronic device provided by the embodiment of the invention have the same technical characteristics as the partition repair method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The computer program product for performing the partition repair method provided in the embodiment of the present invention includes a computer-readable storage medium storing a nonvolatile program code executable by a processor, where instructions included in the program code may be used to execute the method described in the foregoing method embodiment, and specific implementation may refer to the method embodiment, and is not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and the electronic device described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A partition repair method, comprising:
detecting whether the hard disk to be repaired can be normally identified;
if yes, recording the existing partitions in the hard disk;
scanning sectors in the hard disk and determining repairable partitions according to scanning results, wherein the repairable partitions comprise the existing partitions;
displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partitions in the hard disk are marked as a selected state;
receiving a partition to be repaired selected by a user, and marking the partition to be repaired as a selected state;
repairing the partition marked as the selected state;
the scanning the sectors in the hard disk comprises:
determining the sector identifier and judging the sector partition attribute;
and determining the range of the scanned partition according to the sector identifier and the partition attribute.
2. The method of claim 1, wherein the partition attributes comprise NTFS, FAT, and ExFAT partitions;
the judging the partition attribute of the sector comprises:
judging whether the sector belongs to the NTFS partition or not;
if not, judging whether the sector belongs to the FAT partition or not;
if not, judging whether the sector belongs to the ExFAT partition or not.
3. The method of claim 1, wherein determining a repairable partition from scan results comprises:
judging whether the range of each scanned subarea has subarea overlap;
if so, a plurality of repairable partition combinations are determined based on the partition overlap.
4. The method of claim 1, wherein before repairing the partition marked as the selected state, further comprising:
storing the current partition information of the hard disk;
and recording the current time and the repairing times, and creating a restoring point.
5. The method of claim 1, wherein before repairing the partition marked as the selected state, further comprising:
and generating a disk partition distribution diagram according to the partition marked as the selected state.
6. The method of claim 1, wherein prior to scanning the sectors in the hard disk, further comprising:
and if the hard disk to be repaired is detected to be not normally identified, setting the partition type of the hard disk to be an MBR type, and repairing the boot sector of the hard disk.
7. A partitioned recovery device, comprising:
the detection module is used for detecting whether the hard disk to be repaired can be normally identified;
the recording module is used for recording the partitions existing in the hard disk when the hard disk can be normally identified;
a determining module, configured to scan sectors in the hard disk and determine a repairable partition according to a scan result, where the repairable partition includes the existing partition; scanning sectors in the hard disk, wherein the scanning of the sectors comprises determining the identification of the sectors and judging the partition attributes of the sectors; determining the range of the scanned partition according to the sector identifier and the partition attribute;
the display module is used for displaying a selection interface of a partition to be repaired, wherein the selection interface comprises all recoverable partitions, and the existing partition in the hard disk is marked as a selected state;
the system comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a partition to be repaired selected by a user and marking the partition to be repaired as a selected state;
and the repairing module is used for repairing the partition marked as the selected state.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 6 when executing the computer program.
9. A computer-readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of any of claims 1 to 6.
CN201710788122.5A 2017-08-31 2017-08-31 Partition repairing method and device and electronic equipment Active CN107526649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710788122.5A CN107526649B (en) 2017-08-31 2017-08-31 Partition repairing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710788122.5A CN107526649B (en) 2017-08-31 2017-08-31 Partition repairing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN107526649A CN107526649A (en) 2017-12-29
CN107526649B true CN107526649B (en) 2021-02-19

Family

ID=60683562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710788122.5A Active CN107526649B (en) 2017-08-31 2017-08-31 Partition repairing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN107526649B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685235B (en) * 2021-03-11 2021-05-18 湖南生物机电职业技术学院 ExFAT data recovery method and system based on BPB key parameters

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1109979C (en) * 1999-01-12 2003-05-28 李增胜 Method for quick protection and recovery for hard disc data of computer
CN103077100B (en) * 2013-01-31 2016-03-02 广东欧珀移动通信有限公司 Fro backing-up non-volatile data and restoration methods
CN105389228A (en) * 2015-11-03 2016-03-09 广东欧珀移动通信有限公司 Data partition repairing method and system

Also Published As

Publication number Publication date
CN107526649A (en) 2017-12-29

Similar Documents

Publication Publication Date Title
CN103268201B (en) A kind of date storage method, memory storage and read method
US11048601B2 (en) Disk data reading/writing method and device
CN110162429B (en) System repair method, server and storage medium
CN104376875A (en) Methods and devices for predicting and determining life of storage device
WO2015103917A1 (en) Management method and apparatus of wireless routing device
US20170139813A1 (en) Method and device for checking influence of deleting cache file, and mobile terminal
CN109582332B (en) System upgrading method and device for Internet camera
CN110727597A (en) Method for completing use case based on log troubleshooting invalid codes
CN102722669B (en) Completeness verification method of operating system
CN107229421B (en) Method and device for creating video data storage system, method and device for writing file into video data storage system and method and device for reading video data storage system
CN112835528A (en) Dirty page refreshing method and device, electronic equipment and storage medium
CN107526649B (en) Partition repairing method and device and electronic equipment
CN111221553A (en) Firmware upgrading method and device
CN107704340B (en) PE mirror image file generation method and device and electronic equipment
CN108108467B (en) Data deleting method and device
CN112506941A (en) Processing method and device for checking point, electronic equipment and storage medium
CN105701004B (en) Application testing method and device
CN110767258B (en) Data erasure command test method and related device
CN113505026B (en) Method, device and equipment for verifying backup data and storage medium
WO2017076034A1 (en) Method and device for formatting memory of mobile terminal
CN113535470A (en) Configuration backup method and device, electronic equipment and storage medium
CN110018968B (en) Data reading method, electronic equipment and computer storage medium
CN102346676B (en) Multiple starting management method for computer
CN110795155A (en) System starting method and device, electronic equipment and storage medium
KR101116053B1 (en) File Backup Method and devices using the same

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
GR01 Patent grant
GR01 Patent grant