Nvme hard disk drive symbol disorder diagnosis method, system, terminal and storage medium
Patent Information
- Application Number
- CN202211666224.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-12-23
AI Technical Summary
[0004]在此种情况下,无法判断硬盘盘序与设计是否一致,也无法判断当前需要控制的硬盘实际上是哪一块硬盘,给识别和操作带来了不便
[0052]The present invention provides a method, system, terminal, and storage medium for diagnosing NVMe hard drive letter disorder. Based on the CPU PE port topology and the BDF (Browser-Definition Node) relationship of each NVMe hard drive in the system design, it determines the current position of the NVMe peripheral in the entire system and correlates it with the NVMe hard drive letter. This allows it to determine whether the NVMe hard drive letter display under the OS is consistent with the design. Furthermore, it reveals whether the disorder is truly caused by a system hard drive identification failure, hard drive letter drift, or simply because the hard drive letters are not displayed in sequence under the current OS.
Smart Images

Figure CN115952038B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, specifically to a method, system, terminal, and storage medium for diagnosing NVMe hard drive letter disorder. Background Technology
[0002] In server systems, hard drives are an essential component. Server hard drives commonly use mechanical hard drives (HDDs) and solid-state drives (SSDs). SSDs utilize NVMe drives, which use the PCIe bus as the medium and are known for their low latency and high speed. In a server system composed of multiple hard drives, each hard drive is assigned a drive letter. Generally, the drive letters in the OS correspond exactly to the physical silkscreen markings on the chassis panel. Hard drives are usually arranged in a certain order (usually from smallest to largest), known as drive order. Intel Xeon series CPUs have 5 PE ports per CPU, which can be considered as a PCIe RC (Root Compute). Each PE port includes 16 PCIe lanes, which can be flexibly allocated to different PCIe bandwidths to support various peripherals in different scenarios. When the PCIe peripheral is an NVMe hard drive, since each NVMe hard drive requires x4 PCIe lanes, each PE port supports 4 hard drives. In the initial system design of servers equipped with NVMe hard drives, the hard drive order is sorted according to the serial number of the different PE ports of the CPU from smallest to largest. Within the PE ports, they are sorted according to the serial number of the PC IE lane within the group from smallest to largest, and this hard drive order corresponds to the physical hard drive order on the chassis panel.
[0003] In Linux operating systems, command-line input is required to view information such as the serial number and capacity of currently mounted hard drives. However, due to unique Linux characteristics, the drive letters displayed in the OS are not arranged in ascending order (e.g., NVME1, NVME2, NVME3…), but may appear in a random order such as NVME2, NVME3, NVME 1… Because the system design uses sequential drive letters, while the OS displays them in random order, two scenarios are possible: 1. The drive letters in the OS do not correspond to the actual physical drive letters, i.e., drive letter drift has occurred; 2. It is merely a matter of the operating system's display order, and the actual drive letters in the OS still correspond one-to-one with the physical drive letters (e.g., NVME2 still corresponds to the second physical hard drive).
[0004] In this situation, it is impossible to determine whether the hard drive order is consistent with the design, nor is it possible to determine which hard drive is actually being controlled, which brings inconvenience to identification and operation. Summary of the Invention
[0005] In view of the above-mentioned shortcomings of the prior art, the present invention provides a method, system, terminal and storage medium for diagnosing NVMe hard disk drive letter disorder, so as to solve the above-mentioned technical problems.
[0006] In a first aspect, the present invention provides a method for diagnosing NVMe hard drive letter disorder, comprising:
[0007] Get the drive letter information and drive order of each hard drive;
[0008] Based on the drive letter information and drive order, retrieve the BDF number corresponding to each hard drive drive letter in sequence;
[0009] Determine whether the order of the disk numbers and the corresponding BDF numbers of each hard drive drive letter conforms to the expected pattern:
[0010] If so, the reason for the current hard drive letter being out of order is determined to be that the server is displaying it out of order;
[0011] If not, then the reason for the current hard drive letter disorder is determined to be drive letter drift.
[0012] Furthermore, obtain the drive letter information and drive order of each hard drive, including:
[0013] The drive letters of each hard drive output by the operating system after executing the drive letter output command are temporarily stored sequentially to the specified path.
[0014] Furthermore, before retrieving the BDF number corresponding to each hard drive letter based on the drive letter information and drive order, the method also includes:
[0015] Determine if the drive letters of the current hard drives are arranged in descending or ascending order:
[0016] If so, the step of retrieving the BDF number of each hard drive based on the drive letter information will not be executed again;
[0017] If not, continue with the steps to retrieve the BDF number of each hard drive based on the drive letter information.
[0018] Furthermore, based on the drive letter information and drive order, the BDF number corresponding to each hard drive drive letter is retrieved sequentially, including:
[0019] Under the operating system, the BDF number query command can be used to print out the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive.
[0020] Based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, an actual PC IE topology is constructed, and each hard drive letter is marked on the actual PC IE topology.
[0021] Furthermore, determine whether the disk sequence and the corresponding BDF numbers of each hard drive drive letter conform to the expected pattern, including:
[0022] Confirm that the BDF numbers of each hard drive in the actual PC IE topology are arranged in ascending order;
[0023] Determine if the drive letters of the hard drives in the actual PC IE topology are arranged in ascending order:
[0024] If so, then the order of the disk sequence and the corresponding BDF numbers of each hard drive disk letter conforms to the expected pattern.
[0025] If not, then the hard drive letter arrangement order is determined to be inconsistent with the expected pattern.
[0026] Secondly, the present invention provides an NVMe hard drive letter disorder diagnosis system, comprising:
[0027] The first acquisition unit is used to acquire the drive letter information and drive order of each hard drive.
[0028] The second acquisition unit is used to retrieve the BDF number corresponding to each hard drive drive letter in sequence according to the drive letter information and drive order.
[0029] The pattern judgment unit is used to determine whether the arrangement order of the disk number and the corresponding BDF number of each hard drive disk letter conforms to the expected pattern.
[0030] The first determination unit is used to determine that the reason for the current disordered hard drive letter is that the server displays the disordered order if the arrangement order of the disk number and the corresponding BDF number of each hard drive letter conforms to the expected pattern.
[0031] The second determination unit is used to determine that the reason for the current disordered hard drive letter is drive letter drift if the arrangement order of the disk number or the corresponding BDF number of each hard drive letter does not conform to the expected pattern.
[0032] Furthermore, obtain the drive letter information and drive order of each hard drive, including:
[0033] The drive letters of each hard drive output by the operating system after executing the drive letter output command are temporarily stored sequentially to the specified path.
[0034] Furthermore, before retrieving the BDF number corresponding to each hard drive letter based on the drive letter information and drive order, the system also performs the following:
[0035] Determine if the drive letters of the current hard drives are arranged in descending or ascending order:
[0036] If so, the step of retrieving the BDF number of each hard drive based on the drive letter information will not be executed again;
[0037] If not, continue with the steps to retrieve the BDF number of each hard drive based on the drive letter information.
[0038] Furthermore, the second acquisition unit includes:
[0039] The information query module is used to print out the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive through the BDF number query command under the operating system.
[0040] The topology building module is used to construct the actual PCIe topology based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, and to label each hard drive letter on the actual PCIe topology.
[0041] Furthermore, the pattern recognition unit includes:
[0042] The first judgment module is used to confirm that the corresponding BDF numbers of each hard drive in the actual PCIe topology are arranged in ascending order;
[0043] The second judgment module is used to determine whether the drive letters of each hard drive in the actual PCIe topology are arranged in ascending order:
[0044] The first determination module is used to determine whether the disk order and the arrangement of the corresponding BDF numbers of each hard drive disk letter in the actual PC IE topology conform to the expected pattern if the disk letter arrangement order of each hard drive disk letter is arranged in ascending order.
[0045] The second determination module is used to determine if the disk drive letter arrangement order does not conform to the expected pattern if the disk drive letter arrangement order of each hard drive in the actual PC IE topology is not arranged in ascending order.
[0046] Thirdly, a terminal is provided, including:
[0047] Processor, memory, among which,
[0048] This memory is used to store computer programs.
[0049] The processor is used to retrieve and run the computer program from memory, causing the terminal to perform the terminal method described above.
[0050] Fourthly, a computer storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0051] The beneficial effects of this invention are as follows:
[0052] The present invention provides a method, system, terminal, and storage medium for diagnosing NVMe hard drive letter disorder. Based on the CPU PE port topology and the BDF (Browser-Definition Node) relationship of each NVMe hard drive in the system design, it determines the current position of the NVMe peripheral in the entire system and correlates it with the NVMe hard drive letter. This allows it to determine whether the NVMe hard drive letter display under the OS is consistent with the design. Furthermore, it reveals whether the disorder is truly caused by a system hard drive identification failure, hard drive letter drift, or simply because the hard drive letters are not displayed in sequence under the current OS.
[0053] Furthermore, the design principle of this invention is reliable, the structure is simple, and it has a very wide range of application prospects. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic flowchart of a method according to an embodiment of the present invention.
[0056] Figure 2 This is a PC IE topology example diagram.
[0057] Figure 3 This is a schematic block diagram of a system according to an embodiment of the present invention.
[0058] Figure 4 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0059] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0060] The key terms used in this invention will be explained below.
[0061] The CPU (Central Processing Unit) is the core of a computer system for computation and control, and is the final execution unit for information processing and program execution.
[0062] NVMe hard drives refer to the Non-Volatile Memory Host Controller Interface Specification, which is a logical device interface specification.
[0063] PCI-Extensions (Peripheral Component Interconnect Extensions) is a high-speed serial computer expansion bus standard, originally named "3GIO". Proposed by Intel in 2001, it aimed to replace the older PCI, PCI-X, and AGP bus standards. PCIe is a high-speed serial point-to-point dual-channel high-bandwidth transmission standard. Connected devices are allocated dedicated channel bandwidth and do not share bus bandwidth. It primarily supports active power management, error reporting, end-to-end reliable transmission, hot-swapping, and Quality of Service (QoS) functions. PCIe is merely an extension bus for the southbridge; it is independent of the operating system, thus ensuring compatibility with the existing PCI. This means that for a considerable period, PCIe interfaces will coexist with PCI interfaces on motherboards, facilitating upgrades for users. Therefore, the greatest significance of PCIe lies in its versatility. It can be used not only for connecting the southbridge to other devices but also for connecting chipsets and even graphics processors. This unifies the entire I / O system, further simplifying computer systems and increasing portability and modularity. PCIe connections are built on a bidirectional, sequential (1-bit) point-to-point connection, known as a "transmission channel." This contrasts sharply with PCI, which is based on a bus-controlled, unidirectional 32-bit parallel bus shared by all devices. PCIe is a multi-layered protocol consisting of a session layer, a data exchange layer, and a physical layer. The physical layer is further divided into logical and electrical sublayers. The logical sublayer is further divided into the Physical Code Sublayer (PCS) and the Media Access Control Sublayer (MAC).
[0064] In a PC I Express (PCIe) system, a root complex device connects the processor and memory subsystem to a PC I Express switching fabric consisting of one or more switching devices. Similar to the host bridge in a PCI system, the root complex generates transaction requests on behalf of the processor and interconnects with each other via a local bus. Root complex functionality can be implemented as a discrete device or integrated into the processor. A root complex may contain multiple PC I Express ports and can connect multiple switching devices to the root complex or cascaded ports.
[0065] Linux, short for GNU / Linux, is a free and open-source UNIX-like operating system. Its kernel was first released by Linus Benedict Torvalds on October 5, 1991. Primarily inspired by Minix and Unix, it is a POSIX-based, multi-user, multi-tasking operating system supporting multi-threading and multi-CPU systems. It can run major Unix utilities, applications, and network protocols. It supports both 32-bit and 64-bit hardware. Linux inherits Unix's network-centric design philosophy and is a stable multi-user network operating system. There are hundreds of different Linux distributions, such as the community-developed Debian and Arch Linux, and the commercially developed Red Hat Enterprise Linux, SUSE, and Oracle Linux.
[0066] When a drive letter is displayed out of order in the OS, a method is needed to confirm whether a drive letter drift has actually occurred (i.e., the drive letter in the OS does not match the design), or whether the drive letter arrangement is simply out of order and the actual drive letter is consistent with the design (i.e., the drive letter on the chassis panel / CPU PE port number).
[0067] Figure 1 This is a schematic flowchart illustrating a method according to an embodiment of the present invention. Wherein, Figure 1 The executing entity can be an NVMe hard drive letter disorder diagnosis system.
[0068] like Figure 1 As shown, the method includes:
[0069] Step 110: Obtain the drive letter information and drive order of each hard drive.
[0070] Step 120: Retrieve the BDF number corresponding to each hard drive drive letter according to the drive letter information and drive order;
[0071] Step 130: Determine whether the disk number and the corresponding BDF number of each hard drive drive letter conform to the expected pattern:
[0072] Step 140: If yes, then determine that the reason for the current hard drive letter being out of order is that the server is displaying it out of order.
[0073] Step 150: If not, then the reason for the current hard drive letter disorder is determined to be drive letter drift.
[0074] To facilitate understanding of the present invention, the following description further illustrates the NVMe hard drive letter disorder diagnosis method provided by the present invention, based on the principle of the present invention and the process of diagnosing NVMe hard drive letter disorder in the embodiments.
[0075] Specifically, methods for diagnosing NVMe hard drive letter disorder include:
[0076] S 1. Obtain the drive letter information and drive order of each hard drive.
[0077] Specifically, the drive letters of each hard drive output by the operating system after executing the drive letter output command are temporarily stored to a specified path. That is, the drive letter output command `l sb lk` outputs the current drive letter and capacity of each hard drive, but does not print them out immediately. Instead, the hard drive status information is temporarily stored and edited later.
[0078] S 2. Retrieve the BDF number corresponding to each hard drive letter according to the drive letter information and drive order.
[0079] Before retrieving the BDF number corresponding to each hard drive letter based on the drive letter information and drive order, the following steps need to be performed: Determine whether the current drive letter arrangement of each hard drive is from largest to smallest or from smallest to largest: If yes, then the step of retrieving the BDF number of each hard drive based on the drive letter information is not performed; if no, then the step of retrieving the BDF number of each hard drive based on the drive letter information continues.
[0080] Before making a diagnosis, it is necessary to determine whether the drive letter information output by the CPU is out of order. If it is not out of order, there is no need for diagnosis.
[0081] If diagnostics are required, the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive are printed out using the BDF number query command in the operating system. Based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, the actual PCIE topology is constructed, and each hard drive letter is marked on the actual PCIE topology.
[0082] Generally, during startup, the CPU enumerates PCIe cards sequentially according to their internal PCIe logical bus numbers in ascending order. However, in some Intel CPU architectures, the PCIe logical bus numbers and the CPU's PE port numbers do not correspond one-to-one, requiring the BIOS to configure them to correspond correctly. By modifying the setup options in the BIOS, the CPU will enumerate PCIe cards in ascending order of PE ports. Therefore, the system design also maps the hard drive order to the CPU PE port order in ascending order.
[0083] During PCIe initialization, the Root Compute (RC) scans and identifies all PCIe devices using a depth-first search algorithm, assigning a BDF (Block Definition) number to each node. (BDF: bus, device, function). PCIe supports a maximum of 256 buses, each bus supports a maximum of 32 devices, and each device supports a maximum of 8 functions. In the PCIe topology, each node's BDF number is unique, serving as its identifier within the topology. The depth-first search algorithm, simply put, scans every branch of the PCIe tree until it reaches the very end. Once all nodes on a given branch have been scanned, the next branch is scanned sequentially, with each node scanned only once. Figure 2For example, each RC or PCIe SWI THC contains a P2P virtual bridge used to connect other nodes. Like peripherals, each P2P bridge has a unique BDF number. Nodes connected to the same BUS share the same BUS number. For a specific server configuration, the peripheral connection arrangement is fixed. The topology within a CPU PE port group and the PCIe topology between groups are fixed, as are the corresponding PCIe tree topologies. However, during system startup, as mentioned earlier, the PCIe enumeration order starts from the smallest PE port number and ends with the largest. Furthermore, within each PE port, enumeration is also performed in ascending order of lane number. Therefore, for a fixed configuration, the depth-first search algorithm for PCIe is the same. Each startup assigns the same BDF number to the subordinate PCIe peripherals (NVMe hard drives) and the corresponding P2P bridges on the RC. For example, PE port 0 has four P2P bridges connected to BUS 0a, and all have BUS number 0a. Since each of the four P2P bridges has only one function, their BDFs are: 0a:00:00; 0a:01:00; 0a:02:00; 0a:03:00. Each of the four P2P bridges has only one NVMe hard drive connected to it. According to the depth-first search algorithm, after scanning the P2P bridges connected to the RC's bus, the peripherals connected to each P2P bridge are scanned, and BDF numbers are assigned sequentially. In this configuration, the four NVMe hard drives under PE0 each occupy a dedicated bus, so their BDF numbers are: 0b:00:00; 0c:00:00; 0d:00:00; 0e:00:00. Because the CPU's PEport and its BDF number assigned by the depth-first search algorithm are fixed, the corresponding PCIe topology and BDF numbers of the peripherals are also fixed. The topology of PCIe within each PE port and the topology of PCIe between different PE ports can be identified through the BDF relationship (mainly the bus relationship and order).
[0084] By querying the PCIe BDF in the OS, the BDF number of each NVMe drive letter in the PCIe topology, as well as the BDF number of the P2P bridge of the RC to which the peripheral belongs, can be printed. A fixed correspondence can be obtained from each NVMe drive letter, its corresponding BDF number, and the BDF number of the P2P bridge to which the peripheral belongs. As described above, the logical correspondence of the peripheral at the CPU PE port level can be deduced from the BDF number. Therefore, each NVMe drive letter in the OS can establish a fixed connection with its physically corresponding CPU PE port through the relay of the BDF number.
[0085] In this application, after step S1 is completed, the command to find the corresponding BDF number and RC BDF number is executed using the obtained NVME drive letter, and another result is output without printing.
[0086] S3. Determine whether the disk order and the corresponding BDF number of each hard drive drive letter conform to the expected pattern: if yes, the reason for the current disordered hard drive drive letter is that the server displays the disordered order; if no, the reason for the current disordered hard drive drive letter is that the drive letter is drifting.
[0087] Specifically, confirm that the corresponding BDF numbers of each hard drive in the actual PCIe topology are arranged in ascending order; determine whether the drive letter arrangement order of each hard drive in the actual PCIe topology is arranged in ascending order: if yes, then determine that the drive order and the arrangement order of the corresponding BDF numbers of each hard drive drive letter both conform to the expected pattern; if not, then determine that the hard drive drive letter arrangement order does not conform to the expected pattern.
[0088] After mapping NVME drive letters to the overall PCIe drive letter order (BDF) numbers, the order of the BDF numbers can be compared with the NVME drive letter order. By comparing the order comparison results, it's immediately clear whether the actual NVME drive letter order matches the designed drive order, thus facilitating the determination of whether the system has experienced drive letter drifting or is simply a display order issue under the OS. In one embodiment of this application, after obtaining the two results, a single compilation command can combine the results of the two calculations and output them, setting automatic printing to simultaneously print the drive letter information and the corresponding BDF information. Based on the drive letters under the hard drive OS and all the BDF numbers of all hard drives, the current PCIe topology and the actual hard drive order can be determined.
[0089] Existing command-line instructions can only print the order of hard drive letters. If a drive letter disorder occurs, it cannot determine the true cause: a system hard drive identification failure, drive letter drift, or simply that the drive letters are not displayed in sequence under the current OS. Existing command-line technology cannot differentiate between these causes, making it difficult for maintenance personnel to locate the problem. This invention designs a method that determines the position of the current NVMe peripheral in the entire system based on the CPU PE port topology and the BDF relationship of each NVMe hard drive, and maps this position to the NVMe hard drive's drive letter. This allows the system to determine whether the NVMe hard drive letter display under the OS is consistent with the design. This helps to identify the true cause of the disorder: a system hard drive identification failure, drive letter drift, or simply that the drive letters are not displayed in sequence under the current OS. Furthermore, a combined printing method is designed, internally processing the NVMe hard drive's BDF addressing and drive letter display identification, and displaying them uniformly in the output, thus clearly showing the root cause of the current system's drive letter disorder. This facilitates convenient and direct problem location for maintenance personnel.
[0090] like Figure 3 As shown, the system 300 includes:
[0091] The first acquisition unit 310 is used to acquire the drive letter information and drive order of each hard drive.
[0092] The second acquisition unit 320 is used to retrieve the BDF number corresponding to each hard disk drive letter according to the drive letter information and drive order.
[0093] The pattern judgment unit 330 is used to determine whether the arrangement order of the disk number and the corresponding BDF number of each hard disk drive letter conforms to the expected pattern.
[0094] The first determination unit 340 is used to determine that the reason for the current disordered hard disk drive letter is that the server displays disordered order if the disk number and the arrangement order of the corresponding BDF number of each hard disk drive letter are in accordance with the expected pattern.
[0095] The second determination unit 350 is used to determine that the reason for the current disordered hard disk drive letter is drive letter drift if the disk number or the arrangement order of the corresponding BDF number of each hard disk drive letter does not conform to the expected pattern.
[0096] Optionally, as an embodiment of the present invention, obtaining the drive letter information and drive order of each hard drive includes:
[0097] The drive letters of each hard drive output by the operating system after executing the drive letter output command are temporarily stored sequentially to the specified path.
[0098] Optionally, as an embodiment of the present invention, before retrieving the BDF number corresponding to each hard drive letter according to the drive letter information and drive order, the system also performs the following:
[0099] Determine if the drive letters of the current hard drives are arranged in descending or ascending order:
[0100] If so, the step of retrieving the BDF number of each hard drive based on the drive letter information will not be executed again;
[0101] If not, continue with the steps to retrieve the BDF number of each hard drive based on the drive letter information.
[0102] Optionally, as an embodiment of the present invention, the second acquisition unit includes:
[0103] The information query module is used to print out the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive through the BDF number query command under the operating system.
[0104] The topology building module is used to construct the actual PCIe topology based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, and to label each hard drive letter on the actual PCIe topology.
[0105] Optionally, as an embodiment of the present invention, the pattern judgment unit includes:
[0106] The first judgment module is used to confirm that the corresponding BDF numbers of each hard drive in the actual PCIe topology are arranged in ascending order;
[0107] The second judgment module is used to determine whether the drive letters of each hard drive in the actual PCIe topology are arranged in ascending order:
[0108] The first determination module is used to determine whether the disk order and the arrangement of the corresponding BDF numbers of each hard drive disk letter in the actual PC IE topology conform to the expected pattern if the disk letter arrangement order of each hard drive disk letter is arranged in ascending order.
[0109] The second determination module is used to determine if the disk drive letter arrangement order does not conform to the expected pattern if the disk drive letter arrangement order of each hard drive in the actual PC IE topology is not arranged in ascending order.
[0110] Figure 4 This is a schematic diagram of the structure of a terminal 400 provided in an embodiment of the present invention. The terminal 400 can be used to execute the NVMe hard disk drive letter disorder diagnosis method provided in the embodiment of the present invention.
[0111] The terminal 400 may include a processor 410, a memory 420, and a communication unit 430. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0112] The memory 420 can be used to store the execution instructions of the processor 410. The memory 420 can be implemented by any type of volatile or non-volatile memory terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 420 are executed by the processor 410, the terminal 400 is able to perform some or all of the steps in the above method embodiments.
[0113] The processor 410 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 420, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 410 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.
[0114] The communication unit 430 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It receives user data sent by other terminals or sends user data to other terminals.
[0115] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps provided in the embodiments of the present invention. The storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0116] Therefore, this invention determines the position of the current NVMe peripheral in the entire system based on the topology of the CPU PE port and the BDF relationship of each NVMe hard drive in the system design, and associates it with the drive letter of the NVMe hard drive, thereby determining whether the display of the NVMe hard drive letter under the OS is consistent with the design. This allows us to determine whether the out-of-order display is truly due to a system hard drive identification failure, hard drive letter drift, or simply that the hard drive letters are not displayed in sequence under the current OS. The technical effects achieved by this embodiment can be found in the description above, and will not be repeated here.
[0117] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other medium capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods in the various embodiments of the present invention.
[0118] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
[0119] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0122] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the invention should also be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be determined by the scope of the claims.
Claims
1. A method for diagnosing NVMe hard drive letter disorder, characterized in that, include: Get the drive letter information and drive order of each hard drive; Based on the drive letter information and drive order, retrieve the BDF number corresponding to each hard drive drive letter in sequence; Determine whether the order of the disk numbers and the corresponding BDF numbers of each hard drive drive letter conforms to the expected pattern: If so, the reason for the current hard drive letter being out of order is determined to be that the server is displaying it out of order; If not, the reason for the current hard drive letter disorder is determined to be drive letter drift; Determine whether the disk sequence and the corresponding BDF numbers of each hard drive drive letter conform to the expected pattern, including: Confirm that the BDF numbers of each hard drive in the actual PCIe topology are arranged in ascending order; Determine if the drive letters of the hard drives in the actual PCIe topology are arranged in ascending order: If so, then the order of the disk sequence and the corresponding BDF numbers of each hard drive disk letter conforms to the expected pattern. If not, then the hard drive letter arrangement order is determined to be inconsistent with the expected pattern.
2. The method according to claim 1, characterized in that, Retrieve the drive letter information and drive order of each hard drive, including: The drive letters of each hard drive output by the operating system after executing the drive letter output command are temporarily stored sequentially to the specified path.
3. The method according to claim 1, characterized in that, Before retrieving the BDF number corresponding to each hard drive letter according to the drive letter information and drive order, the method further includes: Determine if the drive letters of the current hard drives are arranged in descending or ascending order: If so, the step of retrieving the BDF number of each hard drive based on the drive letter information will not be executed again; If not, continue with the step of retrieving the BDF number of each hard drive based on the drive letter information.
4. The method according to claim 1, characterized in that, Based on the drive letter information and drive order, retrieve the BDF number corresponding to each hard drive drive letter in sequence, including: Under the operating system, the BDF number query command can be used to print out the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive. Based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, an actual PCIe topology is constructed, and each hard drive letter is marked on the actual PCIe topology.
5. A diagnostic system for NVMe hard drive letter disorder, characterized in that, include: The first acquisition unit is used to acquire the drive letter information and drive order of each hard drive. The second acquisition unit is used to retrieve the BDF number corresponding to each hard disk drive letter in sequence according to the drive letter information and drive order. The pattern judgment unit is used to determine whether the arrangement order of the disk number and the corresponding BDF number of each hard drive disk letter conforms to the expected pattern. The first determination unit is used to determine that the reason for the current disordered hard drive letter is that the server displays the disordered order if the arrangement order of the disk number and the corresponding BDF number of each hard drive letter conforms to the expected pattern. The second determination unit is used to determine that the reason for the current disordered hard disk drive letter is drive letter drift if the disk number or the arrangement order of the corresponding BDF number of each hard disk drive letter does not conform to the expected pattern. The pattern judgment unit includes: The first judgment module is used to confirm that the corresponding BDF numbers of each hard drive in the actual PCIe topology are arranged in ascending order; The second judgment module is used to determine whether the drive letters of each hard drive in the actual PCIe topology are arranged in ascending order: The first determination module is used to determine whether the disk order and the arrangement of the corresponding BDF numbers of each hard drive disk letter in the actual PCIE topology conform to the expected pattern if the disk letter arrangement order of each hard drive disk letter is arranged in ascending order. The second determination module is used to determine that the disk drive letter arrangement does not conform to the expected pattern if the disk drive letter arrangement order of each hard drive in the actual PCIe topology is not arranged in ascending order.
6. The system according to claim 5, characterized in that, The second acquisition unit includes: The information query module is used to print out the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive using the BDF number query command under the operating system. The topology building module is used to construct the actual PCIe topology based on the BDF number corresponding to each hard drive letter and the BDF number of the P2P bridge above the hard drive, and to mark each hard drive letter on the actual PCIe topology.
7. A terminal, characterized in that, include: processor; Memory used to store the processor's execution instructions; The processor is configured to perform the method according to any one of claims 1-4.
8. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Method and device for detecting hard disk disorder based on Linux system
CN107329914A
Method for adjusting system disk drive sequence by resetting SAS and raid cards
CN107506151A