System cloning method, device, electronic device and computer-readable storage medium

By requesting the mirror server and using clone files to create EFI system partitions and GPT partitions, the problem of inconvenient installation of UEFI boot operating systems is solved, and the efficiency of automated cloning and installation of UEFI boot operating systems is improved.

CN112527328BActive Publication Date: 2024-10-15DAWNING INFORMATION IND (BEIJING) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011419768.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2024-10-15
Estimated Expiration
2040-12-03

AI Technical Summary

Technical Problem

The existing Systemimager does not support UEFI booted operating system cloning, which makes the installation of UEFI booted operating system inconvenient and requires manual installation.

Method used

By sending an IP address allocation request to the mirror server, obtain clone files, including boot programs, system configuration files and installation scripts, use these files to create EFI system partitions and GPT partitions, and write relevant information into the operating system startup boot configuration file. Automated cloning of UEFI boot operating systems.

Benefits of technology

The automatic cloning of the UEFI boot operating system is realized, the installation efficiency and accuracy are improved, and the problem of the inability to automatically clone the UEFI boot operating system in the existing technology is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112527328B_ABST
    Figure CN112527328B_ABST
Patent Text Reader

Abstract

The present application provides a system cloning method, device, electronic device and computer-readable storage medium, wherein the method includes: sending an IP address allocation request to a dynamic host configuration protocol service of a mirror server to obtain an IP address allocated by the dynamic host configuration protocol service; obtaining a clone file from the mirror server, the clone file including: a boot program, a system configuration file and an installation script; executing the system configuration file based on the boot program through the installation script to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition; obtaining an image file from the mirror server and installing the image file, the image file including system data to be cloned; writing the relevant information of the extensible firmware interface system partition into the operating system startup boot configuration file. The method in the embodiment of the present application can solve the cloning problem of the UEFI boot operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a system cloning method, device, electronic device and computer-readable storage medium. Background Art

[0002] Systemimager is a software that can realize automatic operating system installation. Through this Systemimager, the operating system on the sample machine can be cloned to the target machine where the operating system needs to be installed. However, the current Systemimager does not support the operating system booted by UEFI (Unified Extensible Firmware Interface, Chinese name: Unified Extensible Firmware Interface), so that the computer that needs to install the operating system booted by UEFI can only be installed manually by relevant personnel, which makes the installation of the operating system booted by UEFI inconvenient. Summary of the invention

[0003] The purpose of the present application is to provide a system cloning method, method, device, device, electronic device and computer-readable storage medium, which can solve the cloning problem of UEFI boot operating system.

[0004] In a first aspect, an embodiment of the present invention provides a system cloning method, comprising:

[0005] Sending an IP address allocation request to the dynamic host configuration protocol service of the mirror server to obtain an IP address allocated by the dynamic host configuration protocol service;

[0006] Acquire a clone file from the mirror server, wherein the clone file includes: a boot program, a system configuration file, and an installation script;

[0007] The system configuration file is executed based on the boot program through the installation script to create an EFI (Extensible Firmware Interface) system partition and a GPT (GUID Partition Table) partition;

[0008] Obtaining an image file from the image server and installing the image file, wherein the image file includes system data to be cloned;

[0009] The relevant information of the EFI system partition is written into the operating system startup boot configuration file.

[0010] In an optional implementation, the boot program includes a GPT partition driver and an EFI system partition driver, and the system configuration file includes a GPT partition configuration item and an EFI system partition configuration item; the installation script is used to execute the system configuration file based on the boot program to create an EFI system partition and a GPT partition, including:

[0011] By means of the installation script, the EFI system partition configuration item in the system configuration file is executed according to the EFI system partition driver in the boot program to perform EFI system partitioning;

[0012] Through the installation script, the GPT partition configuration items in the system configuration file are executed according to the GPT partition driver in the boot program to perform GPT partitioning.

[0013] In the above implementation, by adding GPT partition configuration items and EFI system partition configuration items in the system configuration file, GPT partition and EFI system partition can be realized in the system configuration stage, and by setting the GPT partition driver and EFI system partition driver in the boot program, the GPT partition configuration items and EFI system partition configuration items in the system configuration file can be driven to be executed, thereby creating GPT partition and EFI system partition, thereby realizing automated GPT partition and EFI system partition, and automated cloning of the UEFI-booted operating system.

[0014] In an optional implementation manner, writing the relevant information of the EFI system partition into an operating system startup boot configuration file includes:

[0015] According to the current system partition status, determine whether there is an EFI system partition;

[0016] If an EFI system partition exists, the relevant information of the EFI system partition is written into the operating system startup boot configuration file.

[0017] In the above implementation, by cloning the UEFI-booted operating system, when writing information to the operating system startup boot configuration file, a judgment can be made based on the current partition, thereby improving the accuracy of partition information writing, thereby also improving the effectiveness of cloning the UEFI-booted operating system.

[0018] In an optional implementation manner, writing the relevant information of the EFI system partition into an operating system startup boot configuration file includes:

[0019] Loading the EFI system partition address into the boot sector to obtain EFI system partition boot information;

[0020] The EFI system partition boot information is written into the operating system startup boot configuration file.

[0021] In an optional implementation manner, writing the relevant information of the EFI system partition into an operating system startup boot configuration file includes:

[0022] Sending a network configuration script acquisition request to the network service of the mirror server to obtain a network configuration script;

[0023] According to the network configuration script, the relevant information of the EFI system partition is written into the operating system startup boot configuration file.

[0024] In the above implementation, the network configuration script is obtained from the mirror server, thereby cloning the system guided by the mirror server, thereby realizing the cloning of the operating system guided by the computer in a fully automatic UEFI manner.

[0025] In an optional implementation manner, the obtaining the clone file from the mirror server includes:

[0026] Sending a boot program acquisition request to the simple file transfer protocol service of the mirror server to obtain a boot program;

[0027] Sending a system configuration file acquisition request to the simple file transfer protocol service of the mirror server to obtain the system configuration file;

[0028] Obtain the installation script from the mirror server.

[0029] In the above implementation, various clone files are provided to the target machine through the simple file transfer protocol service of the mirror server, which enables the various services in the mirror server to cooperate with each other and make the system cloning more orderly.

[0030] In an optional embodiment, the method further comprises:

[0031] Based on the boot program, during the execution of the system configuration file, when the kernel configuration item and the file system configuration item are executed, a kernel file and a file system file acquisition request are sent to the simple file transfer protocol service;

[0032] After obtaining the kernel file and the file system file, the kernel and the file system are started in the memory.

[0033] In the above implementation, by enabling the computer's kernel and file system to be started during the execution of the system configuration file, the manual startup operation is omitted, thereby improving the efficiency of cloning the UEFI-guided operating system.

[0034] In a second aspect, an embodiment of the present invention provides a system cloning method, comprising:

[0035] Start the Dynamic Host Configuration Protocol service through the system cloning software;

[0036] Receiving an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocating an IP address to the target machine;

[0037] Sending a clone file to the target machine, the clone file including: a boot program, a system configuration file and an installation script, the installation script being used for the target machine to execute the system configuration file based on the boot program through the installation script to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition;

[0038] An image file is sent to the target machine, wherein the image file includes system data to be cloned and is used for installation by the target machine.

[0039] In a third aspect, an embodiment of the present invention provides a system cloning device, including:

[0040] A first request module, used to send an IP address allocation request to the dynamic host configuration protocol service of the mirror server to obtain an IP address allocated by the dynamic host configuration protocol service;

[0041] An acquisition module, used to acquire a clone file from the image server, wherein the clone file includes: a boot program, a system configuration file, and an installation script;

[0042] A creation module, used to execute the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition;

[0043] An installation module, used to obtain an image file from the image server and install the image file, wherein the image file includes system data to be cloned;

[0044] The writing module is used to write the relevant information of the EFI system partition into the operating system startup boot configuration file.

[0045] In a fourth aspect, an embodiment of the present invention provides a system cloning device, including:

[0046] A startup module is used to start the Dynamic Host Configuration Protocol service through the system cloning software;

[0047] A first sending module, used for receiving an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocating an IP address to the target machine;

[0048] A second sending module is used to send a clone file to the target machine, wherein the clone file includes: a boot program, a system configuration file and an installation script, wherein the installation script is used for the target machine to execute the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition;

[0049] The third sending module is used to send a mirror file to the target machine, where the mirror file includes system data to be cloned and is used for installation by the target machine.

[0050] In a fifth aspect, an embodiment of the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of the method described in any of the aforementioned embodiments.

[0051] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any of the aforementioned embodiments are executed.

[0052] The system cloning method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application can create EFI system partitions and GPT partitions through the functions of a boot program, a system configuration file and an installation script, thereby cloning an operating system booted by UEFI, thereby solving the problem that the cloning of an operating system booted by UEFI cannot be achieved in the prior art, and also improving the efficiency of installing an operating system booted by UEFI on a computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 A schematic diagram of the operating environment of the system cloning method provided in an embodiment of the present application.

[0055] Figure 2 A block diagram of an electronic device provided in an embodiment of the present application.

[0056] Figure 3 A flowchart of a system cloning method provided in an embodiment of the present application.

[0057] Figure 4A schematic diagram of the functional modules of the system cloning device provided in an embodiment of the present application.

[0058] Figure 5 Another flow chart of the system cloning method provided in an embodiment of the present application.

[0059] Figure 6 A schematic diagram of another functional module of the system cloning device provided in an embodiment of the present application.

[0060] Figure 7 Another flow chart of the system cloning method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0061] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.

[0062] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0063] There are two modes of computer startup now, the traditional BIOS (Basic Input / Output System) startup and the UEFI (Unified Extensible Firmware Interface) startup. However, the traditional BIOS startup is booted by the MBR (Master Boot Record), but the MBR only supports four primary partitions at most and a maximum hard disk of 2TB. The UEFI startup can support hard disk partitions larger than 2TB. Therefore, some computers currently use the UEFI startup mode.

[0064] However, the current operating system cloning method Systemimager does not support the operating system booted by UEFI. Based on the current demand for the operating system booted by UEFI, the embodiments of the present application provide a system cloning method, device, electronic device and computer-readable storage medium, which can realize the cloning of the operating system booted by UEFI. The following is a description through several embodiments.

[0065] Embodiment 1

[0066] To facilitate understanding of this embodiment, the operating environment of a system cloning method disclosed in the embodiment of the present application is first introduced in detail.

[0067] like Figure 1 As shown, the operating environment of the system cloning method provided in this embodiment may include a mirror server 110 and one or more target machines 120. The mirror server 110 can communicate with one or more target machines 120 to perform data communication or interaction. The mirror server 110 can be a network server, a database server, etc. The target machine 120 can be a server, a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc.

[0068] In this embodiment, the Systemimager application is running in the image server 110. The image server 110 may also include a DHCP (Dynamic Host Configuration Protocol) service and a TFTP (Trivial File Transfer Protocol) service.

[0069] Optionally, the DHCP service and the TFTP service may also be run by other servers connected to the mirror server. For example, the DHCP service is run in a DHCP server, and the DHCP server provides various services in the DHCP service. For another example, the TFTP service may be run in a TFTP server, and the TFTP server provides various services in the TFTP service. The following other embodiments are described by taking the DHCP service and the TFTP service running on the mirror server as an example.

[0070] For example, Figure 1 As shown, the operating environment of the system cloning method may also include a sample machine 130. Before the mirror server 110 interacts with the target machine 120 to implement system cloning, the system data on the sample machine 130 may be synchronized to the mirror server 110.

[0071] Alternatively, if Figure 1 As shown, the mirror server 110 can be connected to a storage hard disk 140 , and the above-mentioned system data can be stored on the storage hard disk 140 .

[0072] Exemplarily, the sample machine may run an operating system that needs to be cloned, for example, an operating system booted by UEFI.

[0073] like Figure 2 , which is a block diagram of an electronic device. The electronic device 200 may include a memory 201, a storage controller 202, and a processor 203. A person skilled in the art may understand that Figure 2 The structure shown is only for illustration and does not limit the structure of the electronic device 200. For example, the electronic device 200 may further include Figure 2 More or fewer components as shown, or with Figure 2 The electronic device 200 can be used as Figure 1 An embodiment of a mirror server 110, a target machine 120 or a template machine 130 is shown.

[0074] The memory 201, storage controller 202 and processor 203 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The processor 203 is used to execute the executable module stored in the memory.

[0075] The memory 201 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 201 is used to store programs, and the processor 203 executes the program after receiving the execution instruction. The method executed by the electronic device 200 defined by the process disclosed in any embodiment of the present application can be applied to the processor 203, or implemented by the processor 203.

[0076] The processor 203 may be an integrated circuit chip with signal processing capability. The processor 203 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0077] In this embodiment, the operating environment of the above-mentioned system cloning method can be implemented as cloning the operating system of the target machine 120.

[0078] Optionally, on the basis of being able to clone the BIOS-booted operating system for the target machine 120 , it is also possible to clone the UEFI-booted operating system for each target machine 120 .

[0079] Exemplarily, the contents executed when cloning an operating system booted by UEFI are different from those executed when cloning an operating system booted by BIOS.

[0080] The system provided by this embodiment can execute the process required for cloning the operating system booted by UEFI. The process of cloning the operating system booted by UEFI will be introduced below through several embodiments.

[0081] Embodiment 2

[0082] See also Figure 3 , is a flowchart of the system cloning method provided in the embodiment of the present application. The method in this embodiment is applied to a target machine, which is a computer whose operating system is to be cloned. Figure 3 The specific process shown is described in detail.

[0083] Step 301: Send an IP address allocation request to a dynamic host configuration protocol service of a mirror server to obtain an IP address allocated by the dynamic host configuration protocol service.

[0084] In this embodiment, the IP address obtained by the target machine may be an IP address assigned to a network card of the target machine, and the IP address is used to identify the target machine.

[0085] Exemplarily, before sending the IP address acquisition request to the dynamic host configuration protocol service, a PXE (Preboot eXecution Environment) network card may be started.

[0086] Exemplarily, the network card in the target machine may be a network card capable of supporting a PXE function.

[0087] Exemplarily, when the mirror server sends the IP address to the target machine, it can also feedback the storage location of the boot program. Exemplarily, the storage location of the boot program can be in a simple file transfer protocol server. Exemplarily, the storage location of the boot program can be in a storage location corresponding to the simple file transfer protocol service.

[0088] Step 302: Obtain a clone file from the mirror server.

[0089] In this embodiment, the cloned file may include: a boot program, a system configuration file, and an installation script.

[0090] Exemplarily, step 302 may include steps 3021 - 3023 .

[0091] Step 3021: Send a boot program acquisition request to the simple file transfer protocol service of the mirror server to obtain the boot program.

[0092] In this embodiment, the boot program may include drivers for configuration items that need to be executed when the system is cloned.

[0093] Exemplarily, the target machine may send a request to obtain the boot program based on the storage location of the boot program. In this embodiment, a request to obtain the boot program is sent to a simple file transfer protocol service to obtain the boot program.

[0094] In this embodiment, the FTP service can provide the target machine with the boot program, system configuration files, system kernel files, etc. required during the installation of the operating system.

[0095] Step 3022: Send a system configuration file acquisition request to the simple file transfer protocol service of the mirror server to obtain the system configuration file.

[0096] Exemplarily, the system configuration file may include configuration items that need to be executed when performing system cloning.

[0097] Step 3023, obtaining the installation script from the mirror server.

[0098] Exemplarily, when the installation script is executed, the installation steps in the system cloning process can be executed. Optionally, the file name of the installation script can be a combination of the image file name and master. For example, if the image file name is imagename, the file name of the installation script can be imagename.master.

[0099] Optionally, before step 3023, or after step 3023, it may also include: based on the boot program, in the process of executing the system configuration file, when executing the kernel configuration item and the file system configuration item, sending a kernel file and file system file acquisition request to the simple file transfer protocol service; after obtaining the kernel file and the file system file, starting the kernel and the file system in the memory.

[0100] In this embodiment, after the kernel and the file system are started, the operating system process from step 303 to step 305 is entered.

[0101] Step 303: Execute the system configuration file through the installation script based on the boot program to create an EFI system partition and a GPT partition.

[0102] Exemplarily, different from the operating system booted by BIOS, the installation of the operating system booted by UEFI includes EFI system partition and GPT partition. Based on this, the boot program in this embodiment includes GPT partition driver and EFI system partition driver, and the system configuration file includes GPT partition configuration items and EFI system partition configuration items.

[0103] In one embodiment, step 303 may include: through the installation script, executing the EFI system partition configuration item in the system configuration file according to the EFI system partition driver in the boot program to perform EFI partitioning; through the installation script, executing the GPT partition configuration item in the system configuration file according to the GPT partition driver in the boot program to perform GPT partitioning.

[0104] Exemplarily, the GPT partition table is a disk organization method, a disk organization method using UEFI startup.

[0105] Step 304: Obtain the image file from the image server and install the image file.

[0106] In this embodiment, the image file includes system data to be cloned. For example, the system cloning method provided in this embodiment is to clone the operating system booted by UEFI for the target machine, and the image file is the system data of the operating system booted by UEFI.

[0107] Step 305: Write the relevant information of the EFI system partition into the operating system startup boot configuration file.

[0108] Exemplarily, the related information may be the address of the EFI system partition, the boot information after the address of the EFI system partition is written into a sector, and the like.

[0109] In one implementation, step 305 includes: determining whether an EFI system partition exists according to the current system partition status; if an EFI system partition exists, writing relevant information of the EFI system partition into an operating system startup boot configuration file.

[0110] For example, if it is determined that there is no EFI system partition according to the current system partition status, the current system clone may not be an operating system booted by UEFI. Then the address of the Master Boot Record (MBR) can be loaded into the boot sector to obtain the Master Boot Record partition boot information; and the Master Boot Record partition boot information is written into the operating system startup boot configuration file.

[0111] In one implementation, step 305 may include: loading the EFI system partition address into a boot sector to obtain EFI system partition boot information; and writing the EFI system partition boot information into the operating system startup boot configuration file.

[0112] The boot sector may be the first sector of the target machine. By storing the boot configuration file in the first sector, the boot configuration file can be started more quickly to transfer the processor control right to the operating system more quickly.

[0113] Optionally, step 305 may include: sending a network configuration script acquisition request to the network service of the mirror server to obtain a network configuration script; and writing relevant information of the EFI system partition into an operating system boot configuration file according to the network configuration script.

[0114] In the system cloning method of the embodiment of the present application, it is possible to create an EFI system partition and a GPT partition under the action of a boot program, a system configuration file, and an installation script. Based on this, the cloning of the UEFI-booted operating system can be achieved, thereby solving the problem that the cloning of the UEFI-booted operating system cannot be achieved in the prior art, and also improving the efficiency of installing the UEFI-booted operating system on the computer.

[0115] Embodiment 3

[0116] Based on the same application concept, the embodiment of the present application also provides a system cloning device corresponding to the system cloning method provided in Example 2. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the system cloning method embodiment provided in Example 2, the implementation of the device in this embodiment can refer to the description in the embodiment of the above method, and the repeated parts will not be repeated.

[0117] See also Figure 4 , is a functional module diagram of the system cloning device provided in the embodiment of the present application. Each module in the system cloning device in this embodiment is used to execute each step in the above method embodiment. The system cloning device includes: a first request module 401, an acquisition module 402, a creation module 403, an installation module 404 and a writing module 405; wherein,

[0118] A first request module 401 is used to send an IP address allocation request to a dynamic host configuration protocol service of a mirror server to obtain an IP address allocated by the dynamic host configuration protocol service;

[0119] The acquisition module 402 is used to acquire a clone file from the image server, wherein the clone file includes: a boot program, a system configuration file, and an installation script;

[0120] A creation module 403 is used to execute the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition;

[0121] An installation module 404 is used to obtain an image file from the image server and install the image file, wherein the image file includes system data to be cloned;

[0122] The writing module 405 is used to write the relevant information of the EFI system partition into the operating system startup boot configuration file.

[0123] In a possible implementation, the boot program includes a GPT partition driver and an EFI system partition driver, and the system configuration file includes a GPT partition configuration item and an EFI system partition configuration item; the creation module 403 is used to:

[0124] By means of the installation script, the EFI system partition configuration item in the system configuration file is executed according to the EFI system partition driver in the boot program to perform EFI system partitioning;

[0125] Through the installation script, the globally unique identifier disk partition table partition configuration item in the system configuration file is executed according to the driver of the globally unique identifier disk partition table partition in the boot program to perform GPT partitioning.

[0126] In a possible implementation manner, the writing module 405 is used to:

[0127] According to the current system partition status, determine whether there is an EFI system partition;

[0128] If an EFI system partition exists, the relevant information of the EFI system partition is written into the operating system startup boot configuration file.

[0129] In a possible implementation manner, the writing module 405 is used to:

[0130] Loading the EFI system partition address into the boot sector to obtain EFI system partition boot information;

[0131] The EFI system partition boot information is written into the operating system startup boot configuration file.

[0132] In an optional implementation manner, writing the relevant information of the EFI system partition into an operating system startup boot configuration file includes:

[0133] Sending a network configuration script acquisition request to the network service of the mirror server to obtain a network configuration script;

[0134] According to the network configuration script, the relevant information of the EFI system partition is written into the operating system startup boot configuration file.

[0135] In a possible implementation manner, the system cloning device in this embodiment further includes:

[0136] A second request module is used for sending a kernel file and a file system file acquisition request to the simple file transfer protocol service when executing the system configuration file based on the boot program and executing the kernel configuration item and the file system configuration item;

[0137] The startup module is used to start the kernel and the file system in the memory after obtaining the kernel file and the file system file.

[0138] In a possible implementation manner, the acquisition module 402 is further configured to:

[0139] Sending a boot program acquisition request to the simple file transfer protocol service of the mirror server to obtain a boot program;

[0140] Sending a system configuration file acquisition request to the simple file transfer protocol service of the mirror server to obtain the system configuration file;

[0141] Obtain the installation script from the mirror server.

[0142] Embodiment 4

[0143] See also Figure 5 , is a flowchart of the system cloning method provided in the embodiment of the present application. The system cloning method in this embodiment is similar to the system cloning method provided in the second embodiment, the difference being that the method in this embodiment is applied to the mirror server, while the system cloning method provided in the second embodiment is applied to the target machine interacting with the mirror server. Figure 5 The specific process shown is described in detail.

[0144] Step 501, starting the Dynamic Host Configuration Protocol service through the system cloning software.

[0145] Optionally, when the dynamic host configuration protocol service is started, the simple file transfer protocol service may also be started through the system cloning software.

[0146] The DHCP service can provide the network parameters required by the target machine and send the location of the FTP service to the target machine.

[0147] The simple file transfer protocol service is used to provide the target machine with the download path of the boot program and kernel file required by the target machine.

[0148] In this embodiment, the dynamic host configuration protocol service needs to configure an IP address for the target machine. Since the target machine in this embodiment supports the use of the PXE function, the dynamic host configuration protocol service in this embodiment is additionally provided with corresponding PXE settings.

[0149] Step 502: Receive an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocate an IP address to the target machine.

[0150] Step 503: Send the clone file to the target machine.

[0151] In this embodiment, the cloned file may include: a boot program, a system configuration file, and an installation script.

[0152] Exemplarily, the installation script is used for the target machine to execute the system configuration file through the installation script based on the boot program to create an EFI system partition and a GPT partition.

[0153] Optionally, step 503 may include:

[0154] Step 5031, receiving a boot program acquisition request sent by the target machine through the simple file transfer protocol service, and sending a boot program to the target machine;

[0155] Step 5032, receiving a system configuration file acquisition request sent by the target machine through the simple file transfer protocol service, and sending the system configuration file to the target machine;

[0156] Step 5033, sending the installation script to the target machine.

[0157] Step 504: Send an image file to the target machine, where the image file includes system data to be cloned.

[0158] In this embodiment, the above-mentioned image file is used for installation on the target machine.

[0159] For other details of this embodiment, please refer to the description in Embodiment 2, which will not be repeated here.

[0160] Embodiment 5

[0161] Based on the same application concept, the embodiment of the present application also provides a system cloning device corresponding to the system cloning method provided in Example 4. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the system cloning method embodiment provided in Example 4, the implementation of the device in this embodiment can refer to the description in the embodiment of the above method, and the repeated parts will not be repeated.

[0162] See also Figure 6 , is a functional module diagram of the system cloning device provided in the embodiment of the present application. Each module in the system cloning device in this embodiment is used to execute each step in the above method embodiment. The system cloning device includes: a startup module 601, a first sending module 602, a second sending module 603 and a third sending module 604; wherein,

[0163] A startup module 601 is used to start the dynamic host configuration protocol service through the system cloning software;

[0164] A first sending module 602, configured to receive an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocate an IP address to the target machine;

[0165] A second sending module 603 is used to send a clone file to the target machine, wherein the clone file includes: a boot program, a system configuration file, and an installation script, wherein the installation script is used for the target machine to execute the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition;

[0166] The third sending module 604 is used to send a mirror file to the target machine, where the mirror file includes system data to be cloned and is used for installation by the target machine.

[0167] In a possible implementation manner, the second sending module 603 is configured to:

[0168] Receiving a boot program acquisition request sent by the target machine through the simple file transfer protocol service, and sending a boot program to the target machine;

[0169] Receiving a system configuration file acquisition request sent by the target machine through the simple file transfer protocol service, and sending the system configuration file to the target machine;

[0170] An installation script is sent to the target machine.

[0171] Embodiment 6

[0172] See also Figure 7 , is a flowchart of the system cloning method provided in the embodiment of the present application. The system cloning method in this embodiment is similar to the system cloning methods provided in the second embodiment and the fourth embodiment, the difference being that the method in this embodiment is applied to a system in which a mirror server and a target machine interact, the system cloning method provided in the second embodiment is applied to a target machine, and the system cloning method provided in the fourth embodiment is applied to a mirror server. Figure 7 The specific process shown is described in detail.

[0173] Step 701: The mirror server starts the Dynamic Host Configuration Protocol service and the Simple File Transfer Protocol service through the system cloning software.

[0174] Exemplarily, before step 701, system data sent by the sample machine may also be received.

[0175] Step 702: The target machine sends an IP address allocation request to the dynamic host configuration protocol service of the mirror server.

[0176] Step 703: The dynamic host configuration protocol service of the mirror server allocates an IP address to the target machine and sends it to the target machine.

[0177] Step 704: The target machine sends a boot program acquisition request to the simple file transfer protocol service of the mirror server.

[0178] Step 705: The FTP service of the image server sends the boot program to the target machine.

[0179] Step 706: The target machine sends a request to obtain a system configuration file to the simple file transfer protocol service of the mirror server.

[0180] Step 707: The mirror server sends the system configuration file to the target machine.

[0181] Step 708: The target machine sends a request to the mirror server to obtain the installation script.

[0182] Step 709: The mirror server sends the installation script to the target machine.

[0183] Step 710: The target machine executes the system configuration file through the installation script based on the boot program to create an EFI system partition and a GPT partition.

[0184] Step 711: The target machine obtains an image file from the image server and installs the image file, wherein the image file includes system data to be cloned.

[0185] Step 712: The target machine writes the relevant information of the EFI system partition into the operating system startup boot configuration file.

[0186] For other details of this embodiment, please refer to the description of the methods provided in Embodiment 2 and Embodiment 4, which will not be repeated here.

[0187] In addition, an embodiment of the present application further 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 system cloning method described in the above method embodiment are executed.

[0188] The computer program product of the system cloning method provided in the embodiment of the present application includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the system cloning method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0189] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0190] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0191] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk. It should be noted that, in this article, 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 that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus. In the absence of more restrictions, the elements defined by the sentence "includes..." do not exclude the presence of other identical elements in the process, method, article or apparatus that includes the elements.

[0192] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0193] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A system cloning method, characterized in that: include: Sending an IP address allocation request to the dynamic host configuration protocol service of the mirror server to obtain an IP address allocated by the dynamic host configuration protocol service; Acquire a clone file from the image server, the clone file comprising: a boot program, a system configuration file, and an installation script, wherein when the installation script is executed, the installation steps in the system cloning process are executed, wherein the boot program comprises a driver for a globally uniquely identifying disk partition table partition and a driver for an extensible firmware interface system partition, and the system configuration file comprises a globally uniquely identifying disk partition table partition configuration item and an extensible firmware interface system partition configuration item; The system configuration file is executed through the installation script based on the boot program to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition, including: executing the extensible firmware interface system partition configuration item in the system configuration file according to the driver of the extensible firmware interface system partition in the boot program through the installation script to perform extensible firmware interface system partition; executing the globally unique identifier disk partition table partition configuration item in the system configuration file according to the driver of the globally unique identifier disk partition table partition in the boot program through the installation script to perform globally unique identifier disk partition table partition; Obtaining an image file from the image server and installing the image file, wherein the image file includes system data to be cloned; The relevant information of the extensible firmware interface system partition is written into an operating system startup boot configuration file.

2. The method according to claim 1, characterized in that The step of writing the relevant information of the extensible firmware interface system partition into an operating system boot configuration file includes: Loading the extensible firmware interface system partition address into a boot sector to obtain extensible firmware interface system partition boot information; The extensible firmware interface system partition boot information is written into the operating system startup boot configuration file.

3. The method according to any one of claims 1 to 2, characterized in that: The step of writing the relevant information of the extensible firmware interface system partition into an operating system boot configuration file includes: Sending a network configuration script acquisition request to the network service of the mirror server to obtain a network configuration script; According to the network configuration script, the relevant information of the extensible firmware interface system partition is written into the operating system startup boot configuration file.

4. The method according to any one of claims 1 to 2, characterized in that: The obtaining of the clone file from the mirror server includes: Sending a boot program acquisition request to the simple file transfer protocol service of the mirror server to obtain a boot program; Sending a system configuration file acquisition request to the simple file transfer protocol service of the mirror server to obtain the system configuration file; Obtain the installation script from the mirror server.

5. A system cloning method, characterized in that: include: Start the Dynamic Host Configuration Protocol service through the system cloning software; Receiving an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocating an IP address to the target machine; Sending a clone file to the target machine, the clone file comprising: a boot program, a system configuration file and an installation script, wherein the installation script is used for the target machine to execute the system configuration file based on the boot program through the installation script to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition; wherein the boot program comprises a driver for a globally unique identifier disk partition table partition and a driver for an extensible firmware interface system partition, and the system configuration file comprises a globally unique identifier disk partition table partition configuration item and an extensible firmware interface system partition configuration item; the installation script is used to execute the extensible firmware interface system partition configuration item in the system configuration file according to the driver for the extensible firmware interface system partition in the boot program through the installation script to perform extensible firmware interface system partition; through the installation script, execute the globally unique identifier disk partition table partition configuration item in the system configuration file according to the driver for the globally unique identifier disk partition table partition in the boot program to perform globally unique identifier disk partition table partition; An image file is sent to the target machine, wherein the image file includes system data to be cloned and is used for installation by the target machine.

6. A system cloning device, characterized in that: include: A first request module, used to send an IP address allocation request to the dynamic host configuration protocol service of the mirror server to obtain an IP address allocated by the dynamic host configuration protocol service; an acquisition module, configured to acquire a clone file from the image server, wherein the clone file includes: a boot program, a system configuration file, and an installation script, wherein when the installation script is executed, the installation steps in the system cloning process are executed, wherein the boot program includes a driver for a globally uniquely identifying disk partition table partition and a driver for an extensible firmware interface system partition, and the system configuration file includes a globally uniquely identifying disk partition table partition configuration item and an extensible firmware interface system partition configuration item; A creation module is used to execute the system configuration file based on the boot program through the installation script to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition; An installation module, used to obtain an image file from the image server and install the image file, wherein the image file includes system data to be cloned; A writing module, used to write the relevant information of the extensible firmware interface system partition into an operating system startup boot configuration file; The creation module is used to execute the extensible firmware interface system partition configuration item in the system configuration file through the installation script according to the driver of the extensible firmware interface system partition in the boot program to perform extensible firmware interface system partitioning; and execute the globally unique identifier disk partition table partition configuration item in the system configuration file through the installation script according to the driver of the globally unique identifier disk partition table partition in the boot program to perform globally unique identifier disk partition table partitioning.

7. A system cloning device, characterized in that: include: A startup module is used to start the Dynamic Host Configuration Protocol service through the system cloning software; A first sending module, used for receiving an IP address allocation request sent by a target machine through the dynamic host configuration protocol service, and allocating an IP address to the target machine; The second sending module is used to send a clone file to the target machine, wherein the clone file includes: a boot program, a system configuration file and an installation script, wherein the installation script is used for the target machine to execute the system configuration file based on the boot program through the installation script to create an extensible firmware interface system partition and a globally unique identifier disk partition table partition; wherein the boot program includes a driver for a globally unique identifier disk partition table partition and a driver for an extensible firmware interface system partition, and the system configuration file includes a globally unique identifier disk partition table partition configuration item and an extensible firmware interface system partition configuration item; the installation script is used to execute the extensible firmware interface system partition configuration item in the system configuration file according to the driver of the extensible firmware interface system partition in the boot program through the installation script to perform extensible firmware interface system partition; through the installation script, execute the globally unique identifier disk partition table partition configuration item in the system configuration file according to the driver of the globally unique identifier disk partition table partition in the boot program to perform globally unique identifier disk partition table partition; The third sending module is used to send a mirror file to the target machine, where the mirror file includes system data to be cloned and is used for installation by the target machine.

8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are executed by the processor to perform the steps of any method described in claims 1 to 5.

9. 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 method according to any one of claims 1 to 5 are executed.