CN114265628B - Operating system deployment method, device, electronic equipment, storage medium and system - Google Patents

Operating system deployment method, device, electronic equipment, storage medium and system Download PDF

Info

Publication number
CN114265628B
CN114265628B CN202111577985.0A CN202111577985A CN114265628B CN 114265628 B CN114265628 B CN 114265628B CN 202111577985 A CN202111577985 A CN 202111577985A CN 114265628 B CN114265628 B CN 114265628B
Authority
CN
China
Prior art keywords
instruction
partition
backup
restoration
operating system
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.)
Active
Application number
CN202111577985.0A
Other languages
Chinese (zh)
Other versions
CN114265628A (en
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.)
Dawning Information Industry Co Ltd
Original Assignee
Dawning Information Industry 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 Co Ltd filed Critical Dawning Information Industry Co Ltd
Priority to CN202111577985.0A priority Critical patent/CN114265628B/en
Publication of CN114265628A publication Critical patent/CN114265628A/en
Application granted granted Critical
Publication of CN114265628B publication Critical patent/CN114265628B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a deployment method and device of an operating system, electronic equipment, a storage medium and a system. The method comprises the following steps: after receiving a deployment request of an operating system to be restored, entering a restoration pe system; acquiring a reduction script from a reduction pe system; respectively executing a partition instruction, a restoration tool downloading and installing instruction, a partition file downloading instruction, a restoration instruction and a switched partition restoration instruction in a restoration script, and restoring the first system backup file to a new hard disk so as to realize restoration deployment of an operating system to be restored; the first system backup file is obtained by backing up an operating system to be restored through any client side in communication connection with the server side in advance and is stored in the server side. According to the application, the restoration script is acquired through the pe system of the server, and the restoration of the operating system is automatically executed according to the restoration script, so that the efficiency of operating system deployment is improved.

Description

Operating system deployment method, device, electronic equipment, storage medium and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for deploying an operating system, an electronic device, a storage medium, and a system.
Background
With the continuous development of Linux operating systems, linux operating systems have been increasingly used, and backup and restoration of Linux systems are an important technology. Meanwhile, with the diversity of user demands, various operating systems have been derived, for example: release debian, ubuntu of linux, kylin, chinese geneva.
In the prior art, the method for backing up and restoring the operating system on the terminal comprises the following steps: the method of hard disk cloning by dd instruction requires manual whole-course participation, and dd cloning time is long, so that the method is low in efficiency.
Disclosure of Invention
The embodiment of the application aims to provide a deployment method, a device, electronic equipment, a storage medium and a system for an operating system, which are used for improving the efficiency of deploying the operating system.
In a first aspect, an embodiment of the present application provides a deployment method of an operating system, applied to a target client communicatively connected to a server, where the method includes: after receiving a restoration request of an operating system to be restored, entering a restoration pre-installation environment pe system; acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a backup file downloading instruction, a restoring instruction and a swap partition restoring instruction; the partition instruction, the restoration tool downloading and installing instruction, the partition file downloading instruction, the restoration instruction and the exchange partition restoration instruction are respectively executed, and a first system backup file is restored to a new hard disk so as to realize restoration and deployment of the operating system to be restored; the first system backup file is obtained by backing up the operating system to be restored through any client side in communication connection with the server side in advance and is stored in the server side.
According to the embodiment of the application, the restoration script is obtained through the pe system of the server, and the restoration of the operating system is automatically executed according to the restoration script, so that the manual participation is not needed, and the efficiency of deploying the operating system is improved.
In any embodiment, the executing the partition instruction, the restore tool download installation instruction, the partition file download instruction, the restore instruction, and the swap partition restore instruction, respectively, restores the first system backup file to the new hard disk, including:
executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk;
executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address;
Executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system;
And executing a restoring instruction to restore the first system backup file to the new hard disk.
According to the embodiment of the application, the partition instruction, the restoration tool downloading and installing instruction, the partition file downloading instruction, the restoration instruction and the exchange partition restoration designation are automatically executed, so that the restoration of the automatic execution operating system is realized, and the efficiency of operating system deployment is improved.
In any embodiment, the partitioning the hard disk of the client includes: and obtaining a partition format of the backup terminal, and partitioning the hard disk of the client according to the partition format. The embodiment of the application partitions the client according to the partition format of the backup terminal, supports various partition formats and effectively improves the backup and restore speed.
In any embodiment, the new hard disk includes a main partition and a swap partition, and the first system backup file includes a first main partition backup file and a first swap partition backup file; the restoring the first system backup file to the new hard disk includes: and restoring the first main partition backup file to the main partition, and restoring the first exchange partition backup file to the exchange partition. Because the main partition and the exchange partition have different commands used in backup restoration, the main partition and the exchange partition can be restored respectively, so that the purpose of restoring the client can be achieved.
In any embodiment, the method further comprises: after receiving a backup instruction for backing up an operating system to be backed up, entering a backup pre-installation environment pe system; acquiring a backup script corresponding to the operating system to be backed up from the backup pe system; the backup script comprises a backup tool downloading and installing instruction, a main partition backup instruction and a swap partition backup instruction; executing the backup tool downloading and installing instruction, and downloading and installing the backup tool from the server; executing the main partition backup instruction, and backing up the main partition by using the backup tool to generate a second main partition backup file; executing the exchange partition backup instruction, acquiring a unique identifier UUID of the exchange partition, and generating a second exchange partition backup file according to the UUID; and taking the second main partition backup file and the second exchange partition backup file as second system backup files of the operating system to be backed up, and uploading the second system backup files to the server. The embodiment of the application realizes the deployment of the operating system in a backup and restore mode, restores the configured master disk to a new hard disk, is suitable for restoring various operating systems, and improves the efficiency of operating system deployment for the case that batch clients need to deploy the operating systems.
In any embodiment, after receiving a restore request for an operating system to be restored, entering a restore pe system includes: after receiving a restoration request of an operating system to be restored, judging whether the operating system to be restored is backed up, and entering the restoration pe system if the operating system to be restored is backed up. The embodiment of the application ensures the correct restoration of the operating system by judging whether the operating system is backed up or not, and reduces the number of useless accesses to the pe system.
In any embodiment, before receiving the deployment request for the operating system to be restored, the method further comprises: and sending an environment configuration request to a server side, so that the server side installs and configures Dynamic Host Configuration Protocol (DHCP) service, simple file transfer protocol (TFPT) service, hypertext transfer protocol (HTTP) service and Network File System (NFS) service according to the environment configuration request. The embodiment of the application ensures the correct restoration of the operating system through the configuration of the service end environment.
In a second aspect, an embodiment of the present application provides a deployment apparatus for an operating system, including: the request receiving module is used for entering the restore pe system after receiving the deployment request of the operating system to be restored; the script acquisition module is used for acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction; the restoration module is used for respectively executing the partition instruction, the restoration tool downloading and installing instruction, the partition file downloading instruction, the restoration instruction and the exchange partition restoration instruction, and restoring the first system backup file to a new hard disk so as to realize restoration and deployment of the operating system to be restored; the first system backup file is obtained by backing up the operating system to be restored through any client side in communication connection with the server side in advance and is stored in the server side.
In a third aspect, an embodiment of the present application provides an electronic device, including: the device comprises a processor, a memory and a bus, wherein the processor and the memory complete communication with each other through the bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of the first aspect.
In a fourth aspect, embodiments of the present application provide a non-transitory computer readable storage medium comprising: the non-transitory computer-readable storage medium stores computer instructions that cause the computer to perform the method of the first aspect.
In a fifth aspect, an embodiment of the present application provides a backup restoration system, where a server and a plurality of clients are connected to the server in a communication manner; wherein: the plurality of clients are each capable of performing the method as described in the first aspect.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the embodiments of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a service end environment deployment method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart of a backup method of an operating system according to an embodiment of the present application;
FIG. 3 is a flowchart of a deployment method of an operating system according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a backup and restore method of an operating system according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a deployment device of an operating system according to an embodiment of the present application;
fig. 6 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic diagram of a backup restoring system architecture according to an embodiment of the present application.
Detailed Description
In order to improve efficiency of deploying an operating system at a client, an embodiment of the present application provides a deployment method of an operating system, where the method is applied to a client communicatively connected to a server, and it can be understood that the client communicatively connected to the server may include a plurality of clients, that is, may implement batch deployment of the operating system. For example: after the server backs up the operating system, the operating system may be deployed to a plurality of clients communicatively connected thereto.
Before describing the method of the embodiment of the present application, concepts related to the embodiment of the present application will be explained:
the pre-boot execution environment (Preboot eXecution Environment, PXE), also referred to as a pre-execution environment, provides a mechanism for booting a computer using a network interface (Network Interface). This mechanism allows the computer to boot independently of the local data storage device (e.g., hard disk) or the locally installed operating system.
The Linux Pe system, also commonly called Live CD, is a complete bootable small Linux system, and includes a system that can be directly loaded into a memory (RAM) from a device such as a CD, a U disk, a network, etc., and that does not run from a disk of the client itself, nor does it rely on the disk itself. Almost every Linux distribution will provide a trial desktop of Live CDs, which can be used as a pre-installed environment (preinstallation environment, pe) system.
The dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) is a network protocol for a local area network. The server controls a section of IP address range, and when a client logs in the server, the client can automatically obtain the IP address and the subnet mask allocated by the server. By default, DHCP is a service component of the Windows Server operating system Windows that is not automatically installed by the system, and also requires an administrator to manually install and perform necessary configuration.
The simple file transfer Protocol (TRIVIAL FILE TRANSFER Protocol, TFTP) is a Protocol in the TCP/IP Protocol family for simple file transfer between a client and a server, and provides a file transfer service with little complexity and little overhead, with a port number of 69.
The hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) is a simple request-response protocol that typically runs on top of the transmission control protocol (Transmission Control Protocol, TCP). It specifies what messages the client might send to the server and what responses it gets. The header of the request and response messages are given in ASCII code form; and the message content has a format similar to Multipurpose Internet Mail Extensions (MIME).
The Network file system (Network FILE SYSTEM, NFS), a UNIX presentation layer protocol (presentation layer protocol) developed by SUN corporation, enables users to access files elsewhere on the Network just as if they were using their own computer.
FSARCHIVER disk partition cloning tools, which are a system tool, can save the contents of a file system into a compressed archive file. The file system may be restored on partitions of different sizes and may be restored on different file systems.
Partclone is free-open source software developed by the developer of Clonezilla for creating and cloning partition images. It provides a tool for users to backup and restore used partitions.
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Before the deployment of the operating system on the client, the environment of the server needs to be configured in advance, and the configuration method is as shown in fig. 1, and includes:
Step 101: the server linux system is installed DHCP, TFTP, HTTP, NFS for service; it will be appreciated that if the service end is already installed with the service, it may not be installed any more.
Step 102: configuring a DHCP service, distributing an IP address to a client and designating a PXE guide file path;
Step 103: configuring an HTTP shared directory, creating a folder, fixedly storing a system backup file path, creating a folder under the shared directory, and fixedly storing fsarchiver or partclone system backup restoration tool paths;
Step 104: configuring an NFS shared directory, uploading the shared directory to backup and restore the pe system mirror image, wherein the pe system mirror image can use any linux desktop system;
step 105: configuring a TFTP shared directory, uploading a PXE start file configuration menu and backing up and restoring a pe system guide file by the shared directory; the configuration menu designates a pe system guide file path and a mirror source path;
step 106: after the configuration is completed, all the services are started, the firewall is closed, and the configuration of the server is completed.
After the configuration of the server environment is completed, the backup and restoration of the operating system at the client can be started. It should be noted that, if an operating system is to be restored, it is assumed that the operating system is to be backed up first, fig. 2 is a schematic flow chart of an operating system backup method provided by an embodiment of the present application, as shown in fig. 2, it should be noted that an execution body of an operating system to be backed up may be one of a plurality of clients, and the client of the backup operating system is used as a master disc, and the embodiment of the present application is called a backup terminal, and the method includes:
step 201: and installing an operating system to be backed up on the backup terminal through an optical drive or a USB flash disk.
Step 202: and after receiving a backup instruction for backing up the operating system to be backed up, entering a backup pe system.
Step 203: acquiring a backup script corresponding to the operating system to be backed up from the backup pe system; the backup script comprises a backup tool downloading and installing instruction, a main partition backup instruction and a swap partition backup instruction; and storing a backup script corresponding to the operating system to be backed up in the backup pe system.
Step 204: executing the backup tool downloading and installing instruction, and downloading and installing the backup tool from the server; the backup tool downloading and installing instructions comprise a backup tool downloading instruction and a backup tool installing instruction, wherein the backup tool downloading instruction can be wget instructions, the backup tool installing instruction can be dpkg instructions, fsarchiver/partclone backup tools can be downloaded and installed from the http shared directory of the server side by executing wget instructions, and then fsarchiver/partclone backup tools are installed by dpkg instructions.
Step 205: and executing the main partition backup instruction, and backing up the main partition by using the backup tool to generate a second main partition backup file.
Step 206: executing the exchange partition backup instruction, acquiring a unique identification code (Universally Unique Identifier, UUID) of the exchange partition, and generating a first exchange partition backup file according to the UUID; the swap partition refers to a swap partition, and the UUID is a unique identification of the swap partition.
Step 207: and taking the second main partition backup file and the second exchange partition backup file as second system backup files of the operating system to be backed up, and uploading the second system backup files to the server. And the server stores the second system backup file under the appointed directory, so that the backup of the operating system to be backed up is completed.
According to the embodiment of the application, the operating system is backed up in advance, so that the client can restore the operating system as long as the client can communicate with the server, and the efficiency of deploying the operating system is improved for the case that batch clients all need to deploy the operating system.
Fig. 3 is a flowchart of a deployment method of an operating system according to an embodiment of the present application, as shown in fig. 3, it should be noted that, before executing the method, the backup scheme of the operating system to be backed up according to the above embodiment is adopted in advance to backup the operating system to be restored, and the method includes:
Step 301: after receiving a restoration request of an operating system to be restored, the client starts a configuration menu selection interface through a network, selects to enter a restoration pe system, restores the system to be a system deployed by a server, and accesses a configuration menu of the server by keeping the network consistent with the server.
It should be noted that, after receiving the restore request of the operating system to be restored, it is determined whether the operating system to be restored is already backed up, and if so, the client is allowed to enter the restore pe system. Otherwise, prompting the user to pre-backup the operating system to be restored.
Step 302: acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a main partition restoring instruction and a swap partition restoring instruction. The restoring script corresponding to the operating system to be restored is stored in the restoring pe system, and it can be understood that the restoring script corresponding to other operating systems can also be stored in the restoring pe system, and after the restoring pe system is entered, the restoring script corresponding to the operating system to be restored is obtained according to the restoring request. The restoration script is used for automatically executing restoration of the operating system and comprises a partition creation instruction, a restoration tool downloading and installing instruction, a backup partition file downloading instruction, a main partition restoration instruction, a swap partition restoration instruction and the like.
Step 303: and executing the partition creation instruction, and partitioning the hard disk of the client to obtain a new hard disk. The partition instruction, namely the fdisk instruction, is used for partitioning the hard disk of the client, and the partition format of the partition instruction is the same as the hard disk partition format of the backup terminal for backing up the operating system to be restored. It should be noted that the purpose of partitioning the hard disk of the client according to the partition format of the backup terminal is to ensure that the backed-up operating system can be successfully restored to the terminal.
Step 304: executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises a path of the restoration tool, and downloading and installing the restoration tool from the server according to the address. The restoration tool downloading and installing instructions comprise a restoration tool downloading instruction and a restoration tool installing instruction, wherein the restoration tool downloading instruction can be wget instructions, the restoration tool installing instruction can be dpkg instructions, the wget instructions comprise addresses for storing the restoration tool by a server, when the client executes wget instructions, the restoration tool is downloaded fsarchiver/partclone from a hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP) shared directory of the server, and the restoration tool is installed through dpkg instructions to prepare for restoring an operating system.
Step 305: executing a backup file downloading instruction, downloading a first system backup file from the server through the wget instruction, and storing the first system backup file in the restore pe system. The backup file downloading instruction is used for downloading the first system backup file from the server side and storing the downloaded first system backup file into the current pe system. It should be noted that the first system backup file may be the same as the second system backup file described in the above embodiment. That is, the first system backup file is also obtained by backup in the above-described embodiment.
Step 306: and executing a restoring instruction to restore the first system backup file to the new hard disk so as to realize restoring deployment of the operating system to be restored. When the client executes the restore instruction, the first system backup file is restored to the new hard disk of the client by using the installed fsarchiver/partclone restore tool.
According to the embodiment of the application, the restoration script is obtained through the pe system of the server, and the restoration of the operating system is automatically executed according to the restoration script, so that the manual participation is not needed, and the efficiency of deploying the operating system is improved.
On the basis of the above embodiment, the new hard disk includes a main partition and an exchange partition, and the first system backup file includes a first main partition backup file and a first exchange partition backup file;
the restoring the first system backup file to the new hard disk includes:
and restoring the first main partition backup file to the main partition, and restoring the first exchange partition backup file to the exchange partition.
In a specific implementation process, since the restoration modes of the main partition and the exchange partition are different, the fsarchiver/partclone restoration tool can only complete restoration of the first main partition, and therefore, when a restoration instruction is executed, the fsarchiver/partclone restoration tool is adopted to restore the backup file of the first main partition to the main partition.
The first swap partition backup file comprises a UUID value of a swap partition, and the specific method for restoring the first swap partition backup file to the swap partition is to write the UUID value of the backed-up swap into the swap partition.
The embodiment of the application realizes the deployment of the operating system in a backup reduction mode, reduces the configured master disc to a new hard disk, and is suitable for the deployment of various operating systems.
Fig. 4 is a schematic flow chart of a backup and restore method of an operating system according to an embodiment of the present application, as shown in fig. 4, where the method includes:
Step 401: the client communicates with the service end environment network;
step 402: judging whether to perform system backup; if the system backup is performed, executing step 403, otherwise executing step 408;
Step 403: the backup client is applicable to CD-ROM drive or U disk, and an operating system is firstly installed as a master disk;
step 404: the backup client network is started to enter a backup pe system;
Step 405: downloading fsarchive/partclone backup tools from the service environment and installing the tools through wget instructions;
Step 406: grabbing a swap partition UUID through a swap partition backup instruction blkid instruction;
Step 407: uploading the backup file of the system under the appointed directory of the server environment;
Step 408: judging whether to perform system reduction; executing step 409 if system restoration is performed, otherwise ending;
Step 409: the target client network starts up and enters a recovery pe system; it should be noted that the target client is typically a different terminal than the backup client;
Step 410: partitioning the hard disk through fdisk instructions, wherein the partitioning format is the same as that of the backup system partition;
Step 411: downloading fsarchive/partclone reduction tools from the service environment and installing the tools through wget instructions;
step 412: downloading the backed-up system partition file from the server-side environment to the current pe system through wget instructions;
step 413: starting system restoration through fsarchive/partclone restoration tools, and restoring the backed-up system partition to a new hard disk;
Step 414: writing the backup system swap UUID value into the new swap partition through mkswap instructions;
step 415: and (5) automatically restarting after the restoration is completed, and completing the system installation.
Fig. 5 is a schematic structural diagram of a deployment apparatus of an operating system according to an embodiment of the present application, where the apparatus may be a module, a program segment, or a code on an electronic device. It should be understood that the apparatus corresponds to the above embodiment of the method of fig. 3, and is capable of executing the steps involved in the embodiment of the method of fig. 3, and specific functions of the apparatus may be referred to in the above description, and detailed descriptions thereof are omitted herein as appropriate to avoid redundancy. The device comprises: a request receiving module 501, a script obtaining module 502 and a restoring module 503, wherein:
the request receiving module 501 is configured to enter a restore pe system after receiving a deployment request of an operating system to be restored;
the script acquisition module 502 is configured to acquire a restore script corresponding to the operating system to be restored from the restore pe system; the restoring script comprises a partition creating instruction, a restoring tool downloading and installing instruction, a backup file downloading instruction, a restoring instruction and a switching partition restoring instruction;
The restoration module 503 is configured to execute the partition instruction, the restoration tool download installation instruction, the partition file download instruction, the restoration instruction, and the swap partition restoration instruction, and restore the first system backup file to the new hard disk, so as to implement restoration deployment of the operating system to be restored; the first system backup file is obtained by backing up the operating system to be restored through any client side in communication connection with the server side in advance and is stored in the server side.
On the basis of the above embodiment, the restoration module 503 is specifically configured to:
executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk;
executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address;
Executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system;
And executing a restoring instruction to restore the first system backup file to the new hard disk.
On the basis of the above embodiment, the restoration module 503 is specifically configured to:
And obtaining a partition format of the backup terminal, and partitioning the hard disk of the client according to the partition format.
On the basis of the above embodiment, the new hard disk includes a main partition and an exchange partition, and the first system backup file includes a first main partition backup file and a first exchange partition backup file;
The reduction module 503 is specifically configured to:
and restoring the first main partition backup file to the main partition, and restoring the first exchange partition backup file to the exchange partition.
On the basis of the above embodiment, the apparatus further includes a backup module configured to:
after receiving a backup instruction for backing up an operating system to be backed up, entering a backup pe system;
acquiring a backup script corresponding to the operating system to be backed up from the backup pe system; the backup script comprises a backup tool downloading and installing instruction, a main partition backup instruction and a swap partition backup instruction;
executing the backup tool downloading and installing instruction, and downloading and installing the backup tool from the server;
Executing the main partition backup instruction, and backing up the main partition by using the backup tool to generate a first main partition backup file;
executing the exchange partition backup instruction, acquiring a UUID of the exchange partition, and generating a first exchange partition backup file according to the UUID;
And taking the first main partition backup file and the second exchange partition backup file as second system backup files of the operating system to be backed up, and uploading the second system backup files to the server.
Based on the above embodiment, the request receiving module 501 is specifically configured to:
After receiving a deployment request of an operating system to be restored, judging whether the operating system to be restored is backed up, and entering the restore pe system if the operating system to be restored is backed up.
On the basis of the above embodiment, the apparatus further includes an environment configuration module for:
And sending an environment configuration request to a server side, so that the server side installs and configures Dynamic Host Configuration Protocol (DHCP) service, simple file transfer protocol (TFPT) service, hypertext transfer protocol (HTTP) service and Network File System (NFS) service according to the environment configuration request.
Fig. 6 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present application, as shown in fig. 6, where the electronic device includes: a processor (processor) 601, a memory (memory) 602, and a bus 603; wherein,
The processor 601 and the memory 602 perform communication with each other through the bus 603;
The processor 601 is configured to invoke program instructions in the memory 602 to perform the methods provided in the above method embodiments, for example, including: after receiving a deployment request of an operating system to be restored, entering a restoration pe system; acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction; executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk; executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address; executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system; and executing a restoring instruction to restore the first system backup file to the new hard disk so as to realize restoring deployment of the operating system to be restored.
The processor 601 may be a general-purpose processor including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. Which may implement or perform the various methods, steps, and logical blocks disclosed in embodiments of the application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The Memory 602 may include, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), and the like.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising: after receiving a deployment request of an operating system to be restored, entering a restoration pe system; acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction; executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk; executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address; executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system; and executing a restoring instruction to restore the first system backup file to the new hard disk so as to realize restoring deployment of the operating system to be restored.
The present embodiment provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the methods provided by the above-described method embodiments, for example, including: after receiving a deployment request of an operating system to be restored, entering a restoration pe system; acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction; executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk; executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address; executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system; and executing a restoring instruction to restore the first system backup file to the new hard disk so as to realize restoring deployment of the operating system to be restored.
Fig. 7 is a schematic diagram of a backup-restore system according to an embodiment of the present application, as shown in fig. 7, where the system includes a server 701 and a plurality of clients 702, and each client 702 is communicatively connected to the server 701 through a network 703.
The network 703 may include a wired network, a wireless network, a fiber optic network, a telecommunication network, an intranet, the internet, a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), a wireless local area network (Wireless Local Area Networks, WLAN), a metropolitan area network (Metropolitan Area Network, MAN), a wide area network (Wide Area Network, WAN), a public switched telephone network (Public Switched Telephone Network, PSTN), a bluetooth network, a ZigBee network, a Near Field Communication (NFC) network, or the like, or any combination thereof.
It should be noted that, for convenience of drawing, only two clients are shown in fig. 7, and in practical application, the number of clients may be more, and the embodiment of the present application does not limit the number of clients. Each client is capable of performing the method embodiments described above.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
In this document, 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.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (9)

1. A method for deploying an operating system, the method being applied to a target client communicatively connected to a server, the method comprising:
After receiving a restoration request of an operating system to be restored, entering a restoration pre-installation environment pe system;
Acquiring a reduction script corresponding to the operating system to be reduced from a reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction;
The partition instruction, the restoration tool downloading and installing instruction, the partition file downloading instruction, the restoration instruction and the exchange partition restoration instruction are respectively executed, and a first system backup file is restored to a new hard disk so as to realize restoration and deployment of the operating system to be restored; the first system backup file is obtained by backing up the operating system to be restored through any client side in communication connection with the server side in advance and is stored in the server side;
After receiving a restoration request of an operating system to be restored, entering a restoration pre-installation environment pe system, wherein the restoration pre-installation environment pe system comprises:
after receiving a restoration request of the operating system to be restored, judging whether the operating system to be restored is backed up, and if so, allowing the client to enter a restoration pe system;
The new hard disk comprises a main partition and an exchange partition, and the first system backup file comprises a first main partition backup file and a first exchange partition backup file;
The restoring the first system backup file to the new hard disk includes:
Restoring the first main partition backup file to the main partition, and restoring the first exchange partition backup file to the exchange partition;
the first exchange partition backup file includes a UUID value of a unique identifier of an exchange partition, and the first exchange partition backup file is restored to the exchange partition, including:
and writing the UUID value of the backed-up exchange partition into the exchange partition.
2. The method of claim 1, wherein the separately executing the partition instruction, the restore tool download install instruction, the partition file download instruction, the restore instruction, and the swap partition restore instruction, restores the first system backed up file to the new hard disk, comprises:
executing the partitioning instruction, and partitioning the hard disk of the client to obtain a new hard disk;
executing a restoration tool downloading and installing instruction, wherein the restoration tool downloading and installing instruction comprises an address of a restoration tool, and downloading and installing the restoration tool from the server according to the address;
Executing a partition file downloading instruction, downloading a first system backup file from the server side, and storing the first system backup file in the restore pe system;
And executing a restoring instruction to restore the first system backup file to the new hard disk.
3. The method of claim 2, wherein partitioning the hard disk of the client comprises:
And obtaining a partition format of the backup terminal, and partitioning the hard disk of the client according to the partition format.
4. The method according to claim 1, wherein the method further comprises:
after receiving a backup instruction for backing up an operating system to be backed up, entering a backup pre-installation environment pe system;
acquiring a backup script corresponding to the operating system to be backed up from the backup pe system; the backup script comprises a backup tool downloading and installing instruction, a main partition backup instruction and a swap partition backup instruction;
executing the backup tool downloading and installing instruction, and downloading and installing the backup tool from the server;
executing the main partition backup instruction, and backing up the main partition by using the backup tool to generate a second main partition backup file;
executing the exchange partition backup instruction, acquiring a unique identifier UUID of the exchange partition, and generating a second exchange partition backup file according to the UUID;
and taking the second main partition backup file and the second exchange partition backup file as second system backup files of the operating system to be backed up, and uploading the second system backup files to the server.
5. The method of any of claims 1-4, wherein prior to receiving a deployment request to restore an operating system, the method further comprises:
And sending an environment configuration request to a server side, so that the server side installs and configures Dynamic Host Configuration Protocol (DHCP) service, simple file transfer protocol (TFPT) service, hypertext transfer protocol (HTTP) service and Network File System (NFS) service according to the environment configuration request.
6. A deployment apparatus for an operating system, comprising:
the request receiving module is used for entering the restore pe system after receiving the deployment request of the operating system to be restored;
The script acquisition module is used for acquiring a reduction script corresponding to the operating system to be reduced from the reduction pe system; the restoring script comprises a partition instruction, a restoring tool downloading and installing instruction, a partition file downloading instruction, a restoring instruction and a switching partition restoring instruction;
The restoration module is used for respectively executing the partition instruction, the restoration tool downloading and installing instruction, the partition file downloading instruction, the restoration instruction and the exchange partition restoration instruction, and restoring the first system backup file to a new hard disk so as to realize restoration and deployment of the operating system to be restored; the first system backup file is obtained by backing up the operating system to be restored through any client side in communication connection with a server side in advance and is stored in the server side;
the request receiving module is specifically configured to: after receiving a restoration request of the operating system to be restored, judging whether the operating system to be restored is backed up, and if so, allowing the client to enter a restoration pe system;
The new hard disk comprises a main partition and an exchange partition, and the first system backup file comprises a first main partition backup file and a first exchange partition backup file;
The reduction module is specifically used for:
restoring the backup file of the first main partition to the main partition;
And the first exchange partition backup file comprises a unique identifier UUID value of the exchange partition, and the UUID value of the backup exchange partition is written into the exchange partition.
7. An electronic device, comprising: a processor, a memory, and a bus, wherein,
The processor and the memory complete communication with each other through the bus;
The memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1-5.
8. A non-transitory computer readable storage medium storing computer instructions which, when executed by a computer, cause the computer to perform the method of any of claims 1-5.
9. The backup and restore system is characterized by comprising a server and a plurality of clients, wherein the server is respectively in communication connection with the clients; wherein:
each of the plurality of clients being capable of performing the method of any one of claims 1-5.
CN202111577985.0A 2021-12-22 2021-12-22 Operating system deployment method, device, electronic equipment, storage medium and system Active CN114265628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111577985.0A CN114265628B (en) 2021-12-22 2021-12-22 Operating system deployment method, device, electronic equipment, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111577985.0A CN114265628B (en) 2021-12-22 2021-12-22 Operating system deployment method, device, electronic equipment, storage medium and system

Publications (2)

Publication Number Publication Date
CN114265628A CN114265628A (en) 2022-04-01
CN114265628B true CN114265628B (en) 2024-05-28

Family

ID=80828645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111577985.0A Active CN114265628B (en) 2021-12-22 2021-12-22 Operating system deployment method, device, electronic equipment, storage medium and system

Country Status (1)

Country Link
CN (1) CN114265628B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546295A (en) * 2008-03-24 2009-09-30 上海梅山钢铁股份有限公司 Method for backing up and restoring data based on computer hard disc partitions
CN104615508A (en) * 2015-03-03 2015-05-13 浪潮电子信息产业股份有限公司 Method for recovering LVM configuration under Linux system
WO2017049828A1 (en) * 2015-09-25 2017-03-30 中兴通讯股份有限公司 Method, device and system for data processing based on linux
CN107066287A (en) * 2017-01-14 2017-08-18 郑州云海信息技术有限公司 The method and system of ESXI virtual machine automatic deployment installation systems
CN107391193A (en) * 2017-07-21 2017-11-24 郑州云海信息技术有限公司 A kind of client, the system and method for configuration server
CN107729183A (en) * 2017-10-12 2018-02-23 郑州云海信息技术有限公司 A kind of method and system backed up by FC agreements with recovering linux operating systems
CN109710377A (en) * 2018-12-14 2019-05-03 国云科技股份有限公司 A method of restoring kvm virtual machine in the distributed storage of failure
CN111786810A (en) * 2020-05-19 2020-10-16 中国科学院信息工程研究所 Automatic deployment method and system for large-scale test bed nodes
CN112948170A (en) * 2019-12-10 2021-06-11 中标软件有限公司 Method for realizing system power-down protection by using snapshot function of equipment mapping
CN113032032A (en) * 2021-05-21 2021-06-25 武汉深之度科技有限公司 System management method and device, computing equipment and readable storage medium
CN113282342A (en) * 2021-05-14 2021-08-20 北京首都在线科技股份有限公司 Deployment method, device, system, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11372731B2 (en) * 2019-12-13 2022-06-28 EMC IP Holding Company LLC System and method to enable file level recovery of virtual disks and dynamic disks

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101546295A (en) * 2008-03-24 2009-09-30 上海梅山钢铁股份有限公司 Method for backing up and restoring data based on computer hard disc partitions
CN104615508A (en) * 2015-03-03 2015-05-13 浪潮电子信息产业股份有限公司 Method for recovering LVM configuration under Linux system
WO2017049828A1 (en) * 2015-09-25 2017-03-30 中兴通讯股份有限公司 Method, device and system for data processing based on linux
CN107066287A (en) * 2017-01-14 2017-08-18 郑州云海信息技术有限公司 The method and system of ESXI virtual machine automatic deployment installation systems
CN107391193A (en) * 2017-07-21 2017-11-24 郑州云海信息技术有限公司 A kind of client, the system and method for configuration server
CN107729183A (en) * 2017-10-12 2018-02-23 郑州云海信息技术有限公司 A kind of method and system backed up by FC agreements with recovering linux operating systems
CN109710377A (en) * 2018-12-14 2019-05-03 国云科技股份有限公司 A method of restoring kvm virtual machine in the distributed storage of failure
CN112948170A (en) * 2019-12-10 2021-06-11 中标软件有限公司 Method for realizing system power-down protection by using snapshot function of equipment mapping
CN111786810A (en) * 2020-05-19 2020-10-16 中国科学院信息工程研究所 Automatic deployment method and system for large-scale test bed nodes
CN113282342A (en) * 2021-05-14 2021-08-20 北京首都在线科技股份有限公司 Deployment method, device, system, electronic equipment and readable storage medium
CN113032032A (en) * 2021-05-21 2021-06-25 武汉深之度科技有限公司 System management method and device, computing equipment and readable storage medium

Also Published As

Publication number Publication date
CN114265628A (en) 2022-04-01

Similar Documents

Publication Publication Date Title
US11474829B2 (en) Customizing program logic for booting a system
US6684327B1 (en) Extensible, flexible, memory efficient technique for network boot without special DHCP/PXE hardware
US8997090B2 (en) Installing an operating system in a host system
US9465625B2 (en) Provisioning of operating environments on a server in a networked environment
US9542174B2 (en) Deployment of software images with distinct configuration logic
US20030217131A1 (en) Processing distribution using instant copy
CN107463388B (en) UEFI diskless starting method
US11418566B2 (en) Adding and removing virtual disks remotely to a streaming machine
CN113419815B (en) Method, system, equipment and medium for pre-starting operation environment installation
CN111966423B (en) Method and equipment for realizing memory operating system
JP2011060035A (en) System, method and program for deploying application
CN107800580B (en) Method, server and system for monitoring installation state of large-batch operating systems
CN107391193A (en) A kind of client, the system and method for configuration server
CN103049295A (en) Network installation method for Linux operating systems with godson platforms
US20100205420A1 (en) System and method for realizing remote test on computer apparatus without storage device
CN114138283A (en) Remote automatic deployment method, device, terminal and storage medium for operating system
CN105512026A (en) Automatic batch testing method
CN114995888A (en) Intelligent network card deployment method, device and medium
CN109600439B (en) PaaS platform and deployment method thereof based on microservice
CN112948008B (en) Method for managing physical bare machine based on Ironic
CN112486508B (en) Deployment method of operating system, server and computer storage medium
CN113268254A (en) Cluster system installation method and device, electronic equipment and storage medium
CN108234174B (en) Management method and device of virtual network function
CN113419813A (en) Method and device for deploying bare engine management service based on container platform
CN114265628B (en) Operating system deployment method, device, electronic equipment, storage medium and system

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: He Yao

Inventor after: Lu Ming

Inventor after: Ding Lei

Inventor after: Wang Weigang

Inventor after: Guo Qing

Inventor before: He Yao

Inventor before: Lu Ming

Inventor before: Ding Lei

Inventor before: Wang Weigang

Inventor before: Guo Qing

GR01 Patent grant
GR01 Patent grant