[go: up one dir, main page]

CN114816542B - System starting method and device - Google Patents

System starting method and device Download PDF

Info

Publication number
CN114816542B
CN114816542B CN202210362705.2A CN202210362705A CN114816542B CN 114816542 B CN114816542 B CN 114816542B CN 202210362705 A CN202210362705 A CN 202210362705A CN 114816542 B CN114816542 B CN 114816542B
Authority
CN
China
Prior art keywords
partition
gpt
hidden
partition table
information
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
CN202210362705.2A
Other languages
Chinese (zh)
Other versions
CN114816542A (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.)
Lenovo Kaitian Technology Co Ltd
Original Assignee
Lenovo Kaitian 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 Lenovo Kaitian Technology Co Ltd filed Critical Lenovo Kaitian Technology Co Ltd
Priority to CN202210362705.2A priority Critical patent/CN114816542B/en
Publication of CN114816542A publication Critical patent/CN114816542A/en
Application granted granted Critical
Publication of CN114816542B publication Critical patent/CN114816542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file 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/0643Management of files
    • 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
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to a system starting method and a device, wherein the method is applied to electronic equipment and comprises the following steps: determining hidden partitions of the hard disk; creating a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition; and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table. According to the method and the device, the BIOS can smoothly start the operating system in the hidden partition, the storage of important data can be realized by utilizing the hidden partition, and the reliability of system start and the safety of data are improved.

Description

System starting method and device
Technical Field
The present disclosure relates to the field of computer operating system startup technology, and in particular, to a system startup method and apparatus.
Background
Two types of partition tables, MBR (master boot record) and GPT (globally unique identifier partition table, globally unique identification disk partition table), are commonly used in the art to manage hard disk partitions. MBRs can only support hard disk management below 2TB capacity, and GPT can support hard disk management above 2TB capacity as part of the Extensible Firmware Interface (EFI) standard. GPT handles all blocks of the hard disk with LBAs (logical block addresses, commonly known as sectors). With the widespread use of GPT in Windows 10 and various Linux systems, the demands for protection storage and smooth access of some important data are becoming more and more evident.
In order to realize the protection storage of data, the hiding of part of LBAs can be realized on a Solid State Disk (SSD) in a mode of HPA (hidden protection area) similar to HD, and a hidden partition is formed on the SSD. After the storage space of the hidden partition is divided, the storage space is invisible to upper software such as BIOS (basic input output system), OS (operating system) and the like, the purposes of data hiding and protecting are achieved, and in theory, viruses and illegal access or loss of data after the storage device is stolen can be prevented. Therefore, the storage space of the hidden partition can be utilized to backup important data of a user, or some special application programs are installed to take over the computer in the event of a crash of a Host OS (Host operating system), so as to achieve the purpose of recovering the OS or recovering the data.
However, since partition information of the file system is stored in both a start address segment and an end address segment of the hard disk, the problem that GPT partition information is inconsistent exists in the two situations of opening and closing the hidden partition, so that the starting modes of the hidden partition OS and the Host OS installed in the hidden partition are different, when the OS in the hidden partition is started in the same starting mode as the Host OS, the file system cannot be accessed, and the OS in the hidden partition cannot be started normally.
Disclosure of Invention
The embodiment of the disclosure provides a system starting method and device, which can solve the problem that a BIOS (basic input output system) in the prior art cannot normally start an operating system in a hidden partition.
According to one aspect of the present disclosure, there is provided a system start method, applied to an electronic device, including:
determining hidden partitions of the hard disk;
creating a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition;
and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table.
In some embodiments, creating a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition includes:
And filling partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table.
In some embodiments, filling partition information of the hidden partition according to a partition table format of a preset GPT partition table, to generate the first GPT partition table includes:
Acquiring first partition information of the hidden partition, respectively filling the first partition information into HLBA-HLBA positions in a first GPT partition table according to a data format of a preset GPT partition table item, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into check bits corresponding to the HLBA2-HLBA positions;
And acquiring second partition information of the hidden partition, filling the second partition information into a HLBA position in a first GPT partition table according to a data format of a preset GPT partition table head, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information into check bits corresponding to the HLBA position.
In some embodiments, during the starting process of the BIOS of the electronic device, performing starting booting on the operating system in the hidden partition based on the first GPT partition table, including:
In the starting process of the BIOS, analyzing partition table variables corresponding to the hidden partition based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are obtained in advance from the hidden partition of the hard disk;
acquiring a starting file corresponding to the operating system based on the analysis result;
And guiding the operating system to start based on the start file.
In some embodiments, resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
reading the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
In some embodiments, resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
And assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
In some embodiments, the method further comprises:
storing the first GPT partition table in a file to obtain the first GPT partition table file;
the first GPT partition table file is stored in a nonvolatile memory of the BIOS.
In some embodiments, the method further comprises:
determining that the hidden partition is in an open state;
and partitioning and/or installing an operating system on the hidden partition to obtain partition information of the hidden partition.
In some embodiments, partitioning and/or operating system installation of the hidden partition includes:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
And installing an operating system in the hidden partition.
According to one aspect of the present disclosure, there is also provided a system start device including:
the determining module is configured to determine hidden partitions of the hard disk;
The creating module is configured to create a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition;
and the starting guide module is configured to start and guide the operating system in the hidden partition based on the first GPT partition table in the starting process of the BIOS of the electronic equipment.
According to one aspect of the present disclosure, there is also provided an electronic device including a memory for storing at least one computer program instruction and at least one processor for implementing the above-mentioned system start-up method by loading and executing the at least one computer program instruction.
According to one aspect of the present disclosure, there is also provided a computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the system start-up method described above.
According to the system starting method, the device, the electronic equipment and the computer storage medium, after the hidden partition of the solid state disk is determined, the first GPT partition table corresponding to the hidden partition is created based on the partition information of the hidden partition and the data format of the preset GPT partition table, in the starting process of the BIOS of the electronic equipment, the operating system in the hidden partition is started and guided based on the first GPT partition table and the partition table variable corresponding to the hidden partition, so that the BIOS of the electronic equipment can smoothly start the operating system in the hidden partition, the problem that the BIOS cannot normally start the operating system in the hidden partition in the prior art is solved, storage of important data (such as backup of the operating system) can be realized by using the hidden partition, and the reliability of system starting and the safety of the data are improved.
Drawings
FIG. 1 shows a schematic diagram of the structure of a GPT partition table;
FIG. 2 illustrates a flowchart of a system start-up method of an embodiment of the present disclosure;
FIG. 3 illustrates an actual partition map (containing 3 partitions) of hidden partitions in a system boot method of an embodiment of the present disclosure;
FIG. 4 illustrates a schematic diagram of a first GPT partition table in a system startup method according to an embodiment of the disclosure;
fig. 5 shows a schematic structural diagram of a system start device according to an embodiment of the present disclosure.
Detailed Description
Various aspects and features of the disclosure are described herein with reference to the drawings.
It should be understood that various modifications may be made to the embodiments of the application herein. Therefore, the above description should not be taken as limiting, but merely as exemplification of the embodiments. Other modifications within the scope and spirit of this disclosure will occur to persons of ordinary skill in the art.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and, together with a general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the principles of the disclosure.
These and other characteristics of the present disclosure 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.
It should also be understood that, although the present disclosure has been described with reference to some specific examples, those skilled in the art can certainly realize many other equivalent forms of the present disclosure.
The above and other aspects, features and advantages of the present disclosure will become more apparent in light of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present disclosure will be described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely examples of the disclosure, which may be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the disclosure in unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but merely serve as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present disclosure in virtually any appropriately detailed structure.
The GPT partition table structure is briefly described below.
Fig. 1 shows a schematic structural diagram of a GPT partition table according to an embodiment of the disclosure. As shown in fig. 1, the solid line square area in fig. 1 is a hidden area of an SSD (hard disk or magnetic disk for short), and is generally not directly accessible by a user; the dashed box areas (LBA 0-LBA-1 area segments) in FIG. 1 are hard disk areas that a user can normally access.
As shown in the dashed box area of fig. 1, the GPT uses 34 LBA blocks to record partition information, and the GPT uses 33 LBAs as backups at the end of the whole hard disk, except the first 34 LBAs. The contents of the GPT partition information stored in the LBA of the SSD are specifically:
LBA0 (MBR compatible block): at the very beginning of the GPT partition table, a traditional MBR (LBA 0) is still stored for compatibility, which is called protective MBR (Protective MBR). The protective MBR protects the GPT disk from previously issued MBR disk tools. The LBA0 stores a boot program+special identifier (indicating that the hard disk is managed by GPT).
LBA1: the partition table header defines the available space of the hard disk and the size and number of entries that make up the partition table. The partition header also records the GUID of the hard disk, the location (always LBA 1) and size of the partition header itself, and the location and size of the backup partition header and partition table (at the end of the hard disk, LBA-1 through LBA-34). It also stores its own CRC32 check with the partition table. The firmware, the boot program and the operating system can judge whether the partition table is in error according to the check value when being started, if the partition table is in error, software can be used for recovering the whole partition table from the last backup GPT of the hard disk, and if the backup GPT is also in error, the hard disk can not be used. Namely, the information stored in the LBA1 position is mainly the size of the position of the partition table, the position of the GPT partition for backup and the check code of the partition table. Table 1 shows specific information of the data format of the GPT partition header.
Table 1 GPT partition header data format
LBA 2-33: the locations of LBAs 2 through 33 store partition entries. There are 32 LBAs in total, each LBA can store 4 sets of partition records, each set of records can exist independently. The first 16 bytes of a partition table entry are partition type GUID. The next 16 bytes are the unique GUID for the partition (this GUID refers to the partition itself, while the previous GUID refers to the partition type). Again, the 64-bit LBA numbers at the beginning and end of the partition, as well as the name and attributes of the partition, are followed, with the specific data formats shown in table 2.
Table 2 GPT partition entry data format
LBA-1: the stored data content is the backup partition header described in LBA1, and is the backup of LBA1, as in LBA 1.
LBA-34 to LBA-2: the data content stored is the location and size of the backup partition table described in LBA1 (at the end of the hard disk), equivalent to LBA 2-LBA 33 and consistent in content.
When the hard disk with the hidden partition function is set to be visible and operable and invisible and inoperable, the number of LBAs can be changed. When the hidden partition is set to be invisible, according to a storage mechanism of a GPT partition table in a UEFI standard protocol, at the moment, LBA1 stores the GPT partition table head of a non-hidden area (normal visible area) of a disk, and LBAs 2 to 33 store partition table information of the non-hidden area; meanwhile, the GPT backup partition table head of the non-hidden area is stored on the LBA-1, and the GPT backup partition tables of the non-hidden area are stored in LBA-33 to LBA-2. When the hidden partition is set to be visible, the LBA1 stores GPT partition table heads of all areas (including hidden areas and non-hidden areas) of the disk, and LBAs 2 to 33 store partition table information of all areas of the disk; meanwhile, GPT backup partition table heads of all areas of the backup disk are stored on HLBA-1, and GPT backup partition tables of all areas of the disk are stored in HLBA-2-HLBA-33.
As described above, the different settings of hidden partitions make the LBA positions and contents storing the GPT partition table information inconsistent. Although the disk GPT partition table information is stored in LBA 1-LBA 33, when the hidden partition is invisible, the GPT partition information of the non-hidden partition is stored; when the hidden partition is visible, GPT partition information of full disk capacity is stored, namely, contents stored in LBAs 1 to 33 at the same position are inconsistent. Meanwhile, when the hidden partition is invisible, the backed-up GPT partition information is stored in the LAB-34-LBA-1 position; and when the hidden partition is visible, the backed-up GPT partition information is stored in HLBA-34-HLBA-1. Namely, the positions of the GPT partition information which needs to be stored for backup according to the UEFI standard protocol are inconsistent in the two situations, and meanwhile, the stored contents are inconsistent.
The manner of starting the operating system by the BIOS is based on a file system, in the BIOS stage of system starting, GPT partition information of a hard disk start position is needed, that is, no matter whether the BIOS firmware or the operating system accesses the hard disk according to the file system, the LBA1 to LBA33 of the hard disk need to be analyzed first, so when the hidden partition is opened and started, because the GPT partition table information includes information (a part of HLBA blocks in fig. 1) expanded after the hidden partition is opened, but at this time, the information cannot be directly read, so that the BIOS cannot normally guide and start the operating system in the hidden partition, and meanwhile, the non-hidden partition may not be normally accessed.
In view of the above technical problems, an embodiment of the present disclosure provides a system startup method.
It should be noted that, the file system is a method for organizing and managing files by the operating system, and it is just a point to say that data on the hard disk is presented to the user in the form of files. Both Fat32 and NTFS are common file system types.
Fig. 2 shows a flowchart of a system start-up method of an embodiment of the present disclosure. As shown in fig. 2, an embodiment of the present disclosure provides a system startup method, applied to an electronic device, including:
S101: determining hidden partitions of the hard disk.
Specifically, after the hard disk is mounted to the electronic device, the hard disk may be partitioned and/or an operating system may be mounted, etc. Partitioning the hard disk may include setting non-hidden partitions and hidden partitions, and setting the number, size, etc. of each partition. Operating system installation refers to installing an Operating System (OS) within a corresponding partition. Operating system installation of the hard disk may include operations such as formatting the file system, setting the file system type, and specific operating system installation. After the hidden partition is partitioned and/or the operating system is installed, partition attributes such as the partition number, partition size and the like of the hidden partition and stored partition information of the file system type can be obtained.
The electronic device may be a microcomputer or a mini-computer such as a desktop computer (PC), a notebook computer, a tablet computer, a mobile phone, or a mainframe computer such as a server or an industrial personal computer. When the electronic device is a desktop computer, the operating system may be Windows, linux or other operating systems; when the electronic device is a mobile phone, the operating system may be an Android system or an IOS system, etc.
S102: and creating a first GPT partition table corresponding to the hidden partition based on the partition information of the hidden partition.
The step S102 specifically includes:
s1021: and filling partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table.
Specifically, according to the standard data format of the GPT partition tables shown in the above tables 1 and 2, a blank GPT partition table may be created, and partition information of the hidden partition may be filled therein to generate the first GPT partition table. The first GPT partition table is a GPT partition table which is statically filled according to known variables such as the partition number, partition size, file system type and the like of the hidden partitions, so as to correspond to real partition information of the hidden partitions in the hard disk. That is, partition information refers to information in a fixed format related to hidden partitions.
The first GPT partition table includes the number of LBAs shown in the dashed box area in fig. 1, which are HLBA 0-HLBA-1, where HLBA 0-HLBA are main partition tables of hidden partitions, and HLBA-34-HLBA-1 are backup partition tables of hidden partitions.
S103: and in the starting process of the BIOS of the electronic equipment, starting and guiding the operating system in the hidden partition based on the first GPT partition table.
The partition layout of the first GPT partition table created in step S102 is the same as the partition layout of the hidden partition in the original second GPT partition table of the hard disk, so that access to the LBA corresponding to the hidden partition in the second GPT partition table of the hard disk can be skipped, data access is performed on the data on the corresponding LBA according to the specified GUID file system type based on the information in the first GPT partition table, smooth parsing of the data corresponding to the hidden partition is achieved, an address of a boot file for booting an operating system in the hidden partition is obtained, the corresponding boot file is searched according to the address, and then the operating system in the hidden partition is booted by loading the boot file.
Because the layout of each HLBA in the first GPT partition table is consistent with the real layout of the hidden partition in the hard disk, the data analyzed by the first GPT partition table is real data corresponding to the hidden partition, and the real reliability of the analyzed data is ensured.
According to the system starting method provided by the embodiment of the invention, after the hidden partition of the solid state disk is determined, the first GPT partition table corresponding to the hidden partition is created based on the partition information of the hidden partition and the data format of the preset GPT partition table, and in the starting process of the BIOS of the electronic equipment, the operating system in the hidden partition is started and guided based on the first GPT partition table and the partition table variable corresponding to the hidden partition, so that the BIOS of the electronic equipment can smoothly start the operating system in the hidden partition, the problem that the BIOS cannot normally start the operating system in the hidden partition in the prior art is solved, the storage of important data (such as backup of the operating system) can be realized by using the hidden partition, and the reliability of system starting and the safety of the data are improved.
In the embodiment, the hidden partitions are arranged on the hard disk, so that the data security can be improved, the recovery of subsequent data or an operating system is facilitated, and the data is concentrated in a certain storage space by different partitions, so that the data reading efficiency is greatly improved; meanwhile, the operating system in the hidden partition is started by the system starting method, so that the operating system in the hidden partition can be started rapidly and accurately, other functions can be customized for the operating system in the hidden partition, and the performance of the whole electronic equipment is improved.
The first GPT partition table complies with the standard UEFI protocol, can be developed in a UEFI firmware layer, and is generated by statically filling in GPT partition table information of a hidden partition, so that the development is convenient, and the development is improved based on the standard data format of the existing GPT partition table of the hard disk.
In some embodiments, in step S1021, the filling the partition information of the hidden partition according to the partition table format of the preset GPT partition table to generate the first GPT partition table includes:
1) Acquiring first partition information of the hidden partition, respectively filling the first partition information into HLBA-HLBA positions in a first GPT partition table according to a data format of a preset GPT partition table item, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into check bits corresponding to the HLBA2-HLBA positions;
2) And acquiring second partition information of the hidden partition, filling the second partition information into a HLBA position in a first GPT partition table according to a data format of a preset GPT partition table head, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information into check bits corresponding to the HLBA position.
Fig. 3 shows the actual partition information (including 3 partitions) of the hidden partition, and fig. 4 shows the partition information of the generated first GPT partition table.
Specifically, filling the first partition information of the hidden partition into bit bits corresponding to HLBA positions (LBA 2 positions of preset GPT partition table entries) according to the data structure in the table 2; and calculates the check information of the first CRC32 of the first partition information, and fills the check information into bits 0x 28-0 x2f of HLBA (as shown in FIG. 4), thereby completing the static filling of the first GPT partition table entry HLBA. Partition information for HLBA-HLBA locations is statically filled in a similar manner.
And respectively filling bit corresponding to HLBA positions in second partition information of the hidden partition such as the initial LBA value of the hidden partition, the LAB-34 value of the last partition (the last partition in three partitions in FIG. 3), the partition type GUID value and the like, calculating second CRC32 check information of the second partition information, filling the second CRC32 check information into check bits corresponding to HLBA positions, and completing static filling of the first GPT partition header HLBA1 positions. The GPT main partition table of the hidden partition can be obtained through filling. Since the LBA0 position in the preset GPT partition table is an MBR compatible block, in this embodiment, LBA0 in the original second GPT partition table of the hard disk may still be used as HLBA0 in the first GPT partition table.
The GPT backup partition table of the hidden partition is filled in the HLBA-34-HLBA-1 position, the partition is not used, and the filling of the HLBA-34-HLBA-1 position content can be carried out according to the filled HLBA 1-HLBA position content without manual filling. After each location is filled, the static filling of the first GPT partition table is completed.
In this embodiment, when the first GPT partition table is generated, a cyclic redundancy data check (CRC, cyclic Redundancy Check) method is used to obtain the check value. In other embodiments, when the preset GPT partition table adopts parity check, MD5, and other check methods, the check value in the first GPT partition table may be obtained by adopting a corresponding check method.
In some embodiments, in step S103, during the starting process of the BIOS of the electronic device, starting and booting the operating system in the hidden partition based on the first GPT partition table includes:
s1031: in the starting process of the BIOS, analyzing partition table variables corresponding to the hidden partition based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are obtained in advance from the hidden partition of the hard disk;
s1032: acquiring a starting file corresponding to the operating system based on the analysis result;
s1033: and guiding the operating system to start based on the start file.
After the BIOS firmware starts the hiding function of the hard disk, the BIOS performs data access on the data on the corresponding LBA according to the specified GUID file system type according to the first GPT partition table, and performs data analysis on the partition table variable (such as gpt_ pation _table) in the hiding partition according to the GPT partition table format specified in the EFI protocol to obtain an analysis result; and then traversing the standard operating system starting file according to the guiding partition information in the first GPT partition table based on the analysis result, searching a corresponding starting file (such as a grub64.Efi file), and starting and guiding the operating system by using the starting file to realize smooth starting of the operating system in the hidden area. The partition table variable in the hidden partition can be searched and obtained from the hidden partition based on partition information in the original second GPT partition table of the hard disk.
In a specific starting process of an operating system (such as a Linux system), a grub boot system can be used for starting, after a grubx64.Efi file is found in step S103, a module and a configuration file under a grub loader/boot/grub are loaded, and then an operating system starting kernel is loaded.
In some embodiments, in step S1031, resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
s201: reading the first GPT partition table;
s202: obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
S203: and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
Specifically, in the process of starting the BIOS, the information of the first GPT partition table is read, a partition table variable (for example, gpt_ pation _table) corresponding to the hidden partition obtained from the original second GPT partition table of the hard disk is dynamically filled into the first GPT partition table, the data analysis is performed on the partition table variable in the hidden partition, the analysis result is obtained, and then a starting file corresponding to the operating system is searched.
In other embodiments, in step S1031, resolving the partition table variable corresponding to the hidden partition based on the first GPT partition table includes:
s301: acquiring a first GPT partition table file corresponding to the first GPT partition table;
S302: obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
s303: and assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
After the first GPT partition table is obtained, for convenient reading, the first GPT partition table may be stored as a first GPT partition table file (GPT. Info, for example), and when the BIOS starts the operating system, the first GPT partition table file is quickly read, and the content of the first GPT partition table file is assigned to the partition table variable, so that the partition table variable is resolved by using the format of the first GPT partition table in the first GPT partition table file, and thus, a start file corresponding to the operating system is searched according to the resolution result. The method for obtaining the partition table variable in step S302 is the same as that in step S202, and will not be described here again.
Before performing step S301, the method further comprises:
S401: storing the first GPT partition table in a file to obtain the first GPT partition table file;
S402: the first GPT partition table file is stored in a nonvolatile memory of the BIOS.
In this embodiment, after the first GPT partition table is obtained, the first GPT partition table is stored in a file, and the file is stored in a nonvolatile memory (for example, flash) of the BIOS, so that data security of the first GPT partition table can be ensured, and the data can be stored in a file form to facilitate rapid reading of the data.
In some embodiments, in step S101, the method further comprises:
determining that the hidden partition is in an open state;
and carrying out partition setting and/or operating system installation on the hidden partition to obtain partition information of the hidden partition.
In this embodiment, after the hard disk is installed, partition setting and operating system installation may be performed on the non-hidden partition. The primary partition table of the GPT of the Protective MBR and the non-hidden partition is stored at the beginning LBA 0-LBA 34 of the hard disk, and the backup partition table of the GPT of the non-hidden partition is stored at the last LBA-33-LBA-1 of the hard disk.
And then starting the hidden partition, setting the hidden partition, expanding the LBA of the hidden partition to an operating system, and simultaneously, setting the partition, installing the operating system and the like on the hidden partition, thereby obtaining partition information of the hidden partition.
Fig. 5 shows a schematic structural diagram of a system start device according to an embodiment of the present disclosure. As shown in fig. 5, an embodiment of the present disclosure further provides a system starting apparatus, including:
An obtaining module 100 configured to determine a hidden partition of the hard disk;
the creating module 200 is configured to create a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition;
And the starting guide module 300 is configured to start and guide the operating system in the hidden partition based on the first GPT partition table in the starting process of the BIOS of the electronic equipment.
In some embodiments, the creation module 200 is further configured to:
And filling partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table.
In some embodiments, the creation module 200 is further configured to:
Acquiring first partition information of the hidden partition, respectively filling the first partition information into HLBA-HLBA positions in a first GPT partition table according to a data format of a preset GPT partition table item, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into check bits corresponding to the HLBA2-HLBA positions;
And acquiring second partition information of the hidden partition, filling the second partition information into a HLBA position in a first GPT partition table according to a data format of a preset GPT partition table head, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information into check bits corresponding to the HLBA position.
In some embodiments, the launch guidance module 300 is further configured to:
In the starting process of the BIOS, analyzing partition table variables corresponding to the hidden partition based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are obtained in advance from the hidden partition of the hard disk;
acquiring a starting file corresponding to the operating system based on the analysis result;
And guiding the operating system to start based on the start file.
In some embodiments, the launch guidance module 300 is further configured to:
reading the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
In some embodiments, the launch guidance module 300 is further configured to:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
And assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
In some embodiments, the apparatus further comprises a storage module configured to:
storing the first GPT partition table in a file to obtain the first GPT partition table file;
the first GPT partition table file is stored in a nonvolatile memory of the BIOS.
In some embodiments, the system further comprises a partitioning module configured to:
determining that the hidden partition is in an open state;
and partitioning and/or installing an operating system on the hidden partition to obtain partition information of the hidden partition.
In some embodiments, the partitioning module is further configured to:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
And installing an operating system in the hidden partition.
The system starting device provided in the embodiment of the present disclosure corresponds to the system starting method in the foregoing embodiment, and based on the foregoing system starting method, those skilled in the art can understand the specific implementation manner of the system starting device and various modifications thereof in the embodiment of the present disclosure, and any optional item in the embodiment of the system starting method is also suitable for the system starting device, which is not repeated herein.
The disclosed embodiments also provide an electronic device comprising a memory for storing at least one computer program instruction and at least one processor for implementing the system startup method as described in the above embodiments by loading and executing the at least one computer program instruction.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the system startup method in the embodiments of the present disclosure. The at least one processor may be a multi-GPU architecture as described above, or an architecture that combines at least two of a CPU, an FPGA, and a GPU. The processor executes various functional applications and data processing by running software programs and modules stored in the memory, i.e., implements the system startup method described above.
Further, the memory may include a BIOS memory to store the first GPT partition table, the first GPT partition table file, and so on, so as to ensure security of data and convenience and rapidness of data reading.
Embodiments of the present disclosure also provide a computer storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the system start-up method as described in the above embodiments.
It should be noted that, all or part of the steps of implementing the above-mentioned method embodiments in the embodiments of the present disclosure may be implemented by hardware related to computer executable instructions (programs), where the above-mentioned computer executable instructions may be stored in a computer readable storage medium, and when executed, the computer executable instructions perform steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: read Only Memory (ROM), random access Memory (random access Memory, RAM), removable storage devices, magnetic or optical disks, and the like, which may store computer-executable instructions. In particular, in this embodiment, the computer storage medium may be the hard disk to be partitioned or partitioned as described above.
The above embodiments are merely exemplary embodiments of the present disclosure, which are not intended to limit the present disclosure, the scope of which is defined by the claims. Various modifications and equivalent arrangements of parts may be made by those skilled in the art, which modifications and equivalents are intended to be within the spirit and scope of the present disclosure.

Claims (8)

1. A system start-up method applied to an electronic device with a hard disk, the method comprising:
determining hidden partitions of the hard disk;
creating a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition;
In the starting process of the BIOS of the electronic equipment, starting and guiding an operating system in the hidden partition based on the first GPT partition table;
the creating a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition includes: filling partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table;
Filling partition information of the hidden partition according to a partition table format of a preset GPT partition table to generate the first GPT partition table, wherein the method comprises the following steps: acquiring first partition information of the hidden partition, respectively filling the first partition information into HLBA-HLBA positions in a first GPT partition table according to a data format of a preset GPT partition table item, calculating first CRC32 check information of the first partition information, and filling the first CRC32 check information into check bits corresponding to the HLBA2-HLBA positions; and acquiring second partition information of the hidden partition, filling the second partition information into a HLBA position in a first GPT partition table according to a data format of a preset GPT partition table head, calculating second CRC32 check information of the second partition information, and filling the second CRC32 check information into check bits corresponding to the HLBA position.
2. The method of claim 1, wherein during boot-up of the BIOS of the electronic device, booting an operating system within the hidden partition based on the first GPT partition table comprises:
In the starting process of the BIOS, analyzing partition table variables corresponding to the hidden partition based on the first GPT partition table, wherein the partition table variables corresponding to the hidden partition are obtained in advance from the hidden partition of the hard disk;
acquiring a starting file corresponding to the operating system based on the analysis result;
And guiding the operating system to start based on the start file.
3. The method of claim 2, wherein resolving partition table variables corresponding to the hidden partition based on the first GPT partition table comprises:
reading the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
and dynamically filling the partition table variable into the first GPT partition table, and analyzing the partition table variable.
4. The method of claim 2, wherein resolving partition table variables corresponding to the hidden partition based on the first GPT partition table comprises:
acquiring a first GPT partition table file corresponding to the first GPT partition table;
obtaining partition table variables corresponding to the hidden partitions based on a second GPT partition table of the hard disk, wherein the second GPT partition table is a GPT partition table preset by the hard disk;
And assigning the content of the first GPT partition table file to the partition table variable, and analyzing the partition table variable.
5. The method of claim 4, wherein the method further comprises:
storing the first GPT partition table in a file to obtain the first GPT partition table file;
the first GPT partition table file is stored in a nonvolatile memory of the BIOS.
6. The method of claim 1, wherein the method further comprises:
determining that the hidden partition is in an open state;
and partitioning and/or installing an operating system on the hidden partition to obtain partition information of the hidden partition.
7. The method of claim 6, wherein partitioning and/or operating system installation of the hidden partition comprises:
determining partition attributes of the hidden partition; and/or
Formatting a file system within the hidden partition; and/or
And installing an operating system in the hidden partition.
8. A system start-up device for performing the system start-up method according to any one of claims 1 to 7, comprising:
the determining module is configured to determine hidden partitions of the hard disk;
The creating module is configured to create a first GPT partition table corresponding to the hidden partition based on partition information of the hidden partition;
and the starting guide module is configured to start and guide the operating system in the hidden partition based on the first GPT partition table in the starting process of the BIOS of the electronic equipment.
CN202210362705.2A 2022-04-07 2022-04-07 System starting method and device Active CN114816542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210362705.2A CN114816542B (en) 2022-04-07 2022-04-07 System starting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210362705.2A CN114816542B (en) 2022-04-07 2022-04-07 System starting method and device

Publications (2)

Publication Number Publication Date
CN114816542A CN114816542A (en) 2022-07-29
CN114816542B true CN114816542B (en) 2024-08-30

Family

ID=82534406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210362705.2A Active CN114816542B (en) 2022-04-07 2022-04-07 System starting method and device

Country Status (1)

Country Link
CN (1) CN114816542B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502739A (en) * 2016-10-31 2017-03-15 北京深之度科技有限公司 Method, device and the computing device that boot disk is made using movable storage device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1274009A3 (en) * 2001-07-03 2003-12-03 Hewlett-Packard Company System and method to enable a legacy BIOS system to boot from a disk that includes EFI GPT partitions
CN1877539A (en) * 2005-06-07 2006-12-13 英业达股份有限公司 Data backup/recovery system in cold start mode and its implementation method
CN104142838A (en) * 2014-07-02 2014-11-12 青岛海信移动通信技术股份有限公司 Method and equipment for starting up mobile communication terminal
CN107220071A (en) * 2016-03-22 2017-09-29 北京蓝光引力网络股份有限公司 A kind of method for guiding electronic equipment activation system
CN106325872A (en) * 2016-08-26 2017-01-11 武汉噢易云计算股份有限公司 Multioperation system management method capable of supporting Macintosh computer and multioperation system management device capable of supporting Macintosh computer
KR102051086B1 (en) * 2018-01-05 2019-12-02 주식회사 웨인 Booting disk supporting file storage function
US10795581B2 (en) * 2019-01-25 2020-10-06 Dell Products L.P. GPT-based data storage partition securing system
CN111258666B (en) * 2020-01-22 2023-07-04 奇安信科技集团股份有限公司 Computer file reading method, device, computer system and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502739A (en) * 2016-10-31 2017-03-15 北京深之度科技有限公司 Method, device and the computing device that boot disk is made using movable storage device

Also Published As

Publication number Publication date
CN114816542A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
US7702894B2 (en) System and method for loading programs from HDD independent of operating system
US8370835B2 (en) Method for dynamically generating a configuration for a virtual machine with a virtual hard disk in an external storage device
CN111258666B (en) Computer file reading method, device, computer system and storage medium
TWI700639B (en) Booting disk supporting file storage function
US8185684B1 (en) Method and apparatus for resolving volume identifiers associated with a virtual machine
US20070180206A1 (en) Method of updating a duplicate copy of an operating system on the same disk
US20050144501A1 (en) Method for recovering data in EXT2 file system, and computer-readable storage medium recorded with data-recovery program
US11263090B2 (en) System and method for data packing into blobs for efficient storage
US9921765B2 (en) Partial snapshots in virtualized environments
CN115390996B (en) Virtual machine migration method and device, computing equipment and storage medium
CN101246458A (en) Disk data protection method and system
US7836105B2 (en) Converting file-systems that organize and store data for computing systems
KR101999617B1 (en) Electronic apparatus, method for restore of guid partition table and computer-readable recording medium
CN107783724A (en) A kind of generation method and device of full image file
US8245001B2 (en) Storage device and method for protecting its partition
CN114816542B (en) System starting method and device
CN112416657A (en) System cloning method
US9128943B1 (en) Method and system for tracking re-sizing and re-creation of volumes created for making incremental backups
US10235373B2 (en) Hash-based file system
US7024493B1 (en) Bootable CD for transferring files independently of computer operating systems
US20180032351A1 (en) Information processing method and storage device
US20200117545A1 (en) Method, device and computer program product for backuping virtual machine
US11803313B2 (en) Method of constructing a file system based on a hierarchy of nodes
CN114816847B (en) Data recovery method and device
CN115237352B (en) Hidden storage method, device, storage medium and electronic equipment

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