CN112527328A - System cloning method, device, electronic equipment and computer readable storage medium - Google Patents

System cloning method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112527328A
CN112527328A CN202011419768.4A CN202011419768A CN112527328A CN 112527328 A CN112527328 A CN 112527328A CN 202011419768 A CN202011419768 A CN 202011419768A CN 112527328 A CN112527328 A CN 112527328A
Authority
CN
China
Prior art keywords
file
partition
mirror image
boot
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011419768.4A
Other languages
Chinese (zh)
Inventor
周军
李媛
王建敏
南亚
原帅
张晋锋
李斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHONGKE SUGON INFORMATION INDUSTRY CHENGDU Co.,Ltd.
Dawning Information Industry Beijing Co Ltd
Original Assignee
Dawning Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dawning Information Industry Beijing Co Ltd filed Critical Dawning Information Industry Beijing Co Ltd
Priority to CN202011419768.4A priority Critical patent/CN112527328A/en
Publication of CN112527328A publication Critical patent/CN112527328A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Abstract

The application provides a system cloning method, a device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: sending an IP address allocation request to a dynamic host configuration protocol service of the mirror image 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 comprising: a bootstrap program, a system configuration file and an installation script; executing a system configuration file by an installation script on the basis of a bootstrap program to create an extensible firmware interface system partition and a globally unique identification disk partition table partition; acquiring a mirror image file from a mirror image server, and installing the mirror image file, wherein the mirror image file comprises system data to be cloned; and writing the related information of the extensible firmware interface system partition into the starting boot configuration file of the operating system. The method in the embodiment of the application can solve the cloning problem of the UEFI boot operating system.

Description

System cloning method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a system cloning method, an apparatus, an electronic device, and a computer-readable storage medium.
Background
The Systemimager is software capable of realizing automatic operating system installation, and the operating system on the sample board machine can be cloned to a target machine needing to be provided with the operating system through the Systemimager. However, the conventional Systemimager does not support an operating system guided by the UEFI (Unified Extensible Firmware Interface), so that a computer needing to install the operating system guided by the UEFI can only be manually installed by related personnel, and the operating system guided by the UEFI is inconvenient to install.
Disclosure of Invention
The application aims to provide a system cloning method, a device, an electronic device and a computer readable storage medium, which can solve the cloning problem of a UEFI boot operating system.
In a first aspect, an embodiment of the present invention provides a system cloning method, including:
sending an IP address allocation request to a dynamic host configuration protocol service of a mirror image 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 comprising: a bootstrap program, a system configuration file and an installation script;
executing the system configuration file by the installation script on the basis of the bootstrap program to create an EFI (Extensible Firmware Interface) system Partition and a GPT (GUID Partition Table);
acquiring a mirror image file from the mirror image server, and installing the mirror image file, wherein the mirror image file comprises system data to be cloned;
and writing the related information of the EFI system partition into an operating system starting and guiding configuration file.
In an optional embodiment, 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 executing, by the installation script, the system configuration file based on the boot program to create an EFI system partition and a GPT partition includes:
executing an EFI system partition configuration item in the system configuration file according to an EFI system partition driver in the boot program through the installation script to partition the EFI system;
and executing the GPT partition configuration item in the system configuration file according to the GPT partition driver in the bootstrap program through the installation script so as to partition the GPT.
In the above embodiment, the GPT partition configuration item and the EFI system partition configuration item are added to the system configuration file, so that the GPT partition and the EFI system partition can be implemented in the system configuration stage, and the GPT partition driver and the EFI system partition driver are set in the boot program, so that the GPT partition configuration item and the EFI system partition configuration item in the system configuration file can be driven to be executed, so that the GPT partition and the EFI system partition are created, and thus the automatic GPT partition and the EFI system partition, and the automatic UEFI-guided cloning of the operating system are implemented.
In an optional embodiment, the writing the information related to the EFI system partition into the boot configuration file for operating system boot includes:
judging whether an EFI system partition exists according to the current system partition state;
and if the EFI system partition exists, writing the related information of the EFI system partition into an operating system boot configuration file.
In the above embodiment, by cloning the UEFI-booted operating system, when information is written to the boot configuration file of the operating system, a determination may be made based on the current partition, so that accuracy of writing the partition information may be improved, and validity of cloning the UEFI-booted operating system may also be improved.
In an optional embodiment, the writing the information related to the EFI system partition into the boot configuration file for operating system boot includes:
loading the EFI system partition address to a boot sector to obtain EFI system partition boot information;
and writing the EFI system partition boot information into the operating system boot configuration file.
In an optional embodiment, the writing the information related to the EFI system partition into the boot configuration file for operating system boot includes:
sending a network configuration script acquisition request to a network service of the mirror image server to acquire a network configuration script;
and writing the related information of the EFI system partition into an operating system starting boot configuration file according to the network configuration script.
In the above embodiment, the network configuration script is obtained from the mirror server, so as to implement cloning of the system guided by the mirror server, and thus implement cloning of the fully automatic UEFI-guided operating system of the computer.
In an alternative embodiment, the obtaining the clone file from the mirror server includes:
sending a bootstrap program acquisition request to a simple file transfer protocol service of the mirror image server to acquire a bootstrap program;
sending a system configuration file acquisition request to a simple file transfer protocol service of the mirror image server to acquire a system configuration file;
and obtaining the installation script from the mirror image server.
In the above embodiment, various cloned files are provided for the target machine through the simple file transfer protocol service of the mirror image server, so that various services in the mirror image server can be distributed and cooperated, and the system cloning is more orderly.
In an alternative embodiment, the method further comprises:
based on the bootstrap program, when a kernel configuration item and a file system configuration item are executed in the process of executing the system configuration file, sending a kernel file and file system file acquisition request to the SNTP service;
and after the kernel file and the file system file are obtained, the kernel and the file system are started in the memory.
In the above embodiment, the kernel and the file system of the computer can be started in the process of executing the system configuration file, so that the operation requiring manual start is omitted, and the cloning efficiency of the UEFI-guided operating system is improved.
In a second aspect, an embodiment of the present invention provides a system cloning method, including:
starting a dynamic host configuration protocol service through 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 for the target machine;
sending a clone file to the target machine, the clone file comprising: the system configuration file is used for the target machine to execute the system configuration file through the installation script on the basis of the bootstrap program so as to create an extensible firmware interface system partition and a globally unique identification disk partition table partition;
and sending an image file to the target machine, wherein the image file comprises system data to be cloned, and the image file is used for the target machine to install.
In a third aspect, an embodiment of the present invention provides a system cloning device, including:
the first request module is used for sending an IP address allocation request to a dynamic host configuration protocol service of a mirror image server so as to obtain an IP address allocated by the dynamic host configuration protocol service;
an obtaining module, configured to obtain a clone file from the mirror image server, where the clone file includes: a bootstrap program, a system configuration file and an installation script;
a creation module for executing the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition;
the installation module is used for acquiring a mirror image file from the mirror image server and installing the mirror image file, wherein the mirror image file comprises system data to be cloned;
and the writing module is used for writing the related information of the EFI system partition into an operating system starting and guiding configuration file.
In a fourth aspect, an embodiment of the present invention provides a system cloning device, including:
the starting module is used for starting the dynamic host configuration protocol service through the system cloning software;
the first sending module is 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 for the target machine;
a second sending module, configured to send a clone file to the target machine, where the clone file includes: the system configuration file is used for the target machine to execute the system configuration file through the installation script on the basis of the bootstrap program so as to create an EFI system partition and a GPT partition;
and the third sending module is used for sending an image file to the target machine, wherein the image file comprises system data to be cloned, and the image file is used for the target machine to install.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory storing machine readable instructions executable by the processor, the machine readable instructions when executed by the processor perform the steps of the method of any of the preceding embodiments when the electronic device is run.
In a sixth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method according to any one of the foregoing embodiments.
The system cloning method, the device, the electronic equipment and the computer readable storage medium provided by the embodiment of the application can realize the creation of the EFI system partition and the GPT partition under the action of the boot program, the system configuration file and the installation script, so that the cloning of the UEFI-guided operating system can be realized based on the EFI system partition and the GPT partition, the problem of the cloning of the UEFI-guided operating system in the prior art is solved, and the efficiency of installing the UEFI-guided operating system in the computer is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic operating environment diagram of a system cloning method according to an embodiment of the present application.
Fig. 2 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Fig. 3 is a flowchart of a system cloning method provided in an embodiment of the present application.
Fig. 4 is a schematic functional block diagram of a system cloning device according to an embodiment of the present disclosure.
Fig. 5 is another flowchart of a system cloning method according to an embodiment of the present disclosure.
Fig. 6 is a schematic diagram of another functional module of the system cloning device according to an embodiment of the present disclosure.
Fig. 7 is a further flowchart of a system cloning method according to an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Two modes of computer boot are conventional BIOS (Basic Input/Output System, Chinese called Basic Input/Output System) boot and UEFI (Unified Extensible Firmware Interface). But the conventional BIOS Boot is booted by MBR (Master Boot Record, chinese), but the MBR supports only four main partitions at most and only 2T hard disks at most. While UEFI startup can support hard disk partitions larger than 2T. Therefore, a part of the computers at present adopt a UEFI starting mode.
However, the present cloning method systemariger of the operating system does not support the UEFI-booted operating system, and based on the present requirement for the UEFI-booted operating system, embodiments of the present application provide a system cloning method, apparatus, electronic device, and computer-readable storage medium, which can implement cloning of the UEFI-booted operating system. This is described below by means of several examples.
Example one
To facilitate understanding of the present embodiment, a detailed description will be given of an operating environment for performing a system cloning method disclosed in the embodiments of the present application.
As shown in fig. 1, the operating environment of the system cloning method provided by the present embodiment may include an image server 110 and one or more target machines 120. The image server 110 can communicate with one or more target machines 120 for data communication or interaction. The mirror server 110 may be a web server, a database server, or the like. The target machine 120 may be a server, a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or the like.
In this embodiment, a Systemimager application program is run in the image server 110. The image server 110 may also include a DHCP (Dynamic Host Configuration Protocol, chinese called: Dynamic Host Configuration Protocol) service and a TFTP (Trivial File Transfer Protocol) service.
Alternatively, the DHCP service and the TFTP service may be run by other servers connected to the mirroring server. For example, the DHCP services run in a DHCP server, which provides each of the DHCP services. For another example, the TFTP services may run in a TFTP server, which provides each of the TFTP services. The following other embodiments are described by taking the example where the DHCP service and the TFTP service operate on mirror servers.
Illustratively, as shown in fig. 1, a sample board computer 130 may be further included in the operating environment of the system cloning method. The mirror server 110 may also synchronize system data on the board computer 130 to the mirror server 110 before interacting with the target computer 120 to implement system cloning.
Alternatively, as shown in fig. 1, the image server 110 may be connected to a storage hard disk 140, and the system data may be stored on the storage hard disk 140.
For example, the sample board machine may have an operating system running thereon that needs to be cloned. Such as a UEFI-booted operating system.
As shown in fig. 2, is a block schematic diagram of an electronic device. The electronic device 200 may include a memory 201, a memory controller 202, a processor 203. It will be understood by those skilled in the art that the structure shown in fig. 2 is merely illustrative and is not intended to limit the structure of the electronic device 200. For example, electronic device 200 may also include more or fewer components than shown in FIG. 2, or have a different configuration than shown in FIG. 2. The electronic device 200 may be implemented as the mirror server 110, the target machine 120, or the template machine 130 shown in fig. 1.
The above-mentioned components of the memory 201, the memory controller 202 and the processor 203 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The processor 203 described above is used to execute executable modules stored in memory.
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 Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 201 is used for storing a program, and the processor 203 executes the program after receiving an execution instruction, and the method executed by the electronic device 200 defined by the process disclosed in any embodiment of the present application may be applied to the processor 203, or implemented by the processor 203.
The processor 203 may be an integrated circuit chip having signal processing capabilities. The Processor 203 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In this embodiment, the operating environment of the system cloning method described above may be implemented as the cloning operating system of the target machine 120.
Optionally, on top of the operating system that can be implemented to clone BIOS boots for the target machines 120, it can also be implemented to clone UEFI booted operating systems for the respective target machines 120.
Illustratively, the operating system for cloning UEFI boot may be executed differently than the operating system for cloning BIOS boot.
The system provided by the embodiment can execute the flow required by the operating system booted by the cloned UEFI, and a process of cloning the operating system booted by the UEFI will be described below by several embodiments.
Example two
Please refer to fig. 3, which is a flowchart illustrating a system cloning method according to an embodiment of the present application. The method in this embodiment is applied to a target machine, which is a computer to be cloned with an operating system. The specific flow shown in fig. 3 will be described in detail below.
Step 301, sending an IP address allocation request to a dhcp service of the mirror server to obtain an IP address allocated by the dhcp service.
In this embodiment, the IP address obtained by the target device may be an IP address of the network card allocated to the target device. The IP address is used to identify the target machine.
Illustratively, before sending the IP address acquisition request to the dhcp service, a PXE (preboot execution environment) network card may be started.
Illustratively, the network card in the target machine may be a network card capable of supporting PXE functions.
Illustratively, when the mirror server sends the IP address to the target machine, the storage position of the bootstrap program can be fed back. Illustratively, the boot program may be stored in a trivial file transfer protocol server. Illustratively, the storage location of the bootstrap program may be in a storage location corresponding to a simple file transfer protocol service.
Step 302, obtaining a clone file from the mirror image server.
In this embodiment, the clone file may include: a boot program, a system configuration file, and an installation script.
Illustratively, step 302 may include steps 3021-3023.
Step 3021, sending a bootstrap acquisition request to a trivial file transfer protocol service of the mirror server to acquire a bootstrap.
In this embodiment, the boot program may include a driver of a configuration item that needs to be executed when the system clone is performed.
For example, the target machine may then send a boot program acquisition request based on the storage location of the boot program. In this embodiment, a bootstrap program acquisition request is sent to the trivial file transfer protocol service, and the bootstrap program is acquired.
In this embodiment, the simple file transfer protocol service can provide a boot program, a system configuration file, a system kernel file, and the like required in the process of installing the operating system by the target machine.
Step 3022, sending a system configuration file acquisition request to the trivial file transfer protocol service of the mirror server to obtain a system configuration file.
Illustratively, the system configuration file may include configuration items that need to be executed when system cloning is performed.
Step 3023, obtaining an installation script from the image server.
Illustratively, the installation script, when executed, is capable of performing installation steps in a system cloning process. Alternatively, the file name of the installation script may be a combination of the mirror file name and the master. For example, if the image file name is imagename, the file name of the installation script may be imagename.
Optionally, before step 3023, or after step 3023, the method may further include: based on the bootstrap program, when a kernel configuration item and a file system configuration item are executed in the process of executing the system configuration file, sending a kernel file and file system file acquisition request to the SNTP service; and after the kernel file and the file system file are obtained, the kernel and the file system are started in the memory.
In this embodiment, after the kernel and the file system are started, the process of the operating system in steps 303 to 305 is entered.
Step 303, executing the system configuration file based on the boot program through the installation script to create an EFI system partition and a GPT partition.
Illustratively, unlike a BIOS booted operating system, UEFI booted operating system installations include an EFI system partition and a GPT partition. Based on this, the boot program in this embodiment 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.
In one embodiment, step 303 may comprise: executing an EFI system partition configuration item in the system configuration file according to an EFI system partition driver in the boot program through the installation script to perform EFI partitioning; and executing the GPT partition configuration item in the system configuration file according to the GPT partition driver in the bootstrap program through the installation script so as to partition the GPT.
Illustratively, the GPT partition table is a disk organization, a disk organization using UEFI startup.
And 304, acquiring the mirror image file from the mirror image server, and installing the mirror image file.
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 UEFI-booted operating system for the target machine, and then the image file is system data of the UEFI-booted operating system.
Step 305, writing the related information of the EFI system partition into an operating system boot configuration file.
Illustratively, the related information may be an address of the EFI system partition, boot information after the address of the EFI system partition is written into a sector, and the like.
In one embodiment, step 305 includes: judging whether an EFI system partition exists according to the current system partition state; and if the EFI system partition exists, writing the related information of the EFI system partition into an operating system boot configuration file.
For example, if it is determined that the EFI system partition does not exist according to the current system partition state, the currently performed system clone may not be the UEFI-booted operating system. The address of a Master Boot Record (MBR) may be loaded to the Boot sector to obtain Master Boot Record partition Boot information; and writing the boot information of the main boot record partition into the boot configuration file of the operating system.
In one embodiment, step 305 may comprise: loading the EFI system partition address to a boot sector to obtain EFI system partition boot information; and writing the EFI system partition boot information into the operating system boot configuration file.
Wherein the boot sector may be the first sector of the target machine. By storing the boot profile in the first sector, the boot profile may be able to be launched more quickly to transfer processor control to the operating system more quickly.
Optionally, step 305 may include: sending a network configuration script acquisition request to a network service of the mirror image server to acquire a network configuration script; and writing the related information of the EFI system partition into an operating system starting boot configuration file according to the network configuration script.
According to the system cloning method, the EFI system partition and the GPT partition can be created under the action of a boot program, a system configuration file and an installation script, and the UEFI-guided operating system can be cloned based on the EFI system partition and the GPT partition, so that the problem that the UEFI-guided operating system cannot be cloned in the prior art is solved, and the UEFI-guided operating system installation efficiency of a computer is improved.
EXAMPLE III
Based on the same application concept, a system cloning device corresponding to the system cloning method provided in the second embodiment is also provided in the embodiment of the present application, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the embodiment of the system cloning method provided in the second embodiment, the implementation of the device in the embodiment of the present application may refer to the description in the embodiment of the method, and repeated details are not described again.
Please refer to fig. 4, which is a schematic diagram of functional modules of a system cloning device according to an embodiment of the present application. Each module in the system cloning device in this embodiment is configured to perform each step in the above method embodiments. The system cloning device comprises: a first request module 401, an obtaining module 402, a creating module 403, an installing module 404, and a writing module 405; wherein the content of the first and second substances,
a first request module 401, configured to send an IP address allocation request to a dhcp service of a mirror server, so as to obtain an IP address allocated by the dhcp service;
an obtaining module 402, configured to obtain a clone file from the mirror server, where the clone file includes: a bootstrap program, a system configuration file and an installation script;
a creating module 403, configured 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;
an installation module 404, configured to obtain an image file from the image server, and install the image file, where the image file includes system data to be cloned;
a writing module 405, configured to write the relevant information of the EFI system partition into an operating system boot configuration file.
In a possible implementation manner, 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 creating module 403 is configured to:
executing an EFI system partition configuration item in the system configuration file according to an EFI system partition driver in the boot program through the installation script to partition the EFI system;
and executing the configuration items of the globally unique identification disk partition table in the system configuration file according to the drive of the globally unique identification disk partition table in the bootstrap program through the installation script so as to perform GPT partition.
In a possible implementation, the writing module 405 is configured to:
judging whether an EFI system partition exists according to the current system partition state;
and if the EFI system partition exists, writing the related information of the EFI system partition into an operating system boot configuration file.
In one possible implementation, the writing module 405 is configured to:
loading the EFI system partition address to a boot sector to obtain EFI system partition boot information;
and writing the EFI system partition boot information into the operating system boot configuration file.
In an optional embodiment, the writing the information related to the EFI system partition into the boot configuration file for operating system boot includes:
sending a network configuration script acquisition request to a network service of the mirror image server to acquire a network configuration script;
and writing the related information of the EFI system partition into an operating system starting boot configuration file according to the network configuration script.
In a possible implementation manner, the system cloning device in this embodiment further includes:
a second request module, configured to send a kernel file and a file system file acquisition request to the trivial file transfer protocol service when a kernel configuration item and a file system configuration item are executed in the process of executing the system configuration file based on the bootstrap;
and the starting module is used for starting the kernel and the file system in the memory after the kernel file and the file system file are obtained.
In a possible implementation, the obtaining module 402 is further configured to:
sending a bootstrap program acquisition request to a simple file transfer protocol service of the mirror image server to acquire a bootstrap program;
sending a system configuration file acquisition request to a simple file transfer protocol service of the mirror image server to acquire a system configuration file;
and obtaining the installation script from the mirror image server.
Example four
Please refer to fig. 5, which is a flowchart illustrating a system cloning method according to an embodiment of the present application. The system cloning method in this embodiment is similar to the system cloning method provided in the second embodiment, and the difference is that the method in this embodiment is applied to a mirror server, and the system cloning method provided in the second embodiment is applied to a target machine interacting with the mirror server. The specific flow shown in fig. 5 will be described in detail below.
Step 501, a dynamic host configuration protocol service is started through system cloning software.
Optionally, when the dynamic host configuration protocol service is started, the trivial file transfer protocol service may also be started through the system cloning software.
The dynamic host configuration protocol service can provide network parameters required by a target machine and sends the position of the SNTP service to the target machine.
The simple file transfer protocol service is used for providing a downloading path of a bootstrap program and a kernel file required by the target machine for the target machine.
In this embodiment, the dhcp service needs to configure an IP address for the target. Since the target machine in this embodiment supports the use of the PXE function, the dynamic host configuration protocol service in this embodiment is added with a corresponding PXE setting.
Step 502, receiving an IP address allocation request sent by a target machine through the dhcp service, and allocating an IP address to the target machine.
Step 503, sending the clone file to the target machine.
In this embodiment, the clone file may include: a boot program, a system configuration file, and an installation script.
Illustratively, the installation script is for the target machine to execute the system configuration file via the installation script based on the boot program to create an EFI system partition and a GPT partition.
Optionally, step 503 may include:
step 5031, receiving a bootstrap acquisition request sent by the target machine through the trivial file transfer protocol service, and sending a bootstrap to the target machine;
step 5032, receiving a system configuration file acquisition request sent by the target machine through the trivial file transfer protocol service, and sending a system configuration file to the target machine;
step 5033, sending an installation script for said target machine.
Step 504, sending an image file to the target machine, wherein the image file comprises system data to be cloned.
In this embodiment, the image file is used for installation by a target machine.
For other details of this embodiment, reference may be made to the description in embodiment two, and details are not described herein.
EXAMPLE five
Based on the same application concept, a system cloning device corresponding to the system cloning method provided in the fourth embodiment is also provided in the embodiments of the present application, and since the principle of solving the problem of the device in the embodiments of the present application is similar to that of the system cloning method provided in the fourth embodiment, the implementation of the device in the embodiments of the present application may refer to the description in the embodiments of the method, and repeated details are not described again.
Please refer to fig. 6, which is a schematic diagram of functional modules of a system cloning device according to an embodiment of the present application. Each module in the system cloning device in this embodiment is configured to perform each step in the above method embodiments. The system cloning device comprises: a starting module 601, a first sending module 602, a second sending module 603 and a third sending module 604; wherein the content of the first and second substances,
a starting module 601, configured to start a dynamic host configuration protocol service through system cloning software;
a first sending module 602, configured to receive, through the dhcp service, an IP address allocation request sent by a target machine, and allocate an IP address to the target machine;
a second sending module 603, configured to send a clone file to the target machine, where the clone file includes: the system configuration file is used for the target machine to execute the system configuration file through the installation script on the basis of the bootstrap program so as to create an EFI system partition and a GPT partition;
a third sending module 604, configured to send an image file to the target machine, where the image file includes system data to be cloned, and the image file is used for the target machine to install.
In a possible implementation, the second sending module 603 is configured to:
receiving a bootstrap program acquisition request sent by the target machine through the SNTP service, and sending a bootstrap program to the target machine;
receiving a system configuration file acquisition request sent by the target machine through the simple file transfer protocol service, and sending a system configuration file to the target machine;
and sending an installation script for the target machine.
EXAMPLE six
Please refer to fig. 7, which is a flowchart illustrating a system cloning method according to an embodiment of the present application. The system cloning method in this embodiment is similar to the system cloning methods provided in the second and fourth embodiments, but the difference is that the method in this embodiment is applied to a system in which a mirror server and a target machine interact with each other, the system cloning method provided in the second embodiment is applied to the target machine, and the system cloning method provided in the fourth embodiment is applied to the mirror server. The specific flow shown in fig. 7 will be described in detail below.
Step 701, the mirror image server starts a dynamic host configuration protocol service and a simple file transfer protocol service through system cloning software.
Exemplarily, before step 701, system data sent by the board computer may also be received.
Step 702, the target sends an IP address assignment request to the dhcp service of the mirror server.
Step 703, the dynamic host configuration protocol service of the mirror server allocates an IP address to the target machine and sends the IP address to the target machine.
Step 704, the target sends a bootstrap acquisition request to the trivial file transfer protocol service of the mirror server.
Step 705, the trivial file transfer protocol service of the mirror server sends the bootstrap program to the target machine.
Step 706, the target sends a system configuration file acquisition request to the trivial file transfer protocol service of the mirror server.
In step 707, the image server sends the system configuration file to the target machine.
At step 708, the target machine sends an installation script acquisition request to the image server.
Step 709, the image server sends an installation script to the target machine.
Step 710, the target machine executes the system configuration file through the installation script based on the bootstrap program to create an EFI system partition and a GPT partition.
And 711, acquiring an image file from the image server by the target machine, and installing the image file, wherein the image file comprises system data to be cloned.
In step 712, the target machine writes the information related to the EFI system partition into the boot configuration file of the operating system.
For other details of this embodiment, reference may be made to the description in the methods provided in embodiment two and embodiment four, and details are not described herein again.
Furthermore, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the system cloning method in the above-mentioned method embodiment.
The computer program product of the system cloning method provided in the embodiment of the present application includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the system cloning method in the above method embodiment, which may be specifically referred to in the above method embodiment, and details are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the 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.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of system cloning, comprising:
sending an IP address allocation request to a dynamic host configuration protocol service of a mirror image 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 comprising: a bootstrap program, a system configuration file and an installation script;
executing the system configuration file based on the bootstrap program through the installation script to create an extensible firmware interface system partition and a globally unique identification disk partition table partition;
acquiring a mirror image file from the mirror image server, and installing the mirror image file, wherein the mirror image file comprises system data to be cloned;
and writing the related information of the extensible firmware interface system partition into an operating system starting boot configuration file.
2. The method according to claim 1, wherein the boot program includes a driver of the globally and uniquely identified disk partition table partition and a driver of the extensible firmware interface system partition, and the system configuration file includes a globally and uniquely identified disk partition table partition configuration item and an extensible firmware interface system partition configuration item; the executing the system configuration file by the installation script based on the bootstrap program to create an extensible firmware interface system partition and a globally unique identification disk partition table partition includes:
executing an extensible firmware interface system partition configuration item in the system configuration file according to the drive of the extensible firmware interface system partition in the boot program through the installation script so as to perform extensible firmware interface system partition;
and executing the configuration items of the globally unique identification disk partition table in the system configuration file according to the drive of the globally unique identification disk partition table in the bootstrap program through the installation script so as to perform globally unique identification disk partition table partitioning.
3. The method of claim 1, wherein writing information about the extensible firmware interface system partition into an operating system boot configuration file comprises:
loading the address of the system partition of the extensible firmware interface to a boot sector to obtain boot information of the system partition of the extensible firmware interface;
and writing the boot information of the system partition of the extensible firmware interface into the boot configuration file of the operating system.
4. The method according to any one of claims 1 to 3, wherein writing information about the extensible firmware interface system partition into an operating system boot configuration file comprises:
sending a network configuration script acquisition request to a network service of the mirror image server to acquire a network configuration script;
and writing the related information of the extensible firmware interface system partition into an operating system starting boot configuration file according to the network configuration script.
5. The method according to any one of claims 1-3, wherein the obtaining the clone file from the mirror server comprises:
sending a bootstrap program acquisition request to a simple file transfer protocol service of the mirror image server to acquire a bootstrap program;
sending a system configuration file acquisition request to a simple file transfer protocol service of the mirror image server to acquire a system configuration file;
and obtaining the installation script from the mirror image server.
6. A method of system cloning, comprising:
starting a dynamic host configuration protocol service through 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 for the target machine;
sending a clone file to the target machine, the clone file comprising: the system configuration file is used for the target machine to execute the system configuration file through the installation script on the basis of the bootstrap program so as to create an extensible firmware interface system partition and a globally unique identification disk partition table partition;
and sending an image file to the target machine, wherein the image file comprises system data to be cloned, and the image file is used for the target machine to install.
7. A system cloning device, comprising:
the first request module is used for sending an IP address allocation request to a dynamic host configuration protocol service of a mirror image server so as to obtain an IP address allocated by the dynamic host configuration protocol service;
an obtaining module, configured to obtain a clone file from the mirror image server, where the clone file includes: a bootstrap program, a system configuration file and an installation script;
the creating module is used for executing the system configuration file on the basis of the bootstrap program through the installation script so as to create an extensible firmware interface system partition and a globally unique identification disk partition table partition;
the installation module is used for acquiring a mirror image file from the mirror image server and installing the mirror image file, wherein the mirror image file comprises system data to be cloned;
and the writing module is used for writing the related information of the extensible firmware interface system partition into an operating system starting boot configuration file.
8. A system cloning device, comprising:
the starting module is used for starting the dynamic host configuration protocol service through the system cloning software;
the first sending module is 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 for the target machine;
a second sending module, configured to send a clone file to the target machine, where the clone file includes: the system configuration file is used for the target machine to execute the system configuration file through the installation script on the basis of the bootstrap program so as to create an extensible firmware interface system partition and a globally unique identification disk partition table partition;
and the third sending module is used for sending an image file to the target machine, wherein the image file comprises system data to be cloned, and the image file is used for the target machine to install.
9. An electronic device, comprising: a processor, a memory storing machine-readable instructions executable by the processor, the machine-readable instructions when executed by the processor performing the steps of the method of any of claims 1 to 6 when the electronic device is run.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, is adapted to carry out the steps of the method according to any one of claims 1 to 6.
CN202011419768.4A 2020-12-03 2020-12-03 System cloning method, device, electronic equipment and computer readable storage medium Pending CN112527328A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011419768.4A CN112527328A (en) 2020-12-03 2020-12-03 System cloning method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011419768.4A CN112527328A (en) 2020-12-03 2020-12-03 System cloning method, device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112527328A true CN112527328A (en) 2021-03-19

Family

ID=74998030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011419768.4A Pending CN112527328A (en) 2020-12-03 2020-12-03 System cloning method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112527328A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377398A (en) * 2021-06-09 2021-09-10 南宁市研祥特种计算机软件有限公司 Operating system upgrading method
CN114070841A (en) * 2021-09-29 2022-02-18 浪潮软件科技有限公司 Server filling method, device, equipment and product
CN114138350A (en) * 2021-11-18 2022-03-04 锐捷网络股份有限公司 Installation method and device of network operating system
CN114866517A (en) * 2022-05-16 2022-08-05 广州高专资讯科技有限公司 Installation file execution method and device and storage medium
CN117555605A (en) * 2024-01-11 2024-02-13 北京开源芯片研究院 Operating system starting method and device, electronic equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777981A (en) * 2014-01-13 2014-05-07 中南大学 Multi-operation-system remote loading implementation method suitable for X86 framework
US20150235030A1 (en) * 2014-02-18 2015-08-20 Dell Products, Lp Method for Processing UEFI Protocols and System Therefor
CN107526618A (en) * 2017-09-04 2017-12-29 深圳互联先锋科技有限公司 system installation method and device
CN107608681A (en) * 2017-09-14 2018-01-19 紫光华山信息技术有限公司 Installation method of operating system, device and server
CN110399159A (en) * 2019-07-23 2019-11-01 广州夏达信息科技有限公司 Dispositions method, device, computer equipment and the storage medium of operating system
US20200272445A1 (en) * 2016-09-23 2020-08-27 New H3C Information Technologies Co., Ltd. Installation of operating system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777981A (en) * 2014-01-13 2014-05-07 中南大学 Multi-operation-system remote loading implementation method suitable for X86 framework
US20150235030A1 (en) * 2014-02-18 2015-08-20 Dell Products, Lp Method for Processing UEFI Protocols and System Therefor
US20200272445A1 (en) * 2016-09-23 2020-08-27 New H3C Information Technologies Co., Ltd. Installation of operating system
CN107526618A (en) * 2017-09-04 2017-12-29 深圳互联先锋科技有限公司 system installation method and device
CN107608681A (en) * 2017-09-14 2018-01-19 紫光华山信息技术有限公司 Installation method of operating system, device and server
CN110399159A (en) * 2019-07-23 2019-11-01 广州夏达信息科技有限公司 Dispositions method, device, computer equipment and the storage medium of operating system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
金剑忠: "在UEFI引导+GPT分区模式安装Win10", 电脑知识与技术, vol. 12, no. 25, 30 September 2016 (2016-09-30), pages 181 - 182 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377398A (en) * 2021-06-09 2021-09-10 南宁市研祥特种计算机软件有限公司 Operating system upgrading method
CN114070841A (en) * 2021-09-29 2022-02-18 浪潮软件科技有限公司 Server filling method, device, equipment and product
CN114070841B (en) * 2021-09-29 2023-07-14 浪潮软件科技有限公司 Server filling method, device, equipment and product
CN114138350A (en) * 2021-11-18 2022-03-04 锐捷网络股份有限公司 Installation method and device of network operating system
CN114866517A (en) * 2022-05-16 2022-08-05 广州高专资讯科技有限公司 Installation file execution method and device and storage medium
CN117555605A (en) * 2024-01-11 2024-02-13 北京开源芯片研究院 Operating system starting method and device, electronic equipment and readable storage medium
CN117555605B (en) * 2024-01-11 2024-04-05 北京开源芯片研究院 Operating system starting method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN112527328A (en) System cloning method, device, electronic equipment and computer readable storage medium
US6816963B1 (en) Platform level initialization using an image generated automatically by a remote server based upon description automatically generated and transmitted thereto by a processor-based system
US6810478B1 (en) System for remote booting of muntliple operating systems using chained bootstrap mechanism in a network
US7363480B1 (en) Method, system, and computer-readable medium for updating the firmware of a computing device via a communications network
US8185727B2 (en) Method of using an information handling system having a boot file, and an information handling system and machine-executable code for carrying out the method
US20110296159A1 (en) Pxe server and electronic device and method of diskless booting electronic device
US20150154033A1 (en) Computer system and boot method thereof
CN110737479A (en) method for starting operating system without disk, server and readable storage medium
CN109960678B (en) Naming processing method and computer processing device
CN113835644B (en) Complete machine migration method, device, equipment and storage medium
US7631054B2 (en) Method and system for generating list of operating systems for a target device
CN112306581B (en) Method and medium for managing Basic Input Output System (BIOS) configuration by baseboard management controller
US8140683B2 (en) Method and system for selecting an operating system at user login on a target device
US20160026485A1 (en) System and method of loading virtual machines
US10491736B2 (en) Computer system and method thereof for bluetooth data sharing between UEFI firmware and OS
CN111433747A (en) Virtual memory for loading an operating system
CN111061496A (en) PXE installation method and device for Linux operating system
CN102591691B (en) Hard disk startup method and the os starting loading method based on BIOS
US11256519B2 (en) Using a single process to install a UEFI-supported OS or a non-UEFI supported OS on a hardware platform
CN112328312A (en) Method and equipment for realizing diskless startup of bare computer equipment
US20200364040A1 (en) System and Method for Restoring a Previously Functional Firmware Image on a Non-Volatile Dual Inline Memory Module
US20090198842A1 (en) System And Method For Identifying Lost/Stale Hardware In A Computing System
CN111683145B (en) Configuration method of client device, electronic device and medium
CN115291951A (en) UEFI (unified extensible firmware interface) starting method and device, electronic equipment and storage medium
CN114296810A (en) Operating system migration method, device, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20211008

Address after: 100089 building 36, courtyard 8, Dongbeiwang West Road, Haidian District, Beijing

Applicant after: Dawning Information Industry (Beijing) Co.,Ltd.

Applicant after: ZHONGKE SUGON INFORMATION INDUSTRY CHENGDU Co.,Ltd.

Address before: Building 36, yard 8, Dongbei Wangxi Road, Haidian District, Beijing

Applicant before: Dawning Information Industry (Beijing) Co.,Ltd.

TA01 Transfer of patent application right