Method and device for installing server operating system, terminal equipment and medium
By downloading and loading the operating system kernel and system files from the server, automatically detecting and restarting the server, it solves the problem of low installation efficiency of multi-version operating systems on servers, and achieves an efficient and automated installation process, suitable for large-scale deployment.
Patent Information
- Application Number
- CN202410638305.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-30
AI Technical Summary
In enterprises, there are many servers and many operating system versions, which leads to low installation efficiency and long time consumption.
By downloading the kernel of the target operating system from the server, loading it into the memory and executing the pre-configured installation script, obtaining the system files from the server, detecting the target server hardware, restarting after meeting the preset conditions, using the system files and boot Load the program into the target operating system.
It realizes the automated installation of the operating system, improves the installation efficiency, shortens the installation time, and improves the automation of the installation process. It is suitable for large-scale deployment scenarios, manages concurrent installation requests, ensures reasonable allocation of server resources, and avoids installation bottlenecks.
Smart Images

Figure CN118567664A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of operating systems, and in particular to a method, apparatus, terminal equipment, and computer-readable storage medium for installing a server operating system. Background Art
[0002] Some businesses have significant data processing and transmission requirements during their operations, often requiring a large number of servers to support their business needs. With a large number of servers, they may be installed with different operating system versions, such as CentOS, Kylin, and Longxi. Currently, businesses primarily install these operating systems manually, resulting in low installation efficiency and time-consuming installation processes. Summary of the Invention
[0003] The present invention provides a method, apparatus, terminal device and computer-readable storage medium for installing a server operating system, so as to solve the technical problem of how to improve installation efficiency and shorten installation time.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides a method for installing a server operating system, which is applied to a target server. The installation method includes:
[0005] Downloading the kernel of the target operating system from the server; the kernel includes a boot loader;
[0006] Start the kernel, load the kernel into memory and execute a pre-configured installation script;
[0007] Obtaining system files of the target operating system from the server; and detecting the hardware of the target server;
[0008] When the hardware of the target server meets the preset installation conditions, the target server is restarted; and the target operating system is entered through the system file and the boot loader.
[0009] As a preferred solution, the detecting of the hardware of the target server includes:
[0010] The central processing unit, memory, disk and network adapter of the target server are detected to determine whether the installation conditions are met.
[0011] As a preferred solution, the server includes an automatic installation server; and obtaining the system files of the target operating system from the server includes:
[0012] A copy request is sent to the automatic installation server, so that the automatic installation server responds to the copy request and copies the system files of the target operating system to the target server.
[0013] As a preferred solution, before starting the kernel, the method further includes:
[0014] The kernel is loaded into a memory bar, and a memory disk image is initialized; the memory disk image is used to store the system files.
[0015] As a preferred solution, before downloading the kernel of the target operating system from the server, the method further includes:
[0016] Detecting the network status of the target server;
[0017] When the network status of the target server meets the requirements, an installation boot program is obtained from the network, and the installation boot program is loaded into the memory, and the startup mode of the target server is set to network card startup.
[0018] As a preferred solution, before downloading the kernel of the target operating system from the server, the method further includes:
[0019] Sending an address allocation request to the server, so that the server responds to the address allocation request and allocates a temporary IP address to the target server;
[0020] Binding the temporary IP address and MAC address; wherein the MAC address is pre-stored on the target server;
[0021] Download the pre-boot execution environment bootloader;
[0022] In response to a user's selection instruction, the target operating system is determined according to the selection instruction.
[0023] As a preferred solution, the target server and the service end are connected to a switch at the same access layer.
[0024] Accordingly, an embodiment of the present invention further provides a server operating system installation device, which is applied to a target server. The installation device includes a download module, a loading module, a detection module, and an installation module; wherein,
[0025] The download module is used to download the kernel of the target operating system from the server; the kernel includes a boot loader;
[0026] The loading module is used to start the kernel, load the kernel into the memory and execute a pre-configured installation script;
[0027] The detection module is used to obtain the system files of the target operating system from the server; and detect the hardware of the target server;
[0028] The installation module is used to restart the target server when the hardware of the target server meets the preset installation conditions; and enter the target operating system through the system file and the boot loader.
[0029] As a preferred solution, the detection module detects the hardware of the target server, including:
[0030] The detection module detects the central processing unit, memory, disk and network adapter of the target server to determine whether the installation conditions are met.
[0031] As a preferred solution, the server includes an automatic installation server; the detection module obtains the system files of the target operating system from the server, including:
[0032] The detection module sends a copy request to the automatic installation server, so that the automatic installation server responds to the copy request and copies the system files of the target operating system to the target server.
[0033] As a preferred solution, before the loading module starts the kernel, the installation device further includes an initialization module, and the initialization module is used to:
[0034] The kernel is loaded into a memory bar, and a memory disk image is initialized; the memory disk image is used to store the system files.
[0035] As a preferred solution, before the download module downloads the kernel of the target operating system from the server, the installation device further includes a setting module, which is used to:
[0036] Detecting the network status of the target server;
[0037] When the network status of the target server meets the requirements, an installation boot program is obtained from the network, and the installation boot program is loaded into the memory, and the startup mode of the target server is set to network card startup.
[0038] As a preferred solution, before the download module downloads the kernel of the target operating system from the server, the installation device further includes a determination module, the determination module being configured to:
[0039] Sending an address allocation request to the server, so that the server responds to the address allocation request and allocates a temporary IP address to the target server;
[0040] Binding the temporary IP address and MAC address; wherein the MAC address is pre-stored on the target server;
[0041] Download the pre-boot execution environment bootloader;
[0042] In response to a user's selection instruction, the target operating system is determined according to the selection instruction.
[0043] As a preferred solution, the target server and the service end are connected to a switch at the same access layer.
[0044] Correspondingly, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the server operating system installation method when executing the computer program.
[0045] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the server operating system installation method.
[0046] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0047] An embodiment of the present invention provides a method, apparatus, terminal device, and computer-readable storage medium for installing a server operating system. The installation method includes: downloading a kernel of a target operating system from a server; the kernel includes a boot loader; starting the kernel, loading the kernel into memory, and executing a pre-configured installation script; obtaining system files of the target operating system from the server; detecting the hardware of the target server; restarting the target server when the hardware of the target server meets preset installation conditions; and entering the target operating system through the system files and the boot loader. Implementing the present invention can achieve relatively automatic installation of the operating system by downloading the kernel of the target operating system and loading it into memory, booting the kernel, and executing the installation script. Compared with existing manual installation methods, this method can effectively improve installation efficiency, shorten installation time, and increase the degree of automation of the installation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 : A flow chart of an embodiment of a method for installing a server operating system provided by the present invention.
[0049] Figure 2 : A structural diagram of an embodiment of the installation device of the server operating system provided by the present invention. DETAILED DESCRIPTION
[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0051] Embodiment one:
[0052] Please refer to Figure 1 , Figure 1 The present invention provides a method for installing a server operating system, which is applied to a target server (or client), and includes steps S1 to S4; wherein,
[0053] Step S1, downloading the kernel of the target operating system from the server; the kernel includes a boot loader.
[0054] Step S2: start the kernel, load the kernel into the memory and execute a pre-configured installation script.
[0055] Step S3: Obtain the system files of the target operating system from the server; and detect the hardware of the target server.
[0056] Step S4: When the hardware of the target server meets the preset installation conditions, restart the target server; and enter the target operating system through the system file and the boot loader.
[0057] In this embodiment, the target server and the server are connected to a switch at the same access layer. This ensures normal communication between the server and the target server while preventing the startup of servers in other network segments from impacting the installation process. After startup, the target server enters the BIOS or UEFI. The target server refers to the server on which the operating system needs to be installed. During the installation process, the server and target server provide different operating system versions.
[0058] As a preferred implementation, the target server can be set to PXE Boot (network card boot), that is, booted via PXE boot mode, obtaining a boot program and an operating system image from the network, rather than booting from a local disk.
[0059] Before step S1, the method further includes: detecting the network status of the target server; if the network connection status is normal, that is, if the network status of the target server meets the requirements, obtaining an installation boot program from the network, loading the installation boot program into memory, and setting the target server startup mode to network card startup. The installation boot program is a small binary file that is responsible for loading and running subsequent installation programs.
[0060] As a further preferred embodiment, after the target server is started, before step S1, the method further includes:
[0061] An address allocation request is sent to the server, so that the server responds to the address allocation request and allocates a temporary IP address to the target server through the DHCP service; an ARP table is updated and the temporary IP address and MAC address are bound; wherein the MAC address is pre-stored on the target server; a pre-boot execution environment boot program is downloaded; and a user selection instruction is responded to and the target operating system is determined according to the selection instruction.
[0062] For example, the user can select the target operating system to be installed and the corresponding version of the system in the batch installation operating system selection interface.
[0063] Generally, users only need to enable PXE Boot, select the operating system to be installed, and then wait for the subsequent automated installation to complete. Implementation of the embodiments of the present application greatly simplifies the installation process, reduces the number of operations requiring user intervention, and improves the automation level of the installation process.
[0064] Furthermore, in step S1, the PXE boot loader of the target server downloads the corresponding operating system kernel from the server. The kernel can be a Linux kernel, and the kernel is a pre-configured file that includes all necessary components of the kernel, such as kernel modules and boot loader.
[0065] Before starting the kernel in step S2, the kernel is loaded into a RAM (also known as random access memory) and a RAM disk image (also known as a RAM disk image) is initialized. The RAM disk image is a temporary disk image used to store the system files and data. The size of the RAM disk image depends on the configuration of the installation program or the requirements of the installation process, but is generally smaller than a physical disk.
[0066] In this embodiment, starting the kernel includes: parsing command line parameters, which generally include startup parameters and boot options; setting kernel variables, which control the behavior and function of the kernel; initializing various components of the target server, which include processors, memory, and I / O components.
[0067] Furthermore, the preset installation script may be an automatic installation script of the operating system for automated installation.
[0068] Further, for step S3, the server includes an automatic installation server; obtaining the system files of the target operating system from the server includes: sending a copy request to the automatic installation server, so that the automatic installation server responds to the copy request and copies the system files of the target operating system to the target server.
[0069] The target server's CPU, memory, disk, and network adapter are then tested to determine whether they meet the installation requirements. If the hardware meets the installation requirements, basic installation settings, such as network settings, time zone settings, and language settings, can be completed before restarting the target server.
[0070] For example, the installer can perform network settings based on the user's configuration, including setting the IP address, subnet mask, and default gateway. The installer can also perform time zone settings based on the user's configuration, primarily involving setting the system clock and date. The installer can also perform language settings based on the user's configuration, primarily setting the system language and character set.
[0071] In step S4, the installation program may power off the target server to restart it, and then use the system files and the boot loader to enter the new operating system, i.e., the target operating system. The installation program then boots to a login interface where the user can enter a username and password, and the target server responds to the input information to log in to the newly installed operating system.
[0072] Accordingly, refer to Figure 2 The embodiment of the present invention further provides a server operating system installation device, which is applied to a target server. The installation device includes a download module 101, a loading module 102, a detection module 103 and an installation module 104; wherein,
[0073] The download module 101 is used to download the kernel of the target operating system from the server; the kernel includes a boot loader;
[0074] The loading module 102 is used to start the kernel, load the kernel into the memory and execute a pre-configured installation script;
[0075] The detection module 103 is used to obtain the system files of the target operating system from the server and detect the hardware of the target server;
[0076] The installation module 104 is configured to restart the target server when the hardware of the target server meets a preset installation condition; and enter the target operating system through the system file and the boot loader.
[0077] As a preferred solution, the detection module 103 detects the hardware of the target server, including:
[0078] The detection module 103 detects the CPU, memory, disk, and network adapter of the target server to determine whether the installation conditions are met.
[0079] As a preferred solution, the server includes an automatic installation server; the detection module 103 obtains the system files of the target operating system from the server, including:
[0080] The detection module 103 sends a copy request to the automatic installation server, so that the automatic installation server responds to the copy request and copies the system files of the target operating system to the target server.
[0081] As a preferred solution, before the loading module 102 starts the kernel, the installation device further includes an initialization module, which is used to:
[0082] The kernel is loaded into a memory bar, and a memory disk image is initialized; the memory disk image is used to store the system files.
[0083] As a preferred solution, before the download module 101 downloads the kernel of the target operating system from the server, the installation device further includes a setting module, which is used to:
[0084] Detecting the network status of the target server;
[0085] When the network status of the target server meets the requirements, an installation boot program is obtained from the network, and the installation boot program is loaded into the memory, and the startup mode of the target server is set to network card startup.
[0086] As a preferred solution, before the download module 101 downloads the kernel of the target operating system from the server, the installation device further includes a determination module, which is configured to:
[0087] Sending an address allocation request to the server, so that the server responds to the address allocation request and allocates a temporary IP address to the target server;
[0088] Binding the temporary IP address and MAC address; wherein the MAC address is pre-stored on the target server;
[0089] Download the pre-boot execution environment bootloader;
[0090] In response to a user's selection instruction, the target operating system is determined according to the selection instruction.
[0091] As a preferred solution, the target server and the service end are connected to a switch at the same access layer.
[0092] Correspondingly, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the server operating system installation method when executing the computer program.
[0093] The processor may be a central processing unit (CPU), other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal, and connects various parts of the entire terminal using various interfaces and lines.
[0094] The memory can be used to store the computer program, and the processor realizes various functions of the terminal by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Medi aCard, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0095] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the server operating system installation method.
[0096] Wherein, if the module integrated in the installation device of the server operating system is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0097] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0098] An embodiment of the present invention provides a method, apparatus, terminal device and computer-readable storage medium for installing a server operating system. The installation method includes: downloading the kernel of a target operating system from a server; the kernel includes a boot loader; starting the kernel, loading the kernel into memory and executing a pre-configured installation script; obtaining system files of the target operating system from the server; detecting the hardware of the target server; restarting the target server when the hardware of the target server meets preset installation conditions; and entering the target operating system through the system files and the boot loader. The present invention is implemented to achieve relatively automatic installation of the operating system by downloading the kernel of the target operating system and loading it into the memory, and through kernel booting and execution of the installation script. Compared with the existing manual installation method, it can effectively improve installation efficiency, shorten installation time, and improve the degree of automation of the installation process. In addition, the technical solution of this embodiment is suitable for large-scale deployment scenarios, can effectively manage concurrent installation requests, ensure the reasonable allocation of server resources, avoid installation bottlenecks, and improve the overall deployment speed and success rate. Furthermore, an automated configuration method is provided, including dynamic configuration of DHCP, TFTP, DNS, HTTP / FTP and other services to support PXE network boot, and automatically associate ISO images or operating system startup configuration files of different operating system versions; at the same time, it can flexibly manage the installation sources of different versions of operating systems and the corresponding operating system startup configuration templates to ensure that the system can select and install the correct operating system version according to the requirements of the target device.
[0099] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for installing a server operating system, characterized in that: Applied to the target server, the installation method includes: Downloading a kernel of a target operating system from a server; the kernel including a boot loader; Start the kernel, load the kernel into memory and execute a pre-configured installation script; Obtaining system files of the target operating system from the server; and detecting the hardware of the target server; When the hardware of the target server meets the preset installation conditions, the target server is restarted; and the target operating system is entered through the system file and the boot loader.
2. A method for installing a server operating system according to claim 1, characterized in that: The detecting of the hardware of the target server includes: The central processing unit, memory, disk and network adapter of the target server are detected to determine whether the installation conditions are met.
3. A method for installing a server operating system according to claim 1, characterized in that: The server end includes an automatic installation server; the step of obtaining the system file of the target operating system from the server end includes: A copy request is sent to the automatic installation server, so that the automatic installation server responds to the copy request and copies the system files of the target operating system to the target server.
4. A method for installing a server operating system according to claim 1, characterized in that: Before starting the kernel, the method further includes: The kernel is loaded into a memory bar, and a memory disk image is initialized; the memory disk image is used to store the system files.
5. A method for installing a server operating system according to claim 1, characterized in that: Before downloading the kernel of the target operating system from the server, the method further includes: Detecting the network status of the target server; When the network status of the target server meets the requirements, an installation boot program is obtained from the network, and the installation boot program is loaded into the memory, and the startup mode of the target server is set to network card startup.
6. A method for installing a server operating system according to claim 1, characterized in that: Before downloading the kernel of the target operating system from the server, the method further includes: Sending an address allocation request to the server, so that the server responds to the address allocation request and allocates a temporary IP address to the target server; Binding the temporary IP address and MAC address; wherein the MAC address is pre-stored on the target server; Download the pre-boot execution environment bootloader; In response to a selection instruction from a user, the target operating system is determined according to the selection instruction.
7. A method for installing a server operating system according to any one of claims 1 to 6, characterized in that: The target server and the service end are connected to a switch at the same access layer.
8. A device for installing a server operating system, characterized in that: Applied to the target server, the installation device includes a download module, a loading module, a detection module and an installation module; wherein, The download module is used to download the kernel of the target operating system from the server; the kernel includes a boot loader; The loading module is used to start the kernel, load the kernel into the memory and execute a pre-configured installation script; The detection module is used to obtain the system files of the target operating system from the server end; and detect the hardware of the target server; The installation module is used to restart the target server when the hardware of the target server meets the preset installation conditions; and enter the target operating system through the system file and the boot loader.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for installing the server operating system according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the server operating system installation method according to any one of claims 1 to 7.
Citation Information
Cited By
Memory operating system generation method and device, equipment, medium and program product
CN119225854A
