Operating system migration method, device, server and storage medium
By writing data and modifying the target machine on the cloud computing platform, the problem of low and complex operating system migration efficiency in the existing technology is solved, and fast and efficient operating system migration is achieved, simplifying the process and reducing the cost.
Patent Information
- Application Number
- CN202111633542.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, migrating local systems to cloud computing platforms is inefficient and complex, and requires establishing a transit, wasting resources.
By determining the target disk of the target machine, writing data to the target disk according to the source machine to be migrated, and modifying the target machine's boot information so that it points to the target disk to achieve the migration of the operating system.
It realizes fast and efficient migration of the operating system, simplifies the migration process, eliminates the need for additional transit times, and reduces the cost of hardware deployment.
Smart Images

Figure CN114296810B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to an operating system migration method, device, server, and storage medium. Background Art
[0002] The traditional operating system installation method usually adopts the method of installing the operating system directly on the physical server. However, as the scale of enterprise data grows, more and more servers are needed to meet the data processing needs, but the cost of deploying a large number of servers for enterprises or individuals is high. In order to solve the problems caused by the growth of server scale, emerging cloud computing technologies have emerged. Cloud computing services can provide users with computing resource services. Users can migrate local systems to cloud computing platforms through cloud computing, provide services through cloud platforms, and reduce hardware deployment costs. However, the efficiency of migrating local systems to cloud platforms in the prior art is low and the operation is complicated. In addition, some existing migration methods also require the establishment of a transfer machine to achieve operating system migration through the transfer machine, which is complicated and wastes resources. Therefore, it is particularly important to quickly and efficiently migrate local systems to cloud computing platforms. Summary of the invention
[0003] The present invention provides an operating system migration method, device, server and storage medium to achieve rapid and efficient migration of the operating system.
[0004] In a first aspect, an embodiment of the present invention provides an operating system migration method, the operating system migration method comprising:
[0005] Determine the target disk corresponding to the target machine;
[0006] Writing data to the target disk according to the source machine to be migrated corresponding to the target machine;
[0007] Modify the boot information of the target machine to the target disk to achieve operating system migration.
[0008] Furthermore, the size of the target disk is determined according to the size of the disk of the source machine to be migrated.
[0009] Furthermore, the resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information.
[0010] Furthermore, before writing data to the target disk according to the source machine to be migrated, the method further includes:
[0011] Configuring the network address of the target machine;
[0012] A network connection between the target machine and the source machine to be migrated is established according to the network addresses of the target machine and the source machine to be migrated.
[0013] Furthermore, the step of writing data to the target disk according to the source machine to be migrated corresponding to the target machine includes:
[0014] Entering the source machine to be migrated according to the system boot of the source machine to be migrated;
[0015] The disk data of the source machine to be migrated is copied according to a preset read and write command, and the copied disk data is written into the target disk according to the network connection between the source machine to be migrated and the target machine.
[0016] Further, the modifying the boot information of the target machine to the target disk includes:
[0017] Determine the source pointing address of the boot information of the target machine and the target address of the target disk;
[0018] The source pointing address in the boot information is replaced by the target address so that the boot information points to the target disk.
[0019] Furthermore, the method further comprises:
[0020] Restarting the target machine;
[0021] Determine the driver to be installed corresponding to the target machine;
[0022] The driver to be installed is installed on the system of the target machine.
[0023] In a second aspect, an embodiment of the present invention further provides an operating system migration device, the operating system migration device comprising:
[0024] A disk determination module, used to determine the target disk corresponding to the target machine;
[0025] A disk writing module, used for writing data to the target disk according to the source machine to be migrated corresponding to the target machine;
[0026] The boot information modification module is used to modify the boot information of the target machine to the target disk to achieve operating system migration.
[0027] Furthermore, the size of the target disk is determined according to the size of the disk of the source machine to be migrated.
[0028] Furthermore, the resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information.
[0029] Furthermore, the device also includes:
[0030] An address configuration module, used for configuring the network address of the target machine before writing data to the target disk according to the source machine to be migrated;
[0031] The network connection module is used to establish a network connection between the target machine and the source machine to be migrated according to the network addresses of the target machine and the source machine to be migrated.
[0032] Furthermore, the disk writing module includes:
[0033] A source machine entry unit, used to enter the source machine to be migrated according to the system boot of the source machine to be migrated;
[0034] The disk duplication unit is used to duplicate the disk data of the source machine to be migrated according to preset read and write commands, and write the duplicated disk data into the target disk according to the network connection between the source machine to be migrated and the target machine.
[0035] Furthermore, the guidance information modification module includes:
[0036] An address determination unit, used to determine a source pointing address of the boot information of the target machine and a target address of the target disk;
[0037] The replacement unit is used to replace the source pointing address in the boot information according to the target address, so that the boot information points to the target disk.
[0038] Furthermore, the device also includes:
[0039] A restart module, used for restarting the target machine;
[0040] A driver determination module, used to determine the driver to be installed corresponding to the target machine;
[0041] A driver installation module is used to install the driver to be installed on the system of the target machine.
[0042] In a third aspect, an embodiment of the present invention further provides a server, the server comprising:
[0043] one or more processors;
[0044] a memory for storing one or more programs,
[0045] When the one or more programs are executed by the one or more processors, the one or more processors implement an operating system migration method as described in any one of the embodiments of the present invention.
[0046] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an operating system migration method as described in any one of the embodiments of the present invention.
[0047] The embodiment of the present invention provides an operating system migration method, device, server and storage medium, which realizes operating system migration by determining the target disk corresponding to the target machine; writing data to the target disk according to the source machine to be migrated corresponding to the target machine; and modifying the boot information of the target machine to the target disk. The problem of complex operation during the operating system migration process is solved. By writing data to the target disk of the target machine, disk data replication is completed. By modifying the boot information of the target machine, the boot information of the target machine is pointed to the target disk, so that after the target machine is started, the system can be booted and started according to the information of the target disk, thereby realizing operating system migration. After creating the target machine on the cloud platform, it is only necessary to write data to the target disk and modify the boot information of the target machine to realize the migration of the operating system. The implementation process is simple and convenient, and there is no need to set up an additional transfer machine, and the migration of the operating system can be completed efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flow chart of an operating system migration method in Embodiment 1 of the present invention;
[0049] Figure 2 is a flow chart of an operating system migration method in Embodiment 2 of the present invention;
[0050] Figure 3 This is an example diagram of implementing the migration of a source machine to be migrated in the second embodiment of the present invention;
[0051] Figure 4 It is a schematic diagram of the structure of an operating system migration device in Embodiment 3 of the present invention;
[0052] Figure 5 It is a structural diagram of a server in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0054] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0055] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0056] Embodiment 1
[0057] Figure 1 A flowchart of an operating system migration method provided in the first embodiment of the present application is provided, and the method is applicable to the case of rapid migration of the operating system. The method can be executed by a server.
[0058] like Figure 1 As shown, the first embodiment provides an operating system migration method, which specifically includes the following steps:
[0059] S101, determining a target disk corresponding to a target machine.
[0060] In this embodiment, the target machine can be specifically understood as a system machine created on a cloud computing platform. The target disk can be specifically understood as a disk of the target machine, which is used to store data of the target machine.
[0061] Specifically, when performing operating system migration, first determine the source machine to be migrated, that is, the machine to be migrated. Create a target machine on the cloud computing platform based on the configuration information of the source machine to be migrated, so that the target machine can work instead of the source machine to be migrated. After the target machine is created, allocate resources and a target disk to the target machine, and establish a connection between the target machine and the target disk. After the target machine is determined, the target disk of the target machine is determined accordingly.
[0062] As an optional embodiment of the present embodiment, the optional embodiment is further optimized to include: the size of the target disk is determined according to the size of the disk of the source machine to be migrated.
[0063] When allocating disks to the target machine, determine the disk size of the source machine to be migrated and allocate a target disk of the same size to the target machine.
[0064] As an optional embodiment of the present embodiment, the optional embodiment is further optimized to include: the resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information.
[0065] In this embodiment, the resource configuration information can be specifically understood as the relevant information of the working environment when the target machine starts working or works normally. Since the target machine is a copy of the source machine to be migrated, the resource configuration information of the target machine is the same as the resource configuration information of the source machine to be migrated. The resource configuration information of the source machine to be migrated is obtained in advance, and the target machine is configured according to the resource configuration information of the source machine to be migrated.
[0066] Exemplarily, the present application provides a method for obtaining resource configuration information, and obtains the following information from the source system to be migrated through system commands:
[0067] 1. Central Processing Unit CPU Information
[0068]
[0069] 2. Memory information
[0070] root@from#cat / proc / meminfo
[0071] MemTotal: 7990124kB
[0072] 3. Network card information (single network card)
[0073]
[0074] 4. Disk (hard disk) information
[0075]
[0076] You can also get the motherboard information through the following code
[0077] root@from#[-d / sys / firmware / efi]&&echo “Installed in UEFI mode”||echo “Installed in Legacy mode”
[0078] “Installed in Legacy mode”
[0079] Exemplarily, the configuration of the target machine created in the embodiment of the present application is BIOS, 1 CPU, 1 network card, and 1 disk.
[0080] S102: Writing data to the target disk according to the source machine to be migrated corresponding to the target machine.
[0081] Specifically, the source machine to be migrated has a corresponding disk, and the disk contains relevant information of the source machine to be migrated, such as configuration information, operation information, etc. The source machine to be migrated corresponding to the target machine is determined, and the data in the disk of the source machine to be migrated is further determined, and the data in the disk of the source machine to be migrated is copied and written to the target disk, thereby completing the data writing of the target machine.
[0082] S103, modifying the boot information of the target machine to the target disk to achieve operating system migration.
[0083] Specifically, the boot information of the target machine points to the host of the cloud computing platform, and the target machine cannot start its own system after startup. Directly modify the boot information of the target machine so that the boot information of the target machine points to the target disk allocated for the target machine. After modifying the boot information of the target machine to the target disk, the target machine can boot the system through the boot information after startup, complete the system startup, and then realize the migration of the operating system.
[0084] The embodiment of the present invention provides an operating system migration method, which realizes operating system migration by determining a target disk corresponding to a target machine; writing data to the target disk according to a source machine to be migrated corresponding to the target machine; and modifying the boot information of the target machine to the target disk. The method solves the problem of complex operation during operating system migration, completes disk data replication by writing data to the target disk of the target machine, and makes the boot information of the target machine point to the target disk by modifying the boot information of the target machine, so that after the target machine is started, the system can be booted and started according to the information of the target disk, thereby realizing operating system migration. After creating a target machine on a cloud computing platform, it is only necessary to write data to the target disk and modify the boot information of the target machine to realize operating system migration. The implementation process is simple and convenient, and there is no need to establish an additional transfer machine, so that the migration of the operating system can be completed efficiently.
[0085] Embodiment 2
[0086] Figure 2 This is a flow chart of an operating system migration method provided in Embodiment 2 of the present invention. The technical solution of this embodiment is further refined on the basis of the above technical solution, and specifically mainly includes the following steps:
[0087] S201, determining the target disk corresponding to the target machine.
[0088] S202. Configure the network address of the target machine.
[0089] If the target machine needs to access an external server or computer device during normal operation, it needs to configure a network address before accessing it. For example, the network address of the target machine is set to 172.20.7.10.
[0090] S203: Establish a network connection between the target machine and the source machine to be migrated according to the network addresses of the target machine and the source machine to be migrated.
[0091] The network address of the source machine to be migrated is pre-configured. When the source machine to be migrated is determined, its network address is determined accordingly. A network connection between the target machine and the source machine to be migrated is established according to the network address of the target machine and the network address of the source machine to be migrated to achieve network communication. The target machine in this application needs to copy data from the disk of the source machine to be migrated to achieve data backup. Copying data from the source machine to be migrated requires the target machine to access the source machine to be migrated. Therefore, a network connection between the target machine and the source machine to be migrated is established to achieve network communication.
[0092] S204: Enter the source machine to be migrated according to the system boot of the source machine to be migrated.
[0093] In this embodiment, system boot refers to the process of loading the operating system kernel into memory and starting the system. System boot is usually completed by a special code called a boot program, which is located in the system ROM and is used to complete the entire system boot process of locating the specific location of the kernel code in the external memory, correctly loading the kernel into the memory as required, and finally making the kernel run. In this process, the boot program must complete multiple initialization processes, and various services of the system can only be used after these processes are successfully completed. These processes include initial boot, kernel initialization, and full system initialization. The operating system of each computer has a system boot, so that the computer completes the startup process and enters the source machine to be migrated through the recovery system boot of the source machine to be migrated. After entering the source machine to be migrated, the IP address of the source machine to be migrated can be reset, or the original IP address of the source machine to be migrated can be used. The embodiment of the present application sets the IP address of the source machine to be migrated to 172.20.7.11.
[0094] S205 . Copy the disk data of the source machine to be migrated according to the preset read and write commands, and write the copied disk data into the target disk according to the network connection between the source machine to be migrated and the target machine.
[0095] In this embodiment, the read and write commands can be specifically understood as pre-set operation commands, which can read and write data. Preferably, the read and write commands of the present application are dd commands, which copy a file by using blocks of a specified size and perform specified conversions while copying.
[0096] Specifically, the command type of the read and write command is pre-set, and the corresponding read and write command is determined according to the specific read and write operations. For example, the dd command corresponding to backing up the local / dev / hdb disk to / dev / hdd is: dd if= / dev / hdb of= / dev / hdd. The data in the disk of the source machine to be migrated is copied through the preset read and write commands, and the copied data is written to the target disk according to the network connection between the source machine to be migrated and the target machine, so as to realize the data backup of the target disk of the target machine.
[0097] Exemplarily, an embodiment of the present application provides an implementation code for copying disk data of a source machine to be migrated and writing the data to a target disk through a preset read and write command:
[0098] root@to#nc–v–l–p 2000|gzip–cd> / dev / sdb
[0099] root@from#dd if= / dev / sda bs=512count=41943040|gzip–c9|nc–q 2172.20.7.10 2000
[0100] The root@to code means opening port 2000, which is waiting to write data to the target disk of the target machine. The root@from code means copying data from the disk (dev / sda) of the source machine to be migrated and sending it to the target disk of the target machine through port 2000.
[0101] S206: Determine the source pointing address of the boot information of the target machine and the target address of the target disk.
[0102] In this embodiment, the boot information can be specifically understood as information for selecting an operating system to be run when the computer is started. Multiple operating systems can be installed on the computer at the same time. In this case, the system to be run will be selected when the computer is started, and the system to be run after the computer is started is selected through the boot information. The source pointing address can be specifically understood as the address pointed to by the boot information after the target machine is created. The source pointing address is usually the default address after the target machine is created. The source pointing address of the boot information of the target machine is determined by analyzing the boot information of the target machine. When allocating the target disk, the target address corresponding to the target disk is determined accordingly.
[0103] S207: Replace the source pointing address in the boot information according to the target address, so that the boot information points to the target disk.
[0104] Replace the source address in the boot information with the target address. At this time, the boot information points to the target disk accordingly. That is, after the target machine is started, the boot information will guide the system to start according to the data in the target disk.
[0105] Exemplarily, the boot information in this application is grub boot information. grub is a multi-operating system boot program from the GNU project. grub is an implementation of the multi-boot specification, allowing users to have multiple operating systems in a computer at the same time and select the operating system they want to run when the computer starts. grub can be used to select different kernels on the operating system partition, and can also be used to pass boot parameters to these kernels.
[0106] S208. Restart the target machine.
[0107] Shut down and restart the target machine. Restart can be achieved through system operation commands, keystrokes, disconnecting the power supply and then powering it back on.
[0108] S209: Determine the driver to be installed corresponding to the target machine.
[0109] In this embodiment, the driver to be installed can be specifically understood as the driver that needs to be installed for the target machine to operate normally on the cloud computing platform. The driver is a configuration file written by the hardware manufacturer according to the operating system. Without the driver, the hardware in the computer cannot work. Different operating systems have different hardware drivers. The driver to be installed required for the target machine to work on the cloud computing platform is determined based on the corresponding hardware devices of the cloud computing platform and the operating system of the target machine. The number of drivers to be installed in this application can be one or more.
[0110] S210. Install the driver to be installed on the system of the target machine.
[0111] Install all drivers to be installed on the target machine's system. After installing the drivers to be installed corresponding to the cloud computing platform on the target machine's system, the migration of the operating system is now complete.
[0112] For example, Figure 3 An implementation example diagram of the migration of a source machine to be migrated is provided. A target machine 31 is created on a cloud computing platform 30. The source machine 32 to be migrated takes the Linux operating system as an example. The target machine 31 copies data to the source machine 32 to be migrated through the Recover boot system.
[0113] The embodiment of the present invention provides an operating system migration method, which realizes operating system migration by determining a target disk corresponding to a target machine; writing data to the target disk according to a source machine to be migrated corresponding to the target machine; and modifying the boot information of the target machine to the target disk. The problem of complex operation during operating system migration is solved, and the disk data of the source machine to be migrated is copied and written to the target disk of the target machine through a preset read and write command, thereby realizing fast and efficient copying of disk data. By modifying the boot information of the target machine, the boot information of the target machine points to the target disk, so that the target machine can boot and start the system according to the information of the target disk after startup, thereby realizing fast migration of the operating system, and the operation is simple. After creating a target machine on a cloud computing platform, it is only necessary to write data to the target disk and modify the boot information of the target machine to realize the migration of the operating system. The implementation process is simple and convenient, and there is no need to establish an additional transfer machine, so that the migration of the operating system can be completed efficiently.
[0114] Embodiment 3
[0115] Figure 4 This is a schematic diagram of the structure of an operating system migration device provided in Embodiment 3 of the present invention. The device includes: a disk determination module 41, a disk writing module 42 and a boot information modification module 43.
[0116] Wherein, the disk determination module 41 is used to determine the target disk corresponding to the target machine;
[0117] A disk writing module 42 is used to write data to the target disk according to the source machine to be migrated corresponding to the target machine;
[0118] The boot information modification module 43 is used to modify the boot information of the target machine to the target disk to achieve operating system migration.
[0119] The embodiment of the present invention provides an operating system migration device, which realizes operating system migration by determining the target disk corresponding to the target machine; writing data to the target disk according to the source machine to be migrated corresponding to the target machine; and modifying the boot information of the target machine to the target disk. The problem of complex operation during the operating system migration process is solved. By writing data to the target disk of the target machine, disk data replication is completed. By modifying the boot information of the target machine, the boot information of the target machine is pointed to the target disk, so that after the target machine is started, the system can be booted and started according to the information of the target disk, thereby realizing operating system migration. After creating the target machine on the cloud platform, it is only necessary to write data to the target disk and modify the boot information of the target machine to realize the migration of the operating system. The implementation process is simple and convenient, and there is no need to set up an additional transfer machine. The migration of the operating system can be completed efficiently.
[0120] Furthermore, the size of the target disk is determined according to the size of the disk of the source machine to be migrated.
[0121] Furthermore, the resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information.
[0122] Furthermore, the device also includes:
[0123] An address configuration module, used for configuring the network address of the target machine before writing data to the target disk according to the source machine to be migrated;
[0124] The network connection module is used to establish a network connection between the target machine and the source machine to be migrated according to the network addresses of the target machine and the source machine to be migrated.
[0125] Furthermore, the disk writing module 42 includes:
[0126] A source machine entry unit, used to enter the source machine to be migrated according to the system boot of the source machine to be migrated;
[0127] The disk duplication unit is used to duplicate the disk data of the source machine to be migrated according to preset read and write commands, and write the duplicated disk data into the target disk according to the network connection between the source machine to be migrated and the target machine.
[0128] Furthermore, the guidance information modification module 43 includes:
[0129] An address determination unit, used to determine a source pointing address of the boot information of the target machine and a target address of the target disk;
[0130] The replacement unit is used to replace the source pointing address in the boot information according to the target address, so that the boot information points to the target disk.
[0131] Furthermore, the device also includes:
[0132] A restart module, used for restarting the target machine;
[0133] A driver determination module, used to determine the driver to be installed corresponding to the target machine;
[0134] A driver installation module is used to install the driver to be installed on the system of the target machine.
[0135] The operating system migration device provided in the embodiment of the present invention can execute the operating system migration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0136] Embodiment 4
[0137] Figure 5 A schematic diagram of the structure of a server provided in Embodiment 4 of the present invention is shown in FIG. Figure 5 As shown, the server includes a processor 50, a memory 51, an input device 52 and an output device 53; the number of processors 50 in the server can be one or more. Figure 5 A processor 50 is taken as an example; the processor 50, the memory 51, the input device 52 and the output device 53 in the server can be connected by a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0138] The memory 51 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the operating system migration method in the embodiment of the present invention (for example, the disk determination module 41, the disk writing module 42 and the boot information modification module 43 in the operating system migration device). The processor 50 executes various functional applications and data processing of the server by running the software programs, instructions and modules stored in the memory 51, that is, implements the above-mentioned operating system migration method.
[0139] The memory 51 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 51 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 51 may further include a memory remotely arranged relative to the processor 50, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0140] The input device 52 may be used to receive input digital or character information and generate key signal input related to the user settings and function control of the server. The output device 53 may include a display device such as a display screen.
[0141] Embodiment 5
[0142] Embodiment 5 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute an operating system migration method when executed by a computer processor, the method comprising:
[0143] Determine the target disk corresponding to the target machine;
[0144] Writing data to the target disk according to the source machine to be migrated corresponding to the target machine;
[0145] Modify the boot information of the target machine to the target disk to achieve operating system migration.
[0146] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the operating system migration method provided by any embodiment of the present invention.
[0147] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0148] It is worth noting that in the embodiment of the above-mentioned operating system migration device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0149] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for migrating an operating system, characterized in that: include: Determine the target disk corresponding to the target machine; Writing data to the target disk according to the source machine to be migrated corresponding to the target machine; Modifying the boot information of the target machine to the target disk to achieve operating system migration; The source machine to be migrated has a corresponding disk, and the corresponding disk contains relevant information of the source machine to be migrated, and the relevant information at least includes resource configuration information and operation information; The resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information; Wherein, modifying the boot information of the target machine to the target disk includes: Determine the source pointing address of the boot information of the target machine and the target address of the target disk; wherein the boot information is information for selecting an operating system to be run when the computer is started; The source pointing address in the boot information is replaced according to the target address, so that the boot information points to the target disk.
2. The method according to claim 1, characterized in that The size of the target disk is determined according to the size of the disk of the source machine to be migrated.
3. The method according to claim 1, characterized in that Before writing data to the target disk according to the source machine to be migrated, the method further includes: Configuring the network address of the target machine; A network connection between the target machine and the source machine to be migrated is established according to the network addresses of the target machine and the source machine to be migrated.
4. The method according to claim 3, characterized in that The step of writing data to the target disk according to the source machine to be migrated corresponding to the target machine includes: Entering the source machine to be migrated according to the system boot of the source machine to be migrated; The disk data of the source machine to be migrated is copied according to a preset read and write command, and the copied disk data is written into the target disk according to the network connection between the source machine to be migrated and the target machine.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Restarting the target machine; Determine the driver to be installed corresponding to the target machine; The driver to be installed is installed on the system of the target machine.
6. An operating system migration device, characterized in that: include: A disk determination module, used to determine the target disk corresponding to the target machine; A disk writing module, used for writing data to the target disk according to the source machine to be migrated corresponding to the target machine; A boot information modification module, used to modify the boot information of the target machine to the target disk to achieve operating system migration; The source machine to be migrated has a corresponding disk, and the corresponding disk contains relevant information of the source machine to be migrated, and the relevant information at least includes resource configuration information and operation information; The resource configuration information of the target machine is determined according to the source machine to be migrated, and the resource configuration information includes at least one or more of the following information: central processing unit information, memory information, disk information, and network card information; Wherein, the guidance information modification module includes: An address determination unit, used to determine a source pointing address of the boot information of the target machine and a target address of the target disk; wherein the boot information is information for selecting an operating system to be run when the computer is started; The replacement unit is used to replace the source pointing address in the boot information according to the target address, so that the boot information points to the target disk.
7. A server, characterized in that: The server comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the operating system migration method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the operating system migration method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Windows operating system migration method, device and system
CN111597145A
Data migration method, device and equipment and storage medium
CN112612417A