CN112540889A - Method, device, equipment and medium for adjusting hard disk starting sequence in user state - Google Patents

Method, device, equipment and medium for adjusting hard disk starting sequence in user state Download PDF

Info

Publication number
CN112540889A
CN112540889A CN202011529562.7A CN202011529562A CN112540889A CN 112540889 A CN112540889 A CN 112540889A CN 202011529562 A CN202011529562 A CN 202011529562A CN 112540889 A CN112540889 A CN 112540889A
Authority
CN
China
Prior art keywords
hard disk
boot
tested
identifier
target
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.)
Granted
Application number
CN202011529562.7A
Other languages
Chinese (zh)
Other versions
CN112540889B (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.)
Jiangsu Guoke Microelectronics Co ltd
Original Assignee
Jiangsu Guoke Microelectronics 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 Jiangsu Guoke Microelectronics Co ltd filed Critical Jiangsu Guoke Microelectronics Co ltd
Priority to CN202011529562.7A priority Critical patent/CN112540889B/en
Publication of CN112540889A publication Critical patent/CN112540889A/en
Application granted granted Critical
Publication of CN112540889B publication Critical patent/CN112540889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a method, a device, equipment and a medium for adjusting a hard disk starting sequence in a user mode, wherein the method comprises the following steps: acquiring a hard disk test instruction input by a user in a user state; determining whether a first starting item corresponding to a target hard disk to be tested exists in the testing host computer or not based on the first disk identifier; if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, establishing the first starting item corresponding to the target hard disk to be tested; adding a first Boot item identifier of a first Boot item corresponding to a target hard disk to be tested to a first position of UEFI Boot Order of a test host, and adding a second Boot item identifier corresponding to a hard disk storing a main program to a second position of UEFI Boot Order, wherein the first position is in front of the second position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started. This enables the hard disk boot sequence to be adjusted in the user mode.

Description

Method, device, equipment and medium for adjusting hard disk starting sequence in user state
Technical Field
The present application relates to the field of hard disk testing technologies, and in particular, to a method, an apparatus, a device, and a medium for adjusting a hard disk start sequence in a user mode.
Background
PC (Personal Computer) has two kinds of boot modes, namely Legacy BIOS (Basic Input Output System) and UEFI (Unified Extensible Firmware Interface) BIOS modes. UEFI is a new BIOS technology compatible with the old Legacy BIOS. For the conventional Legacy mode, the boot sequence can be adjusted by the BIOS interface during boot, but cannot be adjusted by the user program after boot is completed. And the interface provided by the UEFI to the system comprises Boot Services (Boot Services) and Runtime Services (Runtime Services). The Runtime Services includes reading and writing UEFI system variables, and the Boot Order is one of the system variables. However, in the existing Boot Order, when testing is started, the Boot Order directly read can cause the test disk to fail and cannot be switched back to the hard disk storing the test main program, thereby causing the hard disk test to be terminated and reducing the reliability of the test hard disk.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, a device, and a medium for adjusting a hard disk start-up sequence in a user state, which can adjust the hard disk start-up sequence in the user state, so that after a test hard disk fails, the hard disk storing a test main program can be switched back to for a subsequent hard disk test, thereby improving reliability of the test hard disk. The specific scheme is as follows:
in a first aspect, the present application discloses a method for adjusting a hard disk boot sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed in UEFI and GPT manners, and the method includes:
acquiring a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host;
determining whether a first starting item corresponding to the target hard disk to be tested exists in the testing host computer or not based on the first disk identifier;
if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, establishing the first starting item corresponding to the target hard disk to be tested;
and adding a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested to a first position of UEFI Boot Order of the test host, and adding a second Boot item identifier to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before the hard disk storing the test main program is started.
Optionally, after determining whether the first boot entry corresponding to the target hard disk to be tested exists in the test host based on the first identifier, the method further includes:
if a first Boot item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first Boot item identifier of the first Boot item in UEFI Boot Order of the test host and a fourth position of a second Boot item identifier of a second Boot item corresponding to the hard disk storing the test main program in UEFI Boot Order;
determining whether the third position is before the fourth position;
if not, the first starting item identification is moved to the front of the fourth position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
Optionally, the determining, based on the first disk identifier, whether a first boot entry corresponding to the target hard disk to be tested exists in the test host includes:
determining a target globally unique identifier corresponding to the first identifier;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists.
Optionally, the determining a target globally unique identifier corresponding to the first identifier includes:
and reading the target global unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
Optionally, the determining whether the first startup item corresponding to the target globally unique identifier exists in the test host to determine whether the first startup item corresponding to the target hard disk to be tested exists includes:
traversing all startup items on the test host to obtain information of each startup item on the test host, wherein the information of each startup item comprises a globally unique identifier corresponding to each startup item;
and determining whether a first startup item corresponding to the target globally unique identifier exists in the test host or not based on the information of each startup item so as to determine whether a first startup item corresponding to the target hard disk to be tested exists or not.
Optionally, before adding the second start item identifier to the second location of the UEFI Boot Order, the method further includes:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive letter of the hard disk storing the test main program so as to determine a second starting item identifier of the second starting item.
In a second aspect, the present application discloses a device for adjusting a hard disk boot sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed in UEFI and GPT manners, and the method includes:
the system comprises an instruction acquisition module, a test host and a test host, wherein the instruction acquisition module is used for acquiring a hard disk test instruction input by a user in a user mode, the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of the test host;
a boot item determining module, configured to determine, based on the first disk identifier, whether a first boot item corresponding to the target hard disk to be tested exists in the test host;
the starting item creating module is used for creating a first starting item corresponding to the target hard disk to be tested when the first starting item corresponding to the target hard disk to be tested does not exist in the testing host;
and the hard disk starting sequence adjusting module is used for adding a first starting item identifier of a first starting item corresponding to the target hard disk to be tested to a first position of the UEFI Boot Order of the test host and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
Optionally, the starting item determining module is configured to:
determining a target globally unique identifier corresponding to the first identifier;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists.
In a third aspect, the present application discloses a test host, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the method for adjusting the hard disk boot sequence in the user mode disclosed above.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the method for user-dynamically adjusting the boot sequence of a hard disk disclosed in the foregoing.
As can be seen, in the present application, a hard disk test instruction input by a user in a user mode is first obtained, where the hard disk test instruction includes a first drive letter of a target hard disk to be tested, where the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host, then it is determined whether a first startup item corresponding to the target hard disk to be tested exists in the test host based on the first drive letter, if the first startup item corresponding to the target hard disk to be tested does not exist in the test host, a first startup item corresponding to the target hard disk to be tested is created, then a first startup item identifier of the first startup item corresponding to the target hard disk to be tested is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier is added to a second position of the UEFI Boot Order, where the second startup item identifier of a hard disk corresponding to the test host is stored in the test host, where the second startup item identifier is a second startup item identifier of the hard disk corresponding to be An item identification, the first location preceding the second location, so as to launch the target hard disk to be tested before launching the hard disk storing a test main program. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first startup item corresponding to the target hard disk to be tested exists in the test host is determined based on a first disk identifier of the target hard disk to be tested, if the first startup item does not exist, the first startup item is created, then a first startup item identifier of the first startup item is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier of a second startup item corresponding to the hard disk storing a test main program is added to a second position behind the first position of the UEFI Boot Order. The position of the start item identification corresponding to the hard disk to be tested in the UEFI Boot Order is located in front of the start item identification corresponding to the hard disk storing the test main program, so that the hard disk to be tested can be started in sequence when the hard disk to be tested fails, the start sequence of the hard disk can be adjusted in a user state, the hard disk to be tested can be switched back to the hard disk storing the test main program when the hard disk to be tested fails, subsequent hard disk test is carried out, and the reliability of the hard disk to be tested is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for adjusting a boot sequence of a hard disk in a user mode according to the present disclosure;
FIG. 2 is a flowchart illustrating a method for adjusting a boot sequence of a hard disk in a user mode according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of an apparatus for adjusting a hard disk boot sequence in a user state according to the disclosure;
fig. 4 is a schematic structural diagram of a test host disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, an embodiment of the present application discloses a method for adjusting a hard disk boot sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed in UEFI and GPT manners, and the method includes:
step S11: the method comprises the steps of obtaining a hard disk test instruction input by a user in a user mode, wherein the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host.
In a specific implementation process, the test host needs to obtain a hard disk test instruction input by a user in a user mode, where the hard disk test instruction includes a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of the test host. The number of the target hard disks to be tested may be greater than or equal to 1. And when the number of the target hard disks to be tested is more than 1, configuring the test sequence of each target hard disk to be tested.
Step S12: and determining whether a first starting item corresponding to the target hard disk to be tested exists in the testing host computer or not based on the first character.
After the hard disk test instruction is obtained, whether a first starting item corresponding to the target hard disk to be tested exists in the test host needs to be determined based on the first disk identifier. Specifically, a target globally unique identifier corresponding to the first identifier may be determined; and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists. The target global Unique Identifier is a Global Unique Identifier (GUID) corresponding to the first disk Identifier.
Wherein determining the target globally unique identifier corresponding to the first identifier comprises: and reading the target global unique identifier from the 3 rd LBA (Logical Block Address) of the target hard disk to be tested by using the first identifier. According to Partition definition of a GPT (GUID Partition Table), a first LBA is LBA0, that is, an MBR (Master Boot Record) Partition Table, a second LBA is LBA1, a GPT header, a third LAB are LBA2-33, and Partition Table entries are stored in positions of the LBAs 2-33. The GPT partition table represents partitions in a simple and straightforward manner. The first 16 bytes of a partition entry are the partition type, the next 16 bytes are the unique GUID for the partition, which refers to the partition itself, followed by the 64-bit LBA numbers for the start and end of the partition, and the name and attributes of the partition.
Determining whether a first startup item corresponding to the target globally unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists, including: traversing all startup items on the test host to obtain information of each startup item on the test host, wherein the information of each startup item comprises a globally unique identifier corresponding to each startup item; and determining whether a first startup item corresponding to the target globally unique identifier exists in the test host or not based on the information of each startup item so as to determine whether a first startup item corresponding to the target hard disk to be tested exists or not. The information of each boot item includes a corresponding globally unique identifier, so that it can be determined whether the target globally unique identifier is included, if so, it indicates that the first boot item exists, and determines the boot item including the target globally unique identifier as the first boot item, and if not, it indicates that the first boot item does not exist in the test host.
Step S13: and if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, creating the first starting item corresponding to the target hard disk to be tested.
And if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, creating the first starting item corresponding to the target hard disk to be tested. That is, the test host does not have the first startup item corresponding to the target hard disk to be tested, so that the first startup item corresponding to the target hard disk to be tested needs to be created.
Step S14: and adding a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested to a first position of UEFI Boot Order of the test host, and adding a second Boot item identifier to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before the hard disk storing the test main program is started.
After the first Boot item is created, a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested is added to a first position of the UEFI Boot Order of the test host, and a second Boot item identifier is added to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position, so that the target hard disk to be tested is started before the hard disk storing the test main program.
And the UEFI Boot Order of the test host represents the starting sequence of the hard disks, the hard disks corresponding to the starting item identifications are sequentially started according to the front-back sequence of the starting item identifications of the UEFI Boot Order, and the operating system is installed and tested on the hard disks. The first starting item identification corresponding to the target hard disk to be tested is positioned in front of the second starting item identification corresponding to the hard disk for storing the testing main program, so that even if the target hard disk to be tested fails in testing, the target hard disk to be tested can be switched back to the hard disk for storing the testing main program. The Boot entry identifier of each Boot entry may be used to indicate a Boot sequence number, for example, Boot001, Boot002, Boot003, and the like.
As can be seen, in the present application, a hard disk test instruction input by a user in a user mode is first obtained, where the hard disk test instruction includes a first drive letter of a target hard disk to be tested, where the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host, then it is determined whether a first startup item corresponding to the target hard disk to be tested exists in the test host based on the first drive letter, if the first startup item corresponding to the target hard disk to be tested does not exist in the test host, a first startup item corresponding to the target hard disk to be tested is created, then a first startup item identifier of the first startup item corresponding to the target hard disk to be tested is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier is added to a second position of the UEFI Boot Order, where the second startup item identifier of a hard disk corresponding to the test host is stored in the test host, where the second startup item identifier is a second startup item identifier of the hard disk corresponding to be An item identification, the first location preceding the second location, so as to launch the target hard disk to be tested before launching the hard disk storing a test main program. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first startup item corresponding to the target hard disk to be tested exists in the test host is determined based on a first disk identifier of the target hard disk to be tested, if the first startup item does not exist, the first startup item is created, then a first startup item identifier of the first startup item is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier of a second startup item corresponding to the hard disk storing a test main program is added to a second position behind the first position of the UEFI Boot Order. The position of the start item identification corresponding to the hard disk to be tested in the UEFI Boot Order is located in front of the start item identification corresponding to the hard disk storing the test main program, so that the hard disk to be tested can be started in sequence when the hard disk to be tested fails, the start sequence of the hard disk can be adjusted in a user state, the hard disk to be tested can be switched back to the hard disk storing the test main program when the hard disk to be tested fails, subsequent hard disk test is carried out, and the reliability of the hard disk to be tested is improved.
Referring to fig. 2, an embodiment of the present application discloses a specific method for adjusting a hard disk boot sequence in a user mode, which is applied to a test host, wherein an operating system of the test host is installed in UEFI and GPT manners, and the method includes:
step S21: the method comprises the steps of obtaining a hard disk test instruction input by a user in a user mode, wherein the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host.
Step S22: and determining whether a first starting item corresponding to the target hard disk to be tested exists in the testing host computer or not based on the first character.
Step S23: and if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, creating the first starting item corresponding to the target hard disk to be tested.
The specific implementation process of step S21 to step S23 may refer to the content disclosed in the foregoing embodiments, and will not be described herein again.
Step S24: and adding a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested to a first position of UEFI Boot Order of the test host, and adding a second Boot item identifier to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before the hard disk storing the test main program is started.
After the first Boot item is created, a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested is added to a first position of the UEFI Boot Order of the test host, and a second Boot item identifier is added to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position, so that the target hard disk to be tested is started before the hard disk storing the test main program.
For example, the first Boot item identifier (i.e., Boot sequence number) corresponding to the target hard disk to be tested may be placed in byte0-1 (each serial number occupies two bytes), the second Boot item identifier (i.e., Boot sequence number) corresponding to the hard disk where the test main program is located may be placed in byte2-3, and Boot sequence numbers of other hard disks not belonging to the target hard disk to be tested and the hard disk storing the test main program may be sequentially shifted back.
Before adding the second startup item identifier to the second position of the UEFI Boot Order, the method further comprises the following steps: and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive letter of the hard disk storing the test main program so as to determine a second starting item identifier of the second starting item.
That is, before the second startup item identifier is added to the second position of the UEFI Boot Order, the second startup item identifier also needs to be determined. The specific determination process is the same as the process of determining whether the first startup item corresponding to the target hard disk to be tested exists in the test host based on the first disk identifier in the foregoing embodiment.
Step S25: and if the first Boot item corresponding to the target hard disk to be tested exists in the test host, determining a third position of the first Boot item identifier of the first Boot item in UEFI Boot Order of the test host and a fourth position of the second Boot item identifier of the second Boot item corresponding to the hard disk storing the test main program in UEFI Boot Order.
And if the first Boot item corresponding to the target hard disk to be tested exists in the test host, determining a third position of the first Boot item identifier of the first Boot item in UEFI Boot Order of the test host and a fourth position of the second Boot item identifier of the second Boot item corresponding to the hard disk storing the test main program in UEFI Boot Order.
That is, if the first startup item already exists in the test host, it is further required to determine whether a position of the first startup item identifier in the UEFI Boot Order is before a position of a second startup item identifier corresponding to a hard disk storing a test main program. Therefore, a third position of the first startup item identifier in the UEFI Boot Order and a fourth position of the second startup item identifier in the UEFI Boot Order need to be obtained.
Step S26: determining whether the third position precedes the fourth position.
It is understood that after the third position and the fourth position are determined, it is also necessary to determine whether the third position is before the fourth position. And judging whether the target hard disk to be tested can be started before the hard disk storing the test main program.
Step S27: if not, the first starting item identification is moved to the front of the fourth position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
If not, the first starting item identification is required to be moved to the front of the fourth position so as to start the target hard disk to be tested before starting the hard disk storing the test main program. If so, no move processing may be required.
Referring to fig. 3, an embodiment of the present application discloses a device for adjusting a hard disk boot sequence in a user mode, which is applied to a test host, where an operating system of the test host is installed in UEFI and GPT manners, including:
the instruction obtaining module 11 is configured to obtain a hard disk test instruction input by a user in a user mode, where the hard disk test instruction includes a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of the test host;
a boot item determining module 12, configured to determine, based on the first disk identifier, whether a first boot item corresponding to the target hard disk to be tested exists in the test host;
a startup item creating module 13, configured to create a first startup item corresponding to the target hard disk to be tested when the first startup item corresponding to the target hard disk to be tested does not exist in the test host;
the hard disk start sequence adjusting module 14 is configured to add a first start item identifier of a first start item corresponding to the target hard disk to be tested to a first position of the UEFI Boot Order of the test host, and add a second start item identifier to a second position of the UEFI Boot Order, where the second start item identifier is an identifier of a second start item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position, so that the target hard disk to be tested is started before the hard disk storing the test main program is started.
As can be seen, in the present application, a hard disk test instruction input by a user in a user mode is first obtained, where the hard disk test instruction includes a first drive letter of a target hard disk to be tested, where the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host, then it is determined whether a first startup item corresponding to the target hard disk to be tested exists in the test host based on the first drive letter, if the first startup item corresponding to the target hard disk to be tested does not exist in the test host, a first startup item corresponding to the target hard disk to be tested is created, then a first startup item identifier of the first startup item corresponding to the target hard disk to be tested is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier is added to a second position of the UEFI Boot Order, where the second startup item identifier of a hard disk corresponding to the test host is stored in the test host, where the second startup item identifier is a second startup item identifier of the hard disk corresponding to be An item identification, the first location preceding the second location, so as to launch the target hard disk to be tested before launching the hard disk storing a test main program. Therefore, when a hard disk test instruction which is input by a user in a user state and used for testing a target hard disk to be tested is obtained, whether a first startup item corresponding to the target hard disk to be tested exists in the test host is determined based on a first disk identifier of the target hard disk to be tested, if the first startup item does not exist, the first startup item is created, then a first startup item identifier of the first startup item is added to a first position of UEFI Boot Order of the test host, and a second startup item identifier of a second startup item corresponding to the hard disk storing a test main program is added to a second position behind the first position of the UEFI Boot Order. The position of the start item identification corresponding to the hard disk to be tested in the UEFI Boot Order is located in front of the start item identification corresponding to the hard disk storing the test main program, so that the hard disk to be tested can be started in sequence when the hard disk to be tested fails, the start sequence of the hard disk can be adjusted in a user state, the hard disk to be tested can be switched back to the hard disk storing the test main program when the hard disk to be tested fails, subsequent hard disk test is carried out, and the reliability of the hard disk to be tested is improved.
In some specific embodiments, the apparatus for adjusting a hard disk boot sequence in a user mode further includes:
the position adjusting module is used for determining a third position of a first starting item identifier of the first starting item in UEFI Boot Order of the test host and a fourth position of a second starting item identifier of a second starting item corresponding to the hard disk for storing the test main program in UEFI Boot Order if the first starting item corresponding to the target hard disk to be tested exists in the test host; determining whether the third position is before the fourth position; if not, the first starting item identification is moved to the front of the fourth position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
In some specific embodiments, the activation item determining module 12 is configured to:
determining a target globally unique identifier corresponding to the first identifier;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists.
In some specific embodiments, the activation item determining module 12 is configured to:
and reading the target global unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
In some specific embodiments, the activation item determining module 12 is configured to:
traversing all startup items on the test host to obtain information of each startup item on the test host, wherein the information of each startup item comprises a globally unique identifier corresponding to each startup item;
and determining whether a first startup item corresponding to the target globally unique identifier exists in the test host or not based on the information of each startup item so as to determine whether a first startup item corresponding to the target hard disk to be tested exists or not.
In some specific embodiments, the activation item determining module 12 is further configured to:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive letter of the hard disk storing the test main program so as to determine a second starting item identifier of the second starting item.
Referring to fig. 4, a schematic structural diagram of a test host 20 provided in this embodiment of the present application is shown, where an operating system of the test host 20 is installed in UEFI and GPT manners, and the test host 20 may implement the method steps for adjusting the hard disk start sequence in the user state disclosed in the foregoing embodiment.
Generally, the test host 20 in the present embodiment includes: a processor 21 and a memory 22.
The processor 21 may include one or more processing cores, such as a four-core processor, an eight-core processor, and so on. The processor 21 may be implemented by at least one hardware of a DSP (digital signal processing), an FPGA (field-programmable gate array), and a PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit) which is responsible for rendering and drawing images to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor for processing computing operations related to machine learning.
Memory 22 may include one or more computer-readable storage media, which may be non-transitory. Memory 22 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 22 is at least used for storing the following computer program 221, wherein after the computer program is loaded and executed by the processor 21, the method steps for adjusting the hard disk boot sequence in the user mode disclosed in any of the foregoing embodiments can be implemented.
In some embodiments, the test host 20 may further include a display 23, an input/output interface 24, a communication interface 25, a sensor 26, a power supply 27, and a communication bus 28.
Those skilled in the art will appreciate that the configuration shown in FIG. 4 is not limiting to test host 20 and may include more or fewer components than those shown.
Further, an embodiment of the present application further discloses a computer-readable storage medium for storing a computer program, where the computer program is executed by a processor to implement the method for adjusting the hard disk boot sequence in the user mode disclosed in any of the foregoing embodiments.
For a specific process of the method for adjusting the hard disk start sequence in the user mode, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of other elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device, the equipment and the medium for adjusting the hard disk starting sequence in the user mode provided by the application are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for adjusting a hard disk starting sequence in a user mode is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and comprises the following steps:
acquiring a hard disk test instruction input by a user in a user state, wherein the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of a test host;
determining whether a first starting item corresponding to the target hard disk to be tested exists in the testing host computer or not based on the first disk identifier;
if the first starting item corresponding to the target hard disk to be tested does not exist in the testing host, establishing the first starting item corresponding to the target hard disk to be tested;
and adding a first Boot item identifier of a first Boot item corresponding to the target hard disk to be tested to a first position of UEFI Boot Order of the test host, and adding a second Boot item identifier to a second position of the UEFI Boot Order, wherein the second Boot item identifier is an identifier of a second Boot item corresponding to a hard disk storing a test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before the hard disk storing the test main program is started.
2. The method for user-mode adjustment of the boot order of the hard disks according to claim 1, wherein after determining whether the first boot entry corresponding to the target hard disk to be tested exists in the test host based on the first identifier, the method further comprises:
if a first Boot item corresponding to the target hard disk to be tested exists in the test host, determining a third position of a first Boot item identifier of the first Boot item in UEFI Boot Order of the test host and a fourth position of a second Boot item identifier of a second Boot item corresponding to the hard disk storing the test main program in UEFI Boot Order;
determining whether the third position is before the fourth position;
if not, the first starting item identification is moved to the front of the fourth position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
3. The method for adjusting the boot order of the hard disks in the user state according to claim 1 or 2, wherein the determining whether the first boot item corresponding to the target hard disk to be tested exists in the test host based on the first identifier includes:
determining a target globally unique identifier corresponding to the first identifier;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists.
4. The method for user-mode tuning of the boot sequence of a hard disk according to claim 3, wherein the determining the target globally unique identifier corresponding to the first identifier comprises:
and reading the target global unique identifier from the 3 rd LBA of the target hard disk to be tested by using the first identifier.
5. The method for adjusting the boot order of the hard disks in the user mode according to claim 3, wherein the determining whether the first boot item corresponding to the target globally unique identifier exists in the test host to determine whether the first boot item corresponding to the target hard disk to be tested exists comprises:
traversing all startup items on the test host to obtain information of each startup item on the test host, wherein the information of each startup item comprises a globally unique identifier corresponding to each startup item;
and determining whether a first startup item corresponding to the target globally unique identifier exists in the test host or not based on the information of each startup item so as to determine whether a first startup item corresponding to the target hard disk to be tested exists or not.
6. The method for user-mode adjustment of the Boot Order of the hard disks according to claim 1, wherein before adding the second Boot entry identifier to the second location of the UEFI Boot Order, the method further comprises:
and determining a second starting item corresponding to the hard disk storing the test main program based on a second drive letter of the hard disk storing the test main program so as to determine a second starting item identifier of the second starting item.
7. A device for adjusting the starting sequence of a hard disk in a user mode is applied to a test host, wherein an operating system of the test host is installed by using UEFI and GPT modes, and the device comprises:
the system comprises an instruction acquisition module, a test host and a test host, wherein the instruction acquisition module is used for acquiring a hard disk test instruction input by a user in a user mode, the hard disk test instruction comprises a first drive letter of a target hard disk to be tested, and the first drive letter is an identifier of the target hard disk to be tested in an operating system of the test host;
a boot item determining module, configured to determine, based on the first disk identifier, whether a first boot item corresponding to the target hard disk to be tested exists in the test host;
the starting item creating module is used for creating a first starting item corresponding to the target hard disk to be tested when the first starting item corresponding to the target hard disk to be tested does not exist in the testing host;
and the hard disk starting sequence adjusting module is used for adding a first starting item identifier of a first starting item corresponding to the target hard disk to be tested to a first position of the UEFI Boot Order of the test host and adding a second starting item identifier to a second position of the UEFI Boot Order, wherein the second starting item identifier is an identifier of a second starting item corresponding to the hard disk storing the test main program in the test host, and the first position is before the second position so as to start the target hard disk to be tested before starting the hard disk storing the test main program.
8. The apparatus for adjusting a booting sequence of a hard disk in a user mode according to claim 7, wherein the booting item determining module is configured to:
determining a target globally unique identifier corresponding to the first identifier;
and determining whether a first startup item corresponding to the target global unique identifier exists in the test host to determine whether a first startup item corresponding to the target hard disk to be tested exists.
9. A test host, comprising:
a memory and a processor;
wherein the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the method for adjusting the boot sequence of a hard disk in a user mode according to any one of claims 1 to 6.
10. A computer-readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the method for user-mode tuning of a boot sequence of a hard disk according to any of claims 1 to 6.
CN202011529562.7A 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode Active CN112540889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011529562.7A CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011529562.7A CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Publications (2)

Publication Number Publication Date
CN112540889A true CN112540889A (en) 2021-03-23
CN112540889B CN112540889B (en) 2023-08-15

Family

ID=75017120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011529562.7A Active CN112540889B (en) 2020-12-22 2020-12-22 Method, device, equipment and medium for adjusting hard disk starting sequence in user mode

Country Status (1)

Country Link
CN (1) CN112540889B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140365758A1 (en) * 2013-06-11 2014-12-11 International Business Machines Corporation Techniques for booting an information processing system
CN105354122A (en) * 2015-12-07 2016-02-24 浪潮电子信息产业股份有限公司 Function test optimization method of dual-use hard disk backplane of server
CN107220153A (en) * 2017-06-28 2017-09-29 济南浪潮高新科技投资发展有限公司 A kind of calculator memory switching card test method and device based on UEFI
CN108008914A (en) * 2016-10-27 2018-05-08 华为技术有限公司 The method, apparatus and ARM equipment of disk management in a kind of ARM equipment
CN109117195A (en) * 2018-07-27 2019-01-01 郑州云海信息技术有限公司 A kind of method, device and equipment of UEFI mode adjustment boot sequence
CN109656627A (en) * 2018-12-18 2019-04-19 广东浪潮大数据研究有限公司 Starting method, activation system and the relevant apparatus of hard disk in a kind of BIOS
CN110018856A (en) * 2019-04-03 2019-07-16 中电科技(北京)有限公司 The method that dynamic modifies UEFI boot sequence
CN111459740A (en) * 2020-04-14 2020-07-28 深圳忆联信息系统有限公司 Master-slave disk serial test method and device for solid state disk and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140365758A1 (en) * 2013-06-11 2014-12-11 International Business Machines Corporation Techniques for booting an information processing system
CN105354122A (en) * 2015-12-07 2016-02-24 浪潮电子信息产业股份有限公司 Function test optimization method of dual-use hard disk backplane of server
CN108008914A (en) * 2016-10-27 2018-05-08 华为技术有限公司 The method, apparatus and ARM equipment of disk management in a kind of ARM equipment
CN107220153A (en) * 2017-06-28 2017-09-29 济南浪潮高新科技投资发展有限公司 A kind of calculator memory switching card test method and device based on UEFI
CN109117195A (en) * 2018-07-27 2019-01-01 郑州云海信息技术有限公司 A kind of method, device and equipment of UEFI mode adjustment boot sequence
CN109656627A (en) * 2018-12-18 2019-04-19 广东浪潮大数据研究有限公司 Starting method, activation system and the relevant apparatus of hard disk in a kind of BIOS
CN110018856A (en) * 2019-04-03 2019-07-16 中电科技(北京)有限公司 The method that dynamic modifies UEFI boot sequence
CN111459740A (en) * 2020-04-14 2020-07-28 深圳忆联信息系统有限公司 Master-slave disk serial test method and device for solid state disk and computer equipment

Also Published As

Publication number Publication date
CN112540889B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
US7337313B2 (en) Information device, storage medium and initial state restoration method
US7293166B2 (en) Method of indicating a format of accessing an operating system contained on a USB memory device
US7322029B2 (en) Method and system for recovering program code in a computer system
CN101650660B (en) Booting a computer system from central storage
US7617391B2 (en) Method and apparatus for dynamically selecting one of multiple firmware images for booting an I/O controller
JP4842432B2 (en) System and method for providing functions to system BIOS
KR101555210B1 (en) Apparatus and method for downloadin contents using movinand in portable terminal
US20040230963A1 (en) Method for updating firmware in an operating system agnostic manner
US20110213954A1 (en) Method and apparatus for generating minimum boot image
US20150154033A1 (en) Computer system and boot method thereof
CN109408122B (en) Equipment starting method, electronic equipment and computer storage medium
CN112506745B (en) Memory temperature reading method and device and computer readable storage medium
US20100049961A1 (en) Update method for basic input/output system and update system thereof
US7849300B2 (en) Method for changing booting sources of a computer system and a related backup/restore method thereof
US20040225874A1 (en) Method for reduced BIOS boot time
CN112667442B (en) Control method, device and equipment based on nonvolatile memory device starting system
EP4296860A1 (en) Method for running startup program of electronic device, and electronic device
CN112540889A (en) Method, device, equipment and medium for adjusting hard disk starting sequence in user state
CN113721993A (en) System starting method, device, equipment and computer readable storage medium
CN111930575A (en) Firmware acquisition method and device and electronic equipment
CN110928582B (en) Information processing apparatus and method of configuring target device of information processing apparatus
CN111538540B (en) Method for accelerating starting speed of embedded system and embedded system thereof
JP2002024024A (en) Method and system for performing adapater configuration routine by using different operation mode
CN1145102C (en) Active partitioned switching method of hard disk
EP1914628A1 (en) Method for changing booting sources of computer system and related backup/restore method thereof

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