Operating system installation method, device and related components
By identifying the hard disk slot information on the storage device, the problem of system filling errors in the prior art is solved, and the accuracy and stability of the operating system automatic filling is improved.
Patent Information
- Application Number
- CN202211509882.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-11-29
AI Technical Summary
In the prior art, the use of Kickstart configuration files may be complicated during the system filling process of storage devices due to the customization requirements of system disks and hard disks and the differences in different hard disk naming methods of different production orders, and may cause external hard disk devices to be allocated to The wrong system disk letter causes an error in the operating system filling.
By identifying all hard disks on the storage device, obtaining slot information and drive letters for each hard disk, determining its drive letters based on the slot information of the system disk, and installing the operating system according to the determined drive letters to avoid identifying incorrect system disks. Improve the accuracy of the operating system's automated filling.
It realizes accurate identification and installation under different hard disk slots and naming methods, avoids operating system installation errors, and improves the accuracy and stability of automated filling.
Smart Images

Figure CN115827003B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage, and in particular to an operating system installation method, device and related components. Background Art
[0002] Currently, in the automated production of storage devices, system installation is an indispensable and very time-consuming and labor-intensive link. Specifically, system installation mainly includes installing the operating system into the system disk of the storage device, which is the hard disk used to load the operating system.
[0003] In the prior art, the system is automatically installed through a Kickstart configuration file. The Kickstart configuration file is a text file that records various parameters filled in by manual intervention. The storage device automatically configures the relevant settings of the storage device by reading the Kickstart configuration file to realize the automatic installation of the operating system. However, in actual production, different production orders often have customized requirements for system disks, hard disks and other devices, and hard disks from different manufacturers have different naming methods. Based on this, different Kickstart configuration files need to be used, which is cumbersome. In addition, since the system disk is usually identified by the drive letter for operating system installation, if the storage device is externally connected to other hard disk devices of the same type as the system disk, there may be a situation where the external hard disk device is assigned to the drive letter of the system disk, causing the storage device to identify the wrong system disk, resulting in an error in operating system installation.
[0004] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention
[0005] The purpose of this application is to provide an operating system installation method, device, electronic device and computer-readable storage medium, which can avoid identifying the wrong system disk and improve the accuracy of automatic filling of the operating system.
[0006] In order to solve the above technical problems, the present application provides an operating system installation method, which includes:
[0007] Get the operating system to be installed;
[0008] Identify all hard disks installed on the storage device, and obtain information about each hard disk, the information including the slot information and drive letter of the hard disk, and all the hard disks include the system disk;
[0009] Determine the drive letter of the system disk based on the slot information of the system disk;
[0010] The operating system to be installed is installed into the system disk according to the drive letter of the system disk.
[0011] Optionally, the slot information is a PCIE identifier of the slot where the hard disk is located.
[0012] Optionally, the operating system installation method further includes:
[0013] Determine the name of the system disk;
[0014] A PCIE identifier of the system disk is obtained based on the name of the system disk.
[0015] Optionally, the operating system installation method further includes:
[0016] When the storage device is provided with a plurality of target slots for installing the system disk, determining a PCIE identifier corresponding to each of the target slots;
[0017] Selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk;
[0018] Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0019] Determine whether there is a PCIE identifier identical to the current PCIE identifier in the information of all the hard disks;
[0020] If yes, determine the drive letter of the system disk based on the current PCIE identifier;
[0021] If not, repeat the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk.
[0022] Optionally, before identifying all hard disks installed on the storage device, the operating system installation method further includes:
[0023] Get the kernel file;
[0024] Accordingly, the process of identifying all hard disks installed on the storage device includes:
[0025] The kernel file is loaded to identify all hard disks installed on the storage device.
[0026] Optionally, the operating system installation method further includes:
[0027] Get the image file;
[0028] Decompress the image file to obtain an identification module and a configuration module;
[0029] Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0030] Determining the drive letter of the system disk based on the slot information of the system disk by the identification module;
[0031] Correspondingly, the process of installing the operating system to be installed into the system disk according to the drive letter of the system disk includes:
[0032] The operating system to be installed is installed into the system disk according to the drive letter of the system disk through the configuration module.
[0033] Optionally, before obtaining the operating system to be installed, the operating system installation method further includes:
[0034] Establishing a connection between the storage device and the PXE server using a boot program;
[0035] When the storage device and the PXE server are successfully connected, an installation boot file is obtained, wherein the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file;
[0036] The process of obtaining the operating system to be installed includes:
[0037] Obtaining the operating system to be installed from the PXE server based on the first address;
[0038] and / or,
[0039] The process of obtaining the kernel file includes:
[0040] Obtaining the kernel file from the PXE server based on the second address;
[0041] and / or,
[0042] The process of obtaining the image file includes:
[0043] The image file is obtained from the PXE server based on the third address.
[0044] Optionally, the operating system to be installed is a Linux operating system.
[0045] Optionally, the operating system installation method further includes:
[0046] Determining whether the system disk meets the installation conditions;
[0047] The process of installing the operating system to be installed to the system disk according to the drive letter of the system disk comprises:
[0048] When the system disk meets the installation condition, the operating system to be installed is installed to the system disk according to the drive letter of the system disk.
[0049] Optionally, the process of determining whether the system disk meets the installation conditions includes:
[0050] Determining whether the system disk is the current installation medium of the storage device;
[0051] If so, determine the path of the system disk and judge whether the disk size of the system disk meets the preset value;
[0052] If so, it is determined that the system disk meets the installation condition.
[0053] Optionally, the process of determining whether the system disk is the current installation medium of the storage device includes:
[0054] Determining whether the storage device is externally connected to a target storage medium;
[0055] If not, it is determined that the system disk is the current installation medium of the storage device.
[0056] Optionally, before determining the path of the system disk, the operating system installation method further includes:
[0057] Mount the system disk to a preset directory.
[0058] To solve the above technical problems, the present application also provides an operating system installation system, including:
[0059] A first acquisition module, used to acquire the operating system to be installed;
[0060] A second acquisition module is used to identify all hard disks installed on the storage device and obtain information of each hard disk, wherein the information includes slot information and drive letter of the hard disk, and all the hard disks include a system disk;
[0061] A first determining module, configured to determine a drive letter of the system disk based on the slot information of the system disk;
[0062] The installation module is used to install the operating system to be installed into the system disk according to the drive letter of the system disk.
[0063] In order to solve the above technical problems, the present application also provides an electronic device, including:
[0064] Memory for storing computer programs;
[0065] A processor is used to implement the steps of the operating system installation method as described in any one of the above when executing the computer program.
[0066] To solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the operating system installation method as described in any one of the above are implemented.
[0067] The present application provides an operating system installation method. Considering that the slot of the storage device for installing the hard disk is fixed, the present application accurately identifies the drive letter of the system disk based on the slot information of the hard disk on the storage device, so as to install the operating system to be installed to the correct system disk according to the identified drive letter, thereby avoiding operating system installation errors and improving the accuracy of operating system automatic filling. The present application also provides an operating system installation device, an electronic device, and a computer-readable storage medium, which have the same beneficial effects as the above operating system installation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0069] Figure 1 A flowchart of the steps of an operating system installation method provided in this application;
[0070] Figure 2 A structural diagram of an identification module provided in this application;
[0071] Figure 3 A schematic diagram of the structure of an operating system installation system provided in this application. DETAILED DESCRIPTION
[0072] The core of this application is to provide an operating system installation method, device, electronic device and computer-readable storage medium, which can avoid identifying the wrong system disk and improve the accuracy of automatic filling of the operating system.
[0073] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0074] Please refer to Figure 1 , Figure 1This is a flowchart of the steps of an operating system installation method provided in this application, and the operating system installation method includes:
[0075] S101: Obtain the operating system to be installed;
[0076] Specifically, in order to facilitate the automatic filling of the operating system of the storage device, a network interconnection is first established between the storage device to be filled and the PXE server. As a preferred embodiment, a boot program can be used to establish a connection between the storage device and the PXE server so as to obtain corresponding files and the operating system to be installed from the PXE server through the network, wherein the files include but are not limited to the kernel file vmlinuz and the image file initrd.img, etc. The operating system to be installed can specifically be a Linux operating system.
[0077] Specifically, after the storage device and the PXE server establish network interconnection normally, an installation boot file is obtained, in which a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file are identified. The storage device obtains the operating system to be installed from the PXE server based on the first address, obtains the kernel file from the PXE server based on the second address, and obtains the image file from the PXE server based on the third address.
[0078] S102: Identify all hard disks installed on the storage device and obtain information about each hard disk, including the slot information and drive letter of the hard disk. All hard disks include the system disk.
[0079] Specifically, when the storage device loads the kernel, it will identify all hard disks installed on the storage device. The storage device recognizes each hard disk in a random order. At the same time, the storage device assigns a serial number to each hard disk according to the order in which the hard disks are recognized. This serial number is the drive letter of the hard disk.
[0080] For example, if the storage device has two hard disks, the first hard disk identified is assigned a drive letter of 1, and the second hard disk identified is assigned a drive letter of 2. After identifying each hard disk, this step obtains the drive letter of each hard disk and the slot information of the slot where the hard disk is located. It can be understood that the slot information of each slot on the storage device is fixed and unchanged, and the system disk can be accurately located based on the slot information later.
[0081] Among them, the hard disk described in this embodiment includes but is not limited to NVME (Non Volatile Memory Express, non-volatile memory host controller interface specification) protocol hard disk, SATA (Serial Advanced Technology Attachment, serial advanced technology attachment) protocol hard disk, SAS (Serial Attached SCSI, serial small computer system interface) protocol hard disk, Direct IO protocol hard disk, etc. When the storage device identifies the hard disk, it can also identify the system disk and other external hard disks.
[0082] S103: Determine the drive letter of the system disk based on the slot information of the system disk;
[0083] S104: Install the operating system to be installed into the system disk according to the drive letter of the system disk.
[0084] It can be understood that the slot on each storage device for installing the system disk is fixed, and can be a fixed one, or fixed multiple. Before executing this step, it also includes a step of obtaining the slot information of the system disk. The slot information of the slot where the system disk is located is used as a matching basis, and is matched with the slot information of each hard disk obtained in S102, so as to determine the accurate system disk and the drive letter of the system disk, and then the Linux operating system to be installed is installed in the system disk based on the obtained drive letter.
[0085] For example, suppose there are three hard disks on the storage device, namely hard disk S1, hard disk S2 and hard disk S3. The slot information corresponding to hard disk S1 is 0 and the drive letter is d1. The slot information corresponding to hard disk S2 is 1 and the drive letter is d3. The slot information corresponding to hard disk S3 is 2 and the drive letter is d2. Assuming that the slot information of the system disk is 2, then based on matching the slot information with the information of the above three hard disks, it can be obtained that the drive letter corresponding to the system disk is d2.
[0086] It can be seen that in this embodiment, considering that the slot of the storage device for installing the hard disk is fixed, the present application accurately identifies the drive letter of the system disk based on the slot information of the hard disk on the storage device, so that the operating system to be installed can be installed to the correct system disk according to the identified drive letter, thereby avoiding operating system installation errors and improving the accuracy of automatic installation of the operating system.
[0087] Based on the above embodiments:
[0088] As an optional embodiment, the slot information is a PCIE identifier of the slot where the hard disk is located.
[0089] It is understandable that the PCIE (Peripheral Component Interconnect Express) identifiers of each slot on the storage device are fixed. Therefore, in this embodiment, the PCIE identifier of the slot can be selected as the slot information corresponding to the hard disk to facilitate subsequent accurate positioning of the system disk.
[0090] As an optional embodiment, the operating system installation method further includes:
[0091] Determine the name of the system disk;
[0092] Get the PCIE identifier of the system disk based on the name of the system disk.
[0093] Specifically, first check the PCIE identifier of each slot of the storage device to facilitate subsequent identification operations. This embodiment provides a method for checking the PCIE identifier, using 'ls-la
[0094] The ' / dev / disk / by-path' command can obtain the names and PCIE identifiers of all hard disks on the storage device. Then, considering that the PCIE identifiers of each slot on the storage device are fixed, in a storage device with a known system disk name, the PCIE identifier of the slot where the system disk is located can be found according to the name of the system disk.
[0095] For example, using the 'ls-la / dev / disk / by-path' command, you can get that there are three hard disks on the storage device. The name of the first hard disk is NVME-1, and the PCIE identifier of the slot it is in is 2. The name of the second hard disk is SAS-1, and the PCIE identifier of the slot it is in is 1. The name of the third hard disk is NVME-2, and the PCIE identifier of the slot it is in is 3. Assuming that the name of the system disk currently known to the storage device is NVME-2, the PCIE identifier of the slot where the system disk is located is 3.
[0096] As an optional embodiment, the operating system installation method further includes:
[0097] When the storage device is provided with multiple target slots for installing the system disk, determining the PCIE identifier corresponding to each target slot;
[0098] Select any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk;
[0099] Accordingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0100] Determine whether there is a PCIE identifier identical to the current PCIE identifier in the information of all hard disks;
[0101] If yes, determine the drive letter of the system drive based on the current PCIE identifier;
[0102] If not, the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk is repeated.
[0103] Specifically, you can use the command 'ls-la / dev / disk / by-path|grep-E"$i"|sort|head-1|cut-d / -f3' to quickly identify the drive letter of the system disk, where $i represents the PCIE identifier corresponding to the system disk. Furthermore, considering that the storage device may have more than one slot for the system disk, only the case of only one slot is shown here. If the device has multiple slots, you can use '|' to connect multiple PCIE identifiers, for example '$i|$j'.
[0104] As an optional embodiment, the operating system installation method further includes:
[0105] Get the image file;
[0106] Decompress the image file to obtain the identification module and configuration module;
[0107] Accordingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0108] Determine the drive letter of the system disk based on the slot information of the system disk through the identification module;
[0109] Accordingly, the process of installing the operating system to be installed into the system disk according to the drive letter of the system disk includes:
[0110] Use the configuration module to install the operating system to the system disk according to the drive letter of the system disk.
[0111] Specifically, the image file in this embodiment is an image file equipped with an identification module and a configuration module, which can be produced in the following manner: first, the initrd.img package can be decompressed by the command 'xz-dc initrd.img|cpio-id', and then the identification module is placed in the decompressed file system, and finally the command 'find. / |cpio--quiet-Hnewc-o|gzip-9-c>.. / initrd.img' is used to package the image file initrd.img that can be equipped with the identification code module.
[0112] Specifically, refer to Figure 2As shown, the identification module may include a configuration submodule, an identification submodule and a transmission submodule, wherein the configuration submodule may use the command 'ls-la / dev / disk / by-path' to obtain the name and PCIE identifier of each hard disk on the storage device, and the identification submodule may use the command 'ls-la
[0113] / dev / disk / by-path|grep-E"$i"|sort|head-1|cut-d / -f3' to quickly identify the drive letter of the system disk. The transfer submodule passes the obtained drive letter of the system disk to the configuration module. Specifically, the drive letter can be directly passed to the configuration module in the form of parameter passing. The configuration module installs the operating system to be installed into the system disk according to the drive letter of the system disk.
[0114] As an optional embodiment, the operating system installation method further includes:
[0115] Determine whether the system disk meets the installation conditions;
[0116] The process of installing the operating system to be installed to the system disk according to the drive letter of the system disk includes:
[0117] When the system disk meets the installation conditions, install the operating system to be installed to the system disk according to the drive letter of the system disk.
[0118] As an optional embodiment, the process of determining whether the system disk meets the installation condition includes:
[0119] Determine whether the system disk is the current installation medium of the storage device;
[0120] If yes, determine the path of the system disk and judge whether the disk size of the system disk meets the preset value;
[0121] If so, it is determined that the system disk meets the installation conditions.
[0122] As an optional embodiment, the process of determining whether the system disk is the current installation medium of the storage device includes:
[0123] Determine whether the storage device is externally connected to the target storage medium;
[0124] If not, it is determined that the system disk is the current installation medium of the storage device.
[0125] As an optional embodiment, before determining the path of the system disk, the operating system installation method further includes:
[0126] Mount the system disk to the default directory.
[0127] Specifically, before the system is installed, the present embodiment also performs conventional pre-installation configuration on the system disk, mainly including determining whether the system disk meets the installation conditions. If the system disk meets the installation conditions, the Linux operating system is installed into the system disk to ensure successful installation.
[0128] Specifically, first check whether the system disk is the current installation medium of the storage device. It can be understood that when installing the operating system, there is a pre-set priority for the installation medium. The priority of the target storage medium external to the storage device is greater than the priority of the system disk. Therefore, first determine whether the storage device has an external target storage medium. The target storage medium can be a USB flash drive. If not, the system disk is used as the installation medium. The system disk is mounted in a preset directory. Specifically, the system disk can be mounted in the / mnt directory, and then the path of the system disk is confirmed, as well as the disk size check. If the disk size meets the preset value, start installing the Linux operating system.
[0129] To summarize, the present application proposes a Linux operating system filling solution based on the PCIE identifier based on the fact that the fixed slot of the storage device has a fixed PCIE identifier. The solution can directly identify the hard disks of different manufacturers in the slot according to the PCIE identifier of the slot, and automatically fill the storage device without the need to make different configurations for new hard disk manufacturers. At the same time, when the storage device is connected to other hard disk devices, the system disk can be accurately found and correctly filled. In particular, normal filling can be achieved when the storage device has additional external hard disks of the same type as the system disk, which makes up for the shortcomings of the kickstart file filling technology.
[0130] On the other hand, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an operating system installation system provided in this application, and the operating system installation system includes:
[0131] A first acquisition module 1, used to acquire the operating system to be installed;
[0132] The second acquisition module 2 is used to identify all hard disks installed on the storage device and obtain information of each hard disk, including the slot information and drive letter of the hard disk, and all hard disks include the system disk;
[0133] A first determining module 3, configured to determine a drive letter of the system disk based on the slot information of the system disk;
[0134] The installation module 4 is used to install the operating system to be installed into the system disk according to the drive letter of the system disk.
[0135] Specifically, in order to facilitate the automatic filling of the operating system of the storage device, a network interconnection is first established between the storage device to be filled and the PXE server. As a preferred embodiment, a boot program can be used to establish a connection between the storage device and the PXE server so as to obtain corresponding files and the operating system to be installed from the PXE server through the network, wherein the files include but are not limited to the kernel file vmlinuz and the image file initrd.img, etc. The operating system to be installed can specifically be a Linux operating system.
[0136] Specifically, after the storage device and the PXE server establish network interconnection normally, an installation boot file is obtained, in which a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file are identified. The storage device obtains the operating system to be installed from the PXE server based on the first address, obtains the kernel file from the PXE server based on the second address, and obtains the image file from the PXE server based on the third address.
[0137] Specifically, when the storage device loads the kernel, it will identify all hard disks installed on the storage device. The storage device recognizes each hard disk in a random order. At the same time, the storage device assigns a serial number to each hard disk according to the order in which the hard disks are recognized. This serial number is the drive letter of the hard disk.
[0138] For example, if the storage device has two hard disks, the first hard disk identified is assigned a drive letter of 1, and the second hard disk identified is assigned a drive letter of 2. After identifying each hard disk, this step obtains the drive letter of each hard disk and the slot information of the slot where the hard disk is located. It can be understood that the slot information of each slot on the storage device is fixed and unchanged, and the system disk can be accurately located based on the slot information later.
[0139] Among them, the hard disk described in this embodiment includes but is not limited to NVME (Non Volatile Memory Express, non-volatile memory host controller interface specification) protocol hard disk, SATA (Serial Advanced Technology Attachment, serial advanced technology attachment) protocol hard disk, SAS (Serial Attached SCSI, serial small computer system interface) protocol hard disk, Direct IO protocol hard disk, etc. When the storage device identifies the hard disk, it can also identify the system disk and other external hard disks.
[0140] It can be understood that the slot on each storage device for installing the system disk is fixed, and can be a fixed one, or fixed multiple. Before executing this step, it also includes a step of obtaining the slot information of the system disk. The slot information of the slot where the system disk is located is used as a matching basis, and is matched with the slot information of each hard disk obtained in S102, so as to determine the accurate system disk and the drive letter of the system disk, and then the Linux operating system to be installed is installed in the system disk based on the obtained drive letter.
[0141] For example, suppose there are three hard disks on the storage device, namely hard disk S1, hard disk S2 and hard disk S3. The slot information corresponding to hard disk S1 is 0 and the drive letter is d1. The slot information corresponding to hard disk S2 is 1 and the drive letter is d3. The slot information corresponding to hard disk S3 is 2 and the drive letter is d2. Assuming that the slot information of the system disk is 2, then based on matching the slot information with the information of the above three hard disks, it can be obtained that the drive letter corresponding to the system disk is d2.
[0142] It can be seen that in this embodiment, considering that the slot of the storage device for installing the hard disk is fixed, the present application accurately identifies the drive letter of the system disk based on the slot information of the hard disk on the storage device, so that the operating system to be installed can be installed to the correct system disk according to the identified drive letter, thereby avoiding operating system installation errors and improving the accuracy of automatic installation of the operating system.
[0143] As an optional embodiment, the slot information is a PCIE identifier of the slot where the hard disk is located.
[0144] As an optional embodiment, the operating system installation system further includes:
[0145] The second determining module is used to determine the name of the system disk, and obtain the PCIE identifier of the system disk based on the name of the system disk.
[0146] As an optional embodiment, the operating system installation system further includes:
[0147] A third determination module is used to determine the PCIE identifier corresponding to each target slot when a plurality of target slots for installing the system disk are provided on the storage device, and select any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk;
[0148] Accordingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0149] Determine whether there is a PCIE identifier identical to the current PCIE identifier in the information of all hard disks;
[0150] If yes, determine the drive letter of the system drive based on the current PCIE identifier;
[0151] If not, the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk is repeated.
[0152] As an optional embodiment, the first acquisition module 1 is further used to acquire a kernel file;
[0153] Accordingly, the process of identifying all hard disks installed on the storage device includes:
[0154] Load the kernel file to recognize all hard disks installed on the storage device.
[0155] As an optional embodiment, the first acquisition module 1 is further used to acquire an image file;
[0156] The operating system installation system also includes:
[0157] The third acquisition module is used to decompress the image file to obtain the identification module and the configuration module;
[0158] Accordingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes:
[0159] Determine the drive letter of the system disk based on the slot information of the system disk through the identification module;
[0160] Accordingly, the process of installing the operating system to be installed into the system disk according to the drive letter of the system disk includes:
[0161] Use the configuration module to install the operating system to the system disk according to the drive letter of the system disk.
[0162] As an optional embodiment, the operating system installation system further includes:
[0163] A connection module, used to establish a connection between the storage device and the PXE server using a boot program;
[0164] The first acquisition module 1 is also used to acquire the installation boot file after the storage device and the PXE server are successfully connected, where the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file;
[0165] The process of obtaining the operating system to be installed includes:
[0166] Obtaining the operating system to be installed from the PXE server based on the first address;
[0167] and / or,
[0168] The process of obtaining the kernel file includes:
[0169] Obtaining a kernel file from the PXE server based on the second address;
[0170] and / or,
[0171] The process of obtaining the image file includes:
[0172] The image file is obtained from the PXE server based on the third address.
[0173] As an optional embodiment, the operating system to be installed is a Linux operating system.
[0174] As an optional embodiment, the operating system installation system further includes:
[0175] A judgment module, used to judge whether the system disk meets the installation conditions;
[0176] The process of installing the operating system to be installed to the system disk according to the drive letter of the system disk includes:
[0177] When the system disk meets the installation conditions, install the operating system to be installed to the system disk according to the drive letter of the system disk.
[0178] As an optional embodiment, the process of determining whether the system disk meets the installation condition includes:
[0179] Determine whether the system disk is the current installation medium of the storage device;
[0180] If yes, determine the path of the system disk and judge whether the disk size of the system disk meets the preset value;
[0181] If so, it is determined that the system disk meets the installation conditions.
[0182] As an optional embodiment, the process of determining whether the system disk is the current installation medium of the storage device includes:
[0183] Determine whether the storage device is externally connected to the target storage medium;
[0184] If not, it is determined that the system disk is the current installation medium of the storage device.
[0185] As an optional embodiment, before determining the path of the system disk, the operating system installation system further includes:
[0186] Configuration module, used to mount the system disk to the preset directory.
[0187] On the other hand, the present application also provides an electronic device, including:
[0188] Memory for storing computer programs;
[0189] A processor is used to implement the steps of the operating system installation method described in any one of the above embodiments when executing a computer program.
[0190] Specifically, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. When the processor executes the computer program stored in the memory, the following steps can be implemented: obtaining the operating system to be installed; identifying all hard disks installed on the storage device, and obtaining information of each hard disk, the information including the slot information and drive letter of the hard disk, and all hard disks include the system disk; determining the drive letter of the system disk based on the slot information of the system disk; installing the operating system to be installed into the system disk according to the drive letter of the system disk.
[0191] It can be seen that in this embodiment, considering that the slot of the storage device for installing the hard disk is fixed, the present application accurately identifies the drive letter of the system disk based on the slot information of the hard disk on the storage device, so that the operating system to be installed can be installed to the correct system disk according to the identified drive letter, thereby avoiding operating system installation errors and improving the accuracy of automatic installation of the operating system.
[0192] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: obtaining information of each hard disk, the information including the slot information and drive letter of the hard disk; the slot information is the PCIE identifier of the slot where the hard disk is located.
[0193] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: determining the name of the system disk; and obtaining the PCIE identifier of the system disk based on the name of the system disk.
[0194] As an optional embodiment, when the processor executes a computer subroutine stored in a memory, the following steps can be implemented: when a storage device is provided with multiple target slots for installing a system disk, determining a PCIE identifier corresponding to each target slot; selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk; determining whether there is a PCIE identifier identical to the current PCIE identifier in the information of all hard disks; if so, determining the drive letter of the system disk based on the current PCIE identifier; if not, repeating the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk.
[0195] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: obtaining a kernel file; accordingly, the process of identifying all hard disks installed on the storage device includes: loading the kernel file to identify all hard disks installed on the storage device.
[0196] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: obtaining an image file; decompressing the image file to obtain an identification module and a configuration module; determining the drive letter of the system disk based on the slot information of the system disk through the identification module; and installing the operating system to be installed into the system disk according to the drive letter of the system disk through the configuration module.
[0197] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: using the boot program to establish a connection between the storage device and the PXE server; when the storage device and the PXE server are successfully connected, obtaining the installation boot file, the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file; obtaining the operating system to be installed from the PXE server based on the first address; and / or, obtaining the kernel file from the PXE server based on the second address; and / or, obtaining the image file from the PXE server based on the third address.
[0198] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: obtaining the operating system to be installed; the operating system to be installed is the Linux operating system.
[0199] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: determining whether the system disk meets the installation conditions; when the system disk meets the installation conditions, installing the operating system to be installed to the system disk according to the drive letter of the system disk.
[0200] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: determine whether the system disk is the current installation medium of the storage device; if so, determine the path of the system disk and determine whether the disk size of the system disk meets the preset value; if so, determine that the system disk meets the installation conditions.
[0201] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: determining whether the storage device is externally connected to the target storage medium; if not, determining that the system disk is the current installation medium of the storage device.
[0202] As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: mounting the system disk to a preset directory.
[0203] Based on the above embodiment, as a preferred implementation manner, the electronic device further includes:
[0204] The input interface is connected to the processor and is used to obtain externally imported computer programs, parameters and instructions, and save them to the memory under the control of the processor. The input interface can be connected to an input device to receive parameters or instructions manually input by the user. The input device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the terminal housing.
[0205] The display unit is connected to the processor and is used to display the data sent by the processor. The display unit can be a liquid crystal display or an electronic ink display.
[0206] The network port is connected to the processor and is used to communicate with external terminal devices. The communication technology used for the communication connection can be a wired communication technology or a wireless communication technology, such as mobile high-definition link technology (MHL), universal serial bus (USB), high-definition multimedia interface (HDMI), wireless fidelity technology (WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, communication technology based on IEEE802.11s, etc.
[0207] On the other hand, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the operating system installation method described in any of the above embodiments are implemented.
[0208] Specifically, the computer-readable storage medium may include: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes. The storage medium stores a computer program, and when the computer program is executed by the processor, the following steps are implemented: obtaining the operating system to be installed; identifying all hard disks installed on the storage device, and obtaining information of each hard disk, including the slot information and drive letter of the hard disk, and all hard disks include the system disk; determining the drive letter of the system disk based on the slot information of the system disk; installing the operating system to be installed into the system disk according to the drive letter of the system disk.
[0209] It can be seen that in this embodiment, considering that the slot of the storage device for installing the hard disk is fixed, the present application accurately identifies the drive letter of the system disk based on the slot information of the hard disk on the storage device, so that the operating system to be installed can be installed to the correct system disk according to the identified drive letter, thereby avoiding operating system installation errors and improving the accuracy of automatic installation of the operating system.
[0210] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: obtaining information of each hard disk, the information including the slot information and drive letter of the hard disk; the slot information is the PCIE identifier of the slot where the hard disk is located.
[0211] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: determining the name of the system disk; and obtaining the PCIE identifier of the system disk based on the name of the system disk.
[0212] As an optional embodiment, when a computer subroutine stored in a computer-readable storage medium is executed by a processor, the following steps can be specifically implemented: when a storage device is provided with multiple target slots for installing a system disk, determining a PCIE identifier corresponding to each target slot; selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk; determining whether there is a PCIE identifier identical to the current PCIE identifier in the information of all hard disks; if so, determining the drive letter of the system disk based on the current PCIE identifier; if not, repeating the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all target slots as the current PCIE identifier of the system disk.
[0213] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: obtaining a kernel file; accordingly, the process of identifying all hard disks installed on the storage device includes: loading the kernel file to identify all hard disks installed on the storage device.
[0214] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: obtaining an image file; decompressing the image file to obtain an identification module and a configuration module; determining the drive letter of the system disk based on the slot information of the system disk through the identification module; and installing the operating system to be installed into the system disk according to the drive letter of the system disk through the configuration module.
[0215] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: using the startup boot program to establish a connection between the storage device and the PXE server; when the storage device and the PXE server are successfully connected, obtaining the installation boot file, the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file; obtaining the operating system to be installed from the PXE server based on the first address; and / or, obtaining the kernel file from the PXE server based on the second address; and / or, obtaining the image file from the PXE server based on the third address.
[0216] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: obtaining the operating system to be installed; the operating system to be installed is the Linux operating system.
[0217] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: determine whether the system disk meets the installation conditions; when the system disk meets the installation conditions, install the operating system to be installed to the system disk according to the drive letter of the system disk.
[0218] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: determine whether the system disk is the current installation medium of the storage device; if so, determine the path of the system disk and determine whether the disk size of the system disk meets the preset value; if so, determine that the system disk meets the installation conditions.
[0219] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: determining whether the storage device is externally connected to the target storage medium; if not, determining that the system disk is the current installation medium of the storage device.
[0220] As an optional embodiment, when the computer subroutine stored in the computer-readable storage medium is executed by the processor, the following steps can be specifically implemented: mounting the system disk to a preset directory.
[0221] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0222] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for installing an operating system, characterized in that: The operating system installation method includes: Get the operating system to be installed; Identify all hard disks installed on the storage device, and obtain information about each hard disk, the information including the slot information and drive letter of the hard disk, and all the hard disks include the system disk; Determine the drive letter of the system disk based on the slot information of the system disk; Install the operating system to be installed into the system disk according to the drive letter of the system disk; The operating system installation method further includes: When the storage device is provided with a plurality of target slots for installing the system disk, determining a PCIE identifier corresponding to each of the target slots; Selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk; Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes: Determine whether there is a PCIE identifier identical to the current PCIE identifier in the information of all the hard disks; If yes, determine the drive letter of the system disk based on the current PCIE identifier; If not, repeat the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk; Before identifying all hard disks installed on the storage device, the operating system installation method further includes: Get the kernel file; Accordingly, the process of identifying all hard disks installed on the storage device includes: Loading the kernel file to identify all hard disks installed on the storage device; Get the image file; Decompress the image file to obtain an identification module and a configuration module; Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes: Determining the drive letter of the system disk based on the slot information of the system disk by the identification module; Correspondingly, the process of installing the operating system to be installed into the system disk according to the drive letter of the system disk includes: Installing the operating system to be installed into the system disk according to the drive letter of the system disk by the configuration module; Establishing a connection between the storage device and the PXE server using a boot program; When the storage device and the PXE server are successfully connected, an installation boot file is obtained, wherein the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file; The process of obtaining the operating system to be installed includes: Obtaining the operating system to be installed from the PXE server based on the first address; and / or, The process of obtaining the kernel file includes: Obtaining the kernel file from the PXE server based on the second address; and / or, The process of obtaining the image file includes: The image file is obtained from the PXE server based on the third address.
2. The operating system installation method according to claim 1, characterized in that: The slot information is the PCIE identifier of the slot where the hard disk is located.
3. The operating system installation method according to claim 2, characterized in that: The operating system installation method further includes: Determine the name of the system disk; A PCIE identifier of the system disk is obtained based on the name of the system disk.
4. The operating system installation method according to claim 1, characterized in that: The operating system to be installed is the Linux operating system.
5. The operating system installation method according to any one of claims 1 to 4, characterized in that: The operating system installation method further includes: Determining whether the system disk meets the installation conditions; The process of installing the operating system to be installed to the system disk according to the drive letter of the system disk comprises: When the system disk meets the installation condition, the operating system to be installed is installed to the system disk according to the drive letter of the system disk.
6. The operating system installation method according to claim 5, characterized in that: The process of determining whether the system disk meets the installation conditions includes: Determining whether the system disk is the current installation medium of the storage device; If so, determine the path of the system disk and judge whether the disk size of the system disk meets the preset value; If so, it is determined that the system disk meets the installation condition.
7. The operating system installation method according to claim 6, characterized in that: The process of determining whether the system disk is the current installation medium of the storage device includes: Determining whether the storage device is externally connected to a target storage medium; If not, it is determined that the system disk is the current installation medium of the storage device.
8. The operating system installation method according to claim 6, characterized in that: Before determining the path of the system disk, the operating system installation method further includes: Mount the system disk to a preset directory.
9. An operating system installation system, characterized in that: include: A first acquisition module, used to acquire the operating system to be installed; A second acquisition module is used to identify all hard disks installed on the storage device and obtain information of each hard disk, wherein the information includes slot information and drive letter of the hard disk, and all the hard disks include a system disk; A first determining module, configured to determine a drive letter of the system disk based on the slot information of the system disk; An installation module, used for installing the operating system to be installed into the system disk according to the drive letter of the system disk; The operating system installation system is also used to: When the storage device is provided with a plurality of target slots for installing the system disk, determining a PCIE identifier corresponding to each of the target slots; Selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk; Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes: Determine whether there is a PCIE identifier identical to the current PCIE identifier in the information of all the hard disks; If yes, determine the drive letter of the system disk based on the current PCIE identifier; If not, repeat the operation of selecting any unselected PCIE identifier from the PCIE identifiers corresponding to all the target slots as the current PCIE identifier of the system disk; Before identifying all hard disks installed on the storage device, the operating system installation system is further used to: Get the kernel file; Accordingly, the process of identifying all hard disks installed on the storage device includes: Loading the kernel file to identify all hard disks installed on the storage device; Get the image file; Decompress the image file to obtain an identification module and a configuration module; Correspondingly, the process of determining the drive letter of the system disk based on the slot information of the system disk includes: Determining the drive letter of the system disk based on the slot information of the system disk by the identification module; Correspondingly, the process of installing the operating system to be installed into the system disk according to the drive letter of the system disk includes: Installing the operating system to be installed into the system disk according to the drive letter of the system disk by the configuration module; Establishing a connection between the storage device and the PXE server using a boot program; When the storage device and the PXE server are successfully connected, an installation boot file is obtained, wherein the installation boot file includes a first address corresponding to the operating system to be installed, a second address corresponding to the kernel file, and a third address corresponding to the image file; The process of obtaining the operating system to be installed includes: Obtaining the operating system to be installed from the PXE server based on the first address; and / or, The process of obtaining the kernel file includes: Obtaining the kernel file from the PXE server based on the second address; and / or, The process of obtaining the image file includes: The image file is obtained from the PXE server based on the third address.
10. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the operating system installation method as described in any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the operating system installation method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Installation method and device for operating system
CN108459823A
PXE server deployment method and device and medium
CN114816454A
Operation system installation method, computing device and storage medium
CN114860272A
Installation of operating system
US20200272445A1
Linux system reset processing method and device, and computer storage medium
WO2017148271A1