Data recovery method and device
By adjusting the hard disk mode and using UEFI firmware programs to export and restore the backup of GPT partition tables, the problem of data being unreadable due to corruption of GPT partition tables is solved, and fast and accurate data recovery is achieved, suitable for a variety of CPU architectures.
Patent Information
- Application Number
- CN202210364286.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The prior art is difficult to quickly and accurately restore globally uniquely identified disk partition tables, especially when the GPT partition table is corrupted, resulting in data being unreadable and used.
By adjusting the hard disk mode to ensure the storage location of the primary partition table and the backup partition table, use the UEFI firmware program to export the primary partition table data and store it as a backup, verify and restore the primary partition table.
It realizes rapid and accurate recovery of GPT partition tables in the event of damage, improves the efficiency and success rate of data recovery, and is suitable for a variety of CPU architectures, with low cost and wide range of use.
Smart Images

Figure CN114816847B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a data recovery method and device. Background Art
[0002] GPT is the abbreviation of globally unique identifier partition table, which means "globally unique identifier partition table". It is part of the Extensible Firmware Interface (EFI) standard. GPT was created to replace the old MBR (master boot record), mainly to solve the problem that the MBR partition table does not support partitions larger than 2.2TB.
[0003] Currently, Microsoft's Windows 10 and various Linux systems use the GPT disk partition format, and Windows 10 no longer supports MBR. With the increasing number of Windows 10 users and various Linux users, the problem of data in the hard disk being unable to be read and used due to GPT partition table problems is more prominent.
[0004] When a GPT storage disk encounters problems such as partition table corruption, invisible data, or unreadable data due to misoperation or failure of the operating system itself, it is possible that there is a logical error in the GPT partition table. Certain technical means can be used to rescue and recover the valuable data lost on desktop hard drives, laptop hard drives, server hard drives, and other devices.
[0005] Existing solution 1: Full recovery by a professional data recovery company
[0006] The disadvantages of this solution are:
[0007] The security of data cannot be guaranteed, additional costs are required, the recovery cycle is long, and the recovery success rate is low.
[0008] Existing solution 2: Use the third tool WinHex to restore the GPT partition table
[0009] The disadvantages of this solution are:
[0010] You need to start the tool operating system and execute WinHex software. WinHex only has Windows version and can only be applied to X86 architecture CPU platform, with poor versatility. It is helpless for non-X86 architecture CPU platforms such as Arm, Feiteng, and Loongson. Summary of the invention
[0011] The present invention provides a data recovery method and device capable of quickly, accurately and widely recovering a backup of a disk partition table with a global unique identifier.
[0012] In order to solve the above technical problems, an embodiment of the present invention provides a data recovery method, including:
[0013] Adjusting the hard disk mode to the target mode to ensure that the head and tail of the disk can respectively store the primary partition table and the backup partition table that globally uniquely identify the disk partition table;
[0014] Exporting target data from the primary partition table stored in the hard disk based on the UEFI firmware program, and storing the target data in a target area for archiving;
[0015] When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, wherein the verification comparison includes a verification comparison with the archived content;
[0016] If the verification is successful, at least the content of the backup partition table is written into the primary partition table to complete the recovery of the primary partition table.
[0017] As an optional embodiment, the adjusting the hard disk mode to a target mode includes:
[0018] The hard disk mode is adjusted to a globally unique identification disk partition table mode.
[0019] As an optional embodiment, the exporting of target data from the primary partition table stored in the hard disk based on the UEFI firmware program, and storing the target data in a target area for archiving, includes:
[0020] Reading the primary partition table stored in the hard disk based on the UEFI firmware program, and exporting the primary partition table information to a primary partition table file;
[0021] The master partition table file is saved to the target firmware or target hard disk for archiving.
[0022] As an optional embodiment, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, including:
[0023] When the primary partition table needs to be restored, the partition table entry of the backup partition table of the hard disk is read based on the UEFI firmware program;
[0024] The partition table entry is verified and compared with the corresponding content in the archived content to obtain a comparison result.
[0025] As an optional embodiment, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, further comprising:
[0026] Reading a partition table header of a backup partition table of the hard disk based on the UEFI firmware program;
[0027] The content of the partition header is subjected to a cyclic redundancy check, and is checked and compared with the corresponding content in the archived content.
[0028] As an optional embodiment, when the primary partition table needs to be restored, the method further includes:
[0029] Based on the UEFI firmware program, the content of the primary partition table file is written into the primary partition table to complete the recovery of the primary partition table.
[0030] Another embodiment of the present invention also provides a data recovery device, including:
[0031] A modification module, used for modifying the hard disk format to a target format, so as to ensure that the head and tail of the disk can respectively store a primary partition table and a backup partition table that globally uniquely identify the disk partition table;
[0032] A processing module, used for exporting target data from the primary partition table stored in the hard disk according to the UEFI firmware program, and storing the target data in a target area for archiving;
[0033] A verification module, used for reading the backup partition table based on the UEFI firmware program and performing a verification comparison when the primary partition table needs to be restored, wherein the verification comparison includes a verification comparison with the archived content;
[0034] The writing module is used to write at least the content of the backup partition table into the main partition table when the verification is successful, so as to complete the recovery of the main partition table.
[0035] As an optional embodiment, the modifying the hard disk format to the target format includes:
[0036] The hard disk format is modified to a globally unique identifier disk partition table format.
[0037] As an optional embodiment, the exporting of target data from the primary partition table stored in the hard disk based on the UEFI firmware program, and storing the target data in a target area for archiving, includes:
[0038] Reading the primary partition table stored in the hard disk based on the UEFI firmware program, and exporting the primary partition table information to a primary partition table file;
[0039] The master partition table file is saved to the target firmware or target hard disk for archiving.
[0040] As an optional embodiment, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, including:
[0041] When the primary partition table needs to be restored, the partition table entry of the backup partition table of the hard disk is read based on the UEFI firmware program;
[0042] The partition table entry is verified and compared with the corresponding content in the archived content to obtain a comparison result.
[0043] Based on the disclosure of the above embodiments, it can be known that the beneficial effects of the embodiments of the present invention include completing data recovery after the partition table changes caused by damage or the like based on the UEFI firmware program by utilizing the UEFI protocol. By using the method of this embodiment, the recovery program for the globally uniquely identifying the disk partition table can run independently without the need for an additional third tool. Only based on the standard UEFI protocol, it can be cross-platform after cross-compilation on CPU platforms of all architectures. The scope of use is wider, the cost is low, the recovery efficiency is high, the cycle is short, and the user experience of the device is improved.
[0044] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0045] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0047] Figure 1 The figure is a flow chart of a data recovery method in an embodiment of the present invention.
[0048] Figure 2 The figure is a flow chart of a data recovery method in another embodiment of the present invention.
[0049] Figure 3 It is a schematic diagram of the structure of a globally unique identifier disk partition table in an embodiment of the present invention.
[0050] Figure 44 is a structural block diagram of a data recovery device in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings, but are not intended to limit the present invention.
[0052] It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the following description should not be considered as limiting, but merely as an example of an embodiment. Other modifications within the scope and spirit of the present disclosure will occur to those skilled in the art.
[0053] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the general description of the present disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the present disclosure.
[0054] These and other characteristics of the invention will become apparent from the following description of a preferred form of embodiment given as a non-limiting example, with reference to the accompanying drawings.
[0055] It should also be understood that, although the invention has been described with reference to some specific examples, those skilled in the art will be able to realize many other equivalent forms of the invention that have the characteristics recited in the claims and are therefore within the scope of protection defined thereby.
[0056] The above and other aspects, features and advantages of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
[0057] Specific embodiments of the present disclosure are described hereinafter with reference to the accompanying drawings; however, it should be understood that the disclosed embodiments are merely examples of the present disclosure, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in a variety of ways with substantially any suitable detailed structure.
[0058] This specification may use the phrases "in one embodiment," "in another embodiment," "in a further embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present disclosure.
[0059] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0060] like Figure 1 As shown, an embodiment of the present invention provides a data recovery method, including:
[0061] Modify the hard disk format to the target format to ensure that the head and tail of the disk can store the primary partition table and the backup partition table that uniquely identify the disk partition table;
[0062] Export the target data from the main partition table of the hard disk storage based on the UEFI firmware program, and store the target data in the target area for archiving;
[0063] When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program and verified and compared, including verification and comparison with the archived content;
[0064] If the verification is successful, at least the contents of the backup partition table are written into the primary partition table, completing the recovery of the primary partition table.
[0065] The data recovery method in this embodiment can be a method for implementing GPT (globally unique identifier partition table) partition table data recovery based on the UEFI (Unified Extensible Firmware Interface) standard protocol. The specific scheme can be implemented by using a program developed by using UEFI firmware or UEFI's shell layer (shell layer), that is, the UEFI firmware program in this embodiment can be a program developed based on UEFI firmware or UEFI's shell layer. The method in this embodiment complies with the standard UEFI protocol, has high compatibility and versatility, supports all CPU architectures, and enables customers to independently master the entire data recovery process of the GPT partition table, and customer data can be fully guaranteed.
[0066] For example, in this embodiment, the hard disk storing the globally unique disk partition table is first formatted so that the head of the hard disk can store the main partition table of the globally unique disk partition table, and the tail of the hard disk can store the backup partition table of the globally unique disk partition table. Then, the main partition table and the backup partition table are stored in the head and tail of the hard disk respectively. After that, the system can process the main partition table based on the UEFI firmware program, and store it separately for archiving. That is, the content of the main partition table will not only be stored in the backup partition table, but also in the target area accessible to other systems. When it is determined that the main partition table cannot be accessed normally due to a fault or other reasons, the system determines that data recovery is required. At this time, the system will read the backup partition table based on the UEFI firmware program and verify its content. If the verification is successful, it will be written into the main partition table to complete the data recovery of the main partition table. The verification and comparison method includes verification based on the separately stored archived content.
[0067] Based on the disclosure of the above embodiments, it can be known that the beneficial effects of this embodiment include completing data recovery after the partition table changes caused by damage or the like based on the UEFI firmware program by utilizing the UEFI protocol. By using the method of this embodiment, the recovery program for the globally uniquely identifying the disk partition table can run independently without the need for an additional third tool. Only based on the standard UEFI protocol, it can be cross-platform after cross-compilation on CPU platforms of all architectures. The scope of use is wider, and the cost is low, the recovery efficiency is high, and the cycle is short, which improves the user experience of the device.
[0068] Furthermore, in this embodiment, modifying the hard disk format to the target format includes:
[0069] Change the hard disk format to the globally unique identifier partition table format.
[0070] That is to set the hard disk, such as HD mechanical hard disk, SATA SSD hard disk or NVMe SSD hard disk, etc., to GPT mode, and then perform normal partitioning and system installation. After the hard disk is adjusted in mode, Protective MBR and GPT primary partition table will be stored at LBA0~LBA34 at the beginning of the hard disk, and GPT backup partition table will be stored at LBA-34~LBA-1 at the end of the disk, as described below.
[0071] Furthermore, if Figure 2 As shown, based on the UEFI firmware program, the target data is exported from the main partition table of the hard disk storage, and the target data is stored in the target area for archiving, including:
[0072] Read the primary partition table stored in the hard disk based on the UEFI firmware program, and export the primary partition table information to the primary partition table file;
[0073] Save the master partition table file to the target firmware or target hard disk for archiving.
[0074] For example, Figure 3 As shown, Figure 3 The structure of the GPT partition table is shown, where:
[0075] LBA0: At the head of the GPT partition table, a traditional MBR (LBA 0) is still stored for compatibility reasons. This MBR is called the Protective MBR.
[0076] LBA1: The partition table header (LBA 1), which defines the available space on the hard disk and the size and number of entries that make up the partition table.
[0077] The partition table header also records the GUID of the hard disk, the location and size of the partition table header itself, and the location and size of the backup partition table header and partition table (at the end of the hard disk). The partition table header also stores the CRC32 checksum information of itself and the partition table (to be introduced later). The firmware, boot program and operating system can determine whether the partition table is wrong based on the CRC32 checksum information when starting up. If there is an error, the software can be used to restore the entire primary partition table from the backup GPT partition table at the end of the hard disk. If the backup GPT partition table also has a checksum error, the hard disk will be unusable.
[0078] LBA 2–33: LBA 2–33 is where the partition table entry is stored. The GPT partition table uses a simple and direct way to represent partitions. The first 16 bytes of a partition table entry are the partition type GUID. The next 16 bytes are the unique GUID for the partition (the GUID refers to the partition itself, and the aforementioned GUID refers to the partition type). Next are the 64-bit LBA numbers for the start and end of the partition, as well as the partition name and attributes.
[0079] The GPT partition table backup information storage content, that is, the GPT backup partition table content, includes:
[0080] LBA-1: This is the backup partition header described in LBA1, which has the same content as LBA1
[0081] LBA-34~LBA-2: Stores the following data: the location and size of the backup partition table described in LBA1 (at the end of the hard disk), which is equivalent to LBA 2~LBA33 and has the same content.
[0082] In this embodiment, when the hard disk is in normal condition, the developed UEFI firmware program can be used to read the LBA0~LBA34 area of the hard disk to export the GPT information to the file gpt.info, which is the partition table file. The partition table file is then saved in the firmware flash. It can also be saved in storage media such as mobile hard disks and network disks for archiving. The archived content is used for subsequent verification of the data in the backup partition table.
[0083] Furthermore, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program and a verification comparison is performed, including:
[0084] When the primary partition table needs to be restored, the partition table entries of the backup partition table of the hard disk are read based on the UEFI firmware program;
[0085] Verify and compare the partition table entry with the corresponding content in the archived content to obtain a comparison result.
[0086] For example, the UEFI firmware program in this embodiment has a recovery function module. When an accident occurs in the disk and the disk cannot be accessed normally or the GPT primary partition table needs to be actively restored, the recovery function module of the UEFI firmware program can read the LBA-34 to LBA-2 area content in the backup partition table at the end of the hard disk and compare it with the corresponding content in the saved gpt.info, that is, compare it with the corresponding content of the primary partition table file. If the verification is successful, the content of LAB-34 to LBA-2 in the backup partition table is written back to LBA2 to LBA33 in the primary partition table at the head of the hard disk.
[0087] Furthermore, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, which also includes:
[0088] Read the partition table header of the backup partition table of the hard disk based on the UEFI firmware program;
[0089] Perform a cyclic redundancy check on the contents of the partition header and compare them with the corresponding contents in the archived content.
[0090] For example, the system can read the LBA-1 area content in the backup partition table at the end of the hard disk again through the recovery function module of the UEFI firmware program, and perform a cyclic redundancy check on the content of LBA-1. Specifically, the check can be based on the CRC32 check information stored in the backup partition table. If the check is successful, the content will continue to be checked with the corresponding content in the saved gpt.info, that is, continue to be checked with the corresponding content in the main partition table file. If the check is successful again, the content of LBA-1 can be written back to LBA1 of the main partition table at the head of the hard disk based on the UEFI firmware program. At this time, the recovery of all the contents of all GPT main partition tables is completed, and the user can access the hard disk normally again.
[0091] Optionally, when the primary partition table needs to be restored, it also includes:
[0092] If the verification fails, the content of the primary partition table file is written into the primary partition table based on the UEFI firmware program to complete the recovery of the primary partition table.
[0093] For example, if part or all of the content in the backup partition table fails to verify, making the system unable to complete the data recovery of the main partition table, resulting in the inability to access the hard disk normally, the system can directly write the content of the main partition table file into the main partition table based on the recovery function module of the UEFI firmware program to complete the recovery of the main partition table, that is, directly write it into the main partition table based on the archived content to complete its data recovery.
[0094] like Figure 4As shown, another embodiment of the present invention also provides a data recovery device, including:
[0095] A modification module, used for modifying the hard disk format to a target format, so as to ensure that the head and tail of the disk can respectively store a primary partition table and a backup partition table that globally uniquely identify the disk partition table;
[0096] A processing module, used for exporting target data from the primary partition table stored in the hard disk according to the UEFI firmware program, and storing the target data in a target area for archiving;
[0097] A verification module, used for reading the backup partition table based on the UEFI firmware program and performing a verification comparison when the primary partition table needs to be restored, wherein the verification comparison includes a verification comparison with the archived content;
[0098] The writing module is used to write at least the content of the backup partition table into the main partition table when the verification is successful, so as to complete the recovery of the main partition table.
[0099] Based on the disclosure of the above embodiments, it can be known that the beneficial effects of this embodiment include completing data recovery after the partition table changes caused by damage or the like based on the UEFI firmware program by utilizing the UEFI protocol. By using the data recovery device of this embodiment, the recovery program of the globally uniquely identified disk partition table can run independently without the need for an additional third tool. Only based on the standard UEFI protocol, it can be cross-platform after cross-compilation on CPU platforms of all architectures. The scope of use is wider, and the cost is low, the recovery efficiency is high, and the cycle is short, which improves the user experience of the device.
[0100] As an optional embodiment, the modifying the hard disk format to the target format includes:
[0101] The hard disk format is modified to a globally unique identifier disk partition table format.
[0102] As an optional embodiment, the exporting of target data from the primary partition table stored in the hard disk based on the UEFI firmware program, and storing the target data in a target area for archiving, includes:
[0103] Reading the primary partition table stored in the hard disk based on the UEFI firmware program, and exporting the primary partition table information to a primary partition table file;
[0104] The master partition table file is saved to the target firmware or target hard disk for archiving.
[0105] As an optional embodiment, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, including:
[0106] When the primary partition table needs to be restored, the partition table entry of the backup partition table of the hard disk is read based on the UEFI firmware program;
[0107] The partition table entry is verified and compared with the corresponding content in the archived content to obtain a comparison result.
[0108] As an optional embodiment, when the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, further comprising:
[0109] Reading a partition table header of a backup partition table of the hard disk based on the UEFI firmware program;
[0110] The content of the partition header is subjected to a cyclic redundancy check, and is checked and compared with the corresponding content in the archived content.
[0111] As an optional embodiment, when the primary partition table needs to be restored, the method further includes:
[0112] If the verification fails, the content of the primary partition table file is written into the primary partition table based on the UEFI firmware program to complete the recovery of the primary partition table.
[0113] Another embodiment of the present application further provides an electronic device, comprising:
[0114] one or more processors;
[0115] a memory configured to store one or more programs;
[0116] When the one or more programs are executed by the one or more processors, the one or more processors implement the above processing method.
[0117] An embodiment of the present application further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the processing method described above is implemented. It should be understood that each solution in this embodiment has the corresponding technical effect in the above method embodiment, which will not be repeated here.
[0118] The embodiment of the present application also provides a computer program product, which is tangibly stored on a computer-readable medium and includes computer-readable instructions, and the computer-executable instructions, when executed, cause at least one processor to perform a processing method such as in the above-described embodiment. It should be understood that each solution in this embodiment has the corresponding technical effect in the above-described method embodiment, which will not be repeated here.
[0119] It should be noted that the computer storage medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access storage medium (RAM), a read-only storage medium (ROM), an erasable programmable read-only storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only storage medium (CD-ROM), an optical storage medium, a magnetic storage medium, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program configured to be used by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, antenna, optical cable, RF, etc., or any suitable combination of the above.
[0120] It should be understood that although the present application is described according to various embodiments, not every embodiment contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0121] The above embodiments are only exemplary embodiments of the present invention and are not intended to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present invention within the essence and protection scope of the present invention, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present invention.
Claims
1. A data recovery method, characterized in that: include: Adjust the hard disk mode to target mode to ensure that the head and tail of the disk can store the primary partition table and backup partition table that uniquely identify the disk partition table; Exporting target data from the main partition table stored in the hard disk based on the UEFI firmware program, and storing the target data in a target area for archiving, where the target area is an area other than the backup partition accessible to the system; When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, wherein the verification comparison includes a verification comparison with the archived content; If the verification is successful, at least the content of the backup partition table is written into the primary partition table to complete the recovery of the primary partition table.
2. The method according to claim 1, characterized in that The step of adjusting the hard disk mode to a target mode includes: The hard disk mode is adjusted to a globally unique identification disk partition table mode.
3. The method according to claim 1, characterized in that The method of exporting target data from the primary partition table stored in the hard disk based on the UEFI firmware program and storing the target data in a target area for archiving includes: Reading the primary partition table stored in the hard disk based on the UEFI firmware program, and exporting the primary partition table information to a primary partition table file; The master partition table file is saved to the target firmware or target hard disk for archiving.
4. The method according to claim 1, characterized in that: When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, including: When the primary partition table needs to be restored, the partition table entry of the backup partition table of the hard disk is read based on the UEFI firmware program; The partition table entry is verified and compared with the corresponding content in the archived content to obtain a comparison result.
5. The method according to claim 4, characterized in that When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, further comprising: Reading a partition table header of a backup partition table of the hard disk based on the UEFI firmware program; The content of the partition header is subjected to a cyclic redundancy check, and is checked and compared with the corresponding content in the archived content.
6. The method according to claim 3, characterized in that When the primary partition table needs to be restored, the following steps are also included: If the verification fails, the content of the primary partition table file is written into the primary partition table based on the UEFI firmware program to complete the recovery of the primary partition table.
7. A data recovery device, characterized in that: include: An adjustment module, used for adjusting the hard disk mode to a target mode, so as to ensure that the head and tail of the disk can respectively store a primary partition table and a backup partition table that globally uniquely identify the disk partition table; A processing module, used for exporting target data from the main partition table stored in the hard disk according to the UEFI firmware program, and storing the target data in a target area for archiving, where the target area is an area other than the backup partition accessible to the system; A verification module, used for reading the backup partition table based on the UEFI firmware program and performing a verification comparison when the primary partition table needs to be restored, wherein the verification comparison includes a verification comparison with the archived content; The writing module is used to write at least the content of the backup partition table into the main partition table when the verification is successful, so as to complete the recovery of the main partition table.
8. The data recovery device according to claim 7, characterized in that: The step of adjusting the hard disk mode to a target mode includes: The hard disk mode is adjusted to a globally unique identification disk partition table mode.
9. The data recovery device according to claim 7, characterized in that: The exporting of target data from the primary partition table stored in the hard disk according to the UEFI firmware program, and storing the target data in a target area for archiving, includes: Reading the primary partition table stored in the hard disk based on the UEFI firmware program, and exporting the primary partition table information to a primary partition table file; The master partition table file is saved to the target firmware or target hard disk for archiving.
10. The data recovery device according to claim 7, characterized in that: When the primary partition table needs to be restored, the backup partition table is read based on the UEFI firmware program, and a verification comparison is performed, including: When the primary partition table needs to be restored, the partition table entry of the backup partition table of the hard disk is read based on the UEFI firmware program; The partition table entry is verified and compared with the corresponding content in the archived content to obtain a comparison result.
Citation Information
Patent Citations
Method for recovering flash memory data at power-off of built-in Linux system
CN101477482A
Method and system for restoring encrypted backup of embedded systems
CN101625654A