CN110941516A - Operating system restoration method, device, equipment and storage medium - Google Patents

Operating system restoration method, device, equipment and storage medium Download PDF

Info

Publication number
CN110941516A
CN110941516A CN201911248405.6A CN201911248405A CN110941516A CN 110941516 A CN110941516 A CN 110941516A CN 201911248405 A CN201911248405 A CN 201911248405A CN 110941516 A CN110941516 A CN 110941516A
Authority
CN
China
Prior art keywords
operating system
backup data
boot
disk
target
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.)
Granted
Application number
CN201911248405.6A
Other languages
Chinese (zh)
Other versions
CN110941516B (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.)
Shenzhen City Branch Power Technology Co Ltd
Original Assignee
Shenzhen City Branch Power Technology 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 Shenzhen City Branch Power Technology Co Ltd filed Critical Shenzhen City Branch Power Technology Co Ltd
Priority to CN201911248405.6A priority Critical patent/CN110941516B/en
Publication of CN110941516A publication Critical patent/CN110941516A/en
Application granted granted Critical
Publication of CN110941516B publication Critical patent/CN110941516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1417Boot up procedures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1456Hardware arrangements for backup

Abstract

The invention discloses an operating system restoration method, an operating system restoration device, operating system partition backup data and a storage medium, wherein when a target storage space required by the operating system partition backup data is insufficient, the operating system partition backup data is stored in a target non-boot disk; writing a target storage address of the backup data of the operating system partition into a bootstrap program in a bootstrap disk; when an operating system starting instruction is received, a bootstrap program in a bootstrap disk redirects the operating system partition backup data in a target non-bootstrap disk according to a target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data and the size of the magnetic disk of the restoration target computer, the consistency and the safety of the restoration of the backup data are ensured, a user can more conveniently restore the backup operation, and the user experience is improved.

Description

Operating system restoration method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data storage, and in particular, to a method, an apparatus, a device, and a storage medium for restoring an operating system.
Background
When an existing backup system restores system backup data, if the size of a storage object of a target host is smaller than that of a source storage object, two common technical schemes are adopted: firstly, adjusting a disk partition structure in system backup data and data in a disk so as to adapt to smaller storage objects; specifically, by reducing the disk partition, if necessary, the data in the disk partition needs to be moved, the partition must be reduced to be smaller than the target disk, and the target disk can accommodate all the system backup data; however, this solution has the following drawbacks: if the system backup data is still larger than the target disk after being partitioned by the reduced disk and compressed with the effective data, the data can be lost after restoration; secondly, increasing the size of a storage object of the target host; specifically, the purpose that the target disk can contain all system backup data is achieved by increasing the size of the existing storage object of the target host; however, this solution has the following drawbacks: if the target host cannot grow the existing storage objects, the scheme cannot be implemented, for example, most of the system disks in the public cloud do not support changing the size of the hard disk.
Disclosure of Invention
The invention mainly aims to provide an operating system restoring method, an operating system restoring device, operating system restoring equipment and a storage medium, and aims to solve the technical problems that data is easy to lose and backup data cannot be effectively stored when system backup data is restored in the prior art.
In order to achieve the above object, the present invention provides an operating system restoring method, which includes the following steps:
when the storage space required by the backup data of the operating system partition is larger than the storage space of a boot disk, storing the backup data of the operating system partition into a target non-boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the backup data of the operating system partition;
writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address;
and acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
Preferably, before storing the operating system partition backup data in the target non-boot disk when the storage space required by the operating system partition backup data is greater than the storage space of the boot disk, the operating system restoring method further includes:
when the restoration process of the backup data starts, acquiring the data capacity of the backup data of the partition of the operating system;
and judging whether the backup data of the operating system partition is larger than the storage space of the boot disk or not according to the data capacity.
Preferably, when the storage space required by the operating system partition backup data is greater than the storage space of the boot disk, storing the operating system partition backup data in the target non-boot disk specifically includes:
when the storage space required by the backup data of the partition of the operating system is larger than the storage space of the guide disk, generating and displaying data recovery reminding information;
and after receiving a confirmation instruction of a user, storing the backup data of the operating system partition into a target non-boot disk.
Preferably, after receiving the target user confirmation instruction, the storing the operating system partition backup data in the target non-boot disk specifically includes:
acquiring the disk capacity of other disks in the target host except the boot disk, and taking the disk with the disk capacity larger than the storage space required by the partition backup data of the operating system as a non-boot disk;
when the number of the non-boot disks is single, taking the non-boot disks as target non-boot disks;
and when the number of the non-boot disks is multiple, respectively calculating the capacity difference between the storage space of each non-boot disk and the storage space required by the backup data of the operating system partition, and taking the non-boot disk with the capacity difference matched with the target capacity difference in the preset disk selection strategy as the target non-boot disk.
Preferably, the writing the target storage address of the operating system partition backup data into the boot program in the boot disk specifically includes:
acquiring a data logic address of the operating system partition backup data in the target non-boot disk, and taking the data logic address as a target storage address;
and writing the target storage address into a boot program in the boot disk.
Preferably, the writing the target storage address of the operating system partition backup data into the boot program in the boot disk specifically includes:
writing a target storage address of the operating system partition backup data into configuration parameters of a boot program in the boot disk;
correspondingly, when receiving an operating system startup instruction, redirecting, by the boot program in the boot disk, the operating system partition backup data in the target non-boot disk according to the target storage address, specifically including:
and when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by the boot program in the boot disk according to the target storage address in the configuration parameters.
Preferably, after writing the target storage address of the operating system partition backup data into the configuration parameters of the boot program in the boot disk, the operating system restoring method further includes:
and restarting the bootstrap program in the boot disk so as to enable the configuration parameters of the bootstrap program in the boot disk to take effect.
In addition, to achieve the above object, the present invention further provides an operating system restoring apparatus, including: a memory, a processor and an operating system restore program stored on the memory and executable on the processor, the operating system restore program configured to implement the steps of the operating system restore method as described above.
In addition, to achieve the above object, the present invention further provides a storage medium, which stores an operating system restoring program, and when the operating system restoring program is executed by a processor, the operating system restoring program implements the steps of the operating system restoring method as described above.
In addition, to achieve the above object, the present invention further provides an operating system restoring apparatus, including:
the storage module is used for storing the operating system partition backup data into a target non-boot disk when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the operating system partition backup data;
the boot module is used for writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
the redirection module is used for redirecting the backup data of the operating system partition in the target non-boot disk to the bootstrap program in the boot disk according to the target storage address when receiving an operating system starting instruction;
and the starting module is used for acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
The operating system recovery method provided by the invention stores the operating system partition backup data into a target non-boot disk when the storage space required by the operating system partition backup data is larger than that of a boot disk, wherein the storage space of the target non-boot disk is larger than that required by the operating system partition backup data; writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk; when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data and the size of the magnetic disk of the restoration target computer, the consistency and the safety of the restoration of the backup data are ensured, a user can more conveniently restore the backup operation, and the user experience is improved.
Drawings
Fig. 1 is a schematic structural diagram of an operating system recovery device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for restoring an operating system according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of an operating system recovery method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of an operating system recovery method according to the present invention;
FIG. 5 is a functional block diagram of an operating system recovery apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The solution of the embodiment of the invention is mainly as follows: when the storage space required by the partition backup data of the operating system is larger than that of the boot disk, the partition backup data of the operating system is stored in a target non-boot disk, wherein the storage space of the target non-boot disk is larger than that required by the partition backup data of the operating system; writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk; when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data, the consistency and the safety of data backup are guaranteed, a user can more conveniently perform storage backup operation, the user experience is improved, and the technical problems that in the prior art, when the system backup data is restored, the data is easily lost, and the backup data cannot be effectively stored are solved.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an operating system recovery device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the operating system restoring apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the operating system restore device configuration shown in FIG. 1 does not constitute a limitation of the operating system restore device, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a storage medium, may include an operating system, a network communication module, a client interface module, and an operating system restoring program.
The os restore device of the present invention calls the os restore program stored in the memory 1005 through the processor 1001, and performs the following operations:
when the storage space required by the backup data of the operating system partition is larger than the storage space of a boot disk, storing the backup data of the operating system partition into a target non-boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the backup data of the operating system partition;
writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address;
and acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
when the restoration process of the backup data starts, acquiring the data capacity of the backup data of the partition of the operating system;
and judging whether the backup data of the operating system partition is larger than the storage space of the boot disk or not according to the data capacity.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
when the storage space required by the backup data of the partition of the operating system is larger than the storage space of the guide disk, generating and displaying data recovery reminding information;
and after receiving a confirmation instruction of a user, storing the backup data of the operating system partition into a target non-boot disk.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
acquiring the disk capacity of other disks in the target host except the boot disk, and taking the disk with the disk capacity larger than the storage space required by the partition backup data of the operating system as a non-boot disk;
when the number of the non-boot disks is single, taking the non-boot disks as target non-boot disks;
and when the number of the non-boot disks is multiple, respectively calculating the capacity difference between the storage space of each non-boot disk and the storage space required by the backup data of the operating system partition, and taking the non-boot disk with the capacity difference matched with the target capacity difference in the preset disk selection strategy as the target non-boot disk.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
acquiring a data logic address of the operating system partition backup data in the target non-boot disk, and taking the data logic address as a target storage address;
and writing the target storage address into a boot program in the boot disk.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
writing a target storage address of the operating system partition backup data into configuration parameters of a boot program in the boot disk;
correspondingly, when receiving an operating system startup instruction, redirecting, by the boot program in the boot disk, the operating system partition backup data in the target non-boot disk according to the target storage address, specifically including:
and when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by the boot program in the boot disk according to the target storage address in the configuration parameters.
Further, the processor 1001 may call an operating system restore program stored in the memory 1005, and also perform the following operations:
and restarting the bootstrap program in the boot disk so as to enable the configuration parameters of the bootstrap program in the boot disk to take effect.
According to the scheme, when the storage space required by the backup data of the operating system partition is larger than that of the boot disk, the backup data of the operating system partition is stored in the target non-boot disk, and the storage space of the target non-boot disk is larger than that required by the backup data of the operating system partition; writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk; when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data and the size of the magnetic disk of the restoration target computer, the consistency and the safety of the restoration of the backup data are ensured, a user can more conveniently restore the backup operation, and the user experience is improved.
Based on the hardware structure, the embodiment of the operating system restoration method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the operating system restoring method according to the present invention.
In a first embodiment, the operating system restoring method includes the steps of:
step S10, when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, storing the operating system partition backup data in a target non-boot disk, where the storage space of the target non-boot disk is larger than the storage space required by the operating system partition backup data.
It should be noted that the os partition backup data is data that needs to be backed up and restored, when the storage space required by the os partition backup data is larger than the storage space of the boot disk, that is, the storage space of the boot disk is not enough to store the os partition backup data, at this time, the os partition backup data may be stored in the target non-boot disk, the target non-boot disk is a predetermined disk for storing the os backup data, the storage space of the target non-boot disk is larger than the storage space required by the os partition backup data, that is, the target non-boot disk meets the condition for storing the os partition backup data, and the boot disk and the target non-boot disk are computer software objects or hardware objects that can store data, common hardware disks are: memory, flash memory, hard disk, etc.; common software disks are: a virtual memory linear access space, a file system volume, a hard disk partition, a Logical Unit Number (LUN), and the like, which is not limited in this embodiment; the backup data of the partition of the operating system may be default unchanged data or data updated in real time, which is not limited in this embodiment.
Further, before the step S10, the operating system restoring method further includes the following steps:
when the restoration process of the backup data starts, acquiring the data capacity of the backup data of the partition of the operating system;
and judging whether the backup data of the operating system partition is larger than the storage space of the boot disk or not according to the data capacity.
It should be understood that, the capacity of the backup data of the operating system partition, which is the capacity of the storage space required by the data in the restored operating system partition, may be obtained and recorded from the backup source when the backup data is generated, or may be obtained by analyzing the backup data; and simultaneously, the space capacity of a boot disk of a target computer can be acquired in real time from the target computer, whether the boot disk can store the partition backup data of the operating system can be judged according to the data capacity, if the partition backup data of the operating system can be stored, the partition backup data of the operating system is directly backed up to the boot disk, if the partition backup data of the operating system is found to be stored in a storage space larger than that of the boot disk, the partition backup data of the operating system is stored in a target non-boot disk, and the target non-boot disk performs subsequent backup data restoration operation.
And step S20, writing the target storage address of the operating system partition backup data into the boot program in the boot disk.
It can be understood that, after the operating system partition backup data is stored in the target non-boot disk, a current storage address, that is, a target storage address of the operating system partition backup data may be acquired, and after the target storage address is written in a boot program of the boot disk, preparation may be made for importing the subsequent operating system partition backup data.
Step S30, when receiving the os boot instruction, the boot program in the boot disk redirects the os partition backup data in the target non-boot disk according to the target storage address.
It should be understood that the os boot instruction is an instruction sent by a target user to boot an os, and when the os boot instruction is received, a redirection operation may be performed, that is, a bootstrap program in the boot disk redirects the os partition backup data in the target non-boot disk according to the target storage address; the operating system starting instruction may be a corresponding disk selection instruction input by a target user through a terminal device, or may be an instruction directly triggered by touching or clicking, or may be an instruction input by other means, which is not limited in this embodiment; the bootstrap program is a preset program for guiding the called operating system partition backup data, and the operating system partition backup data can be accurately acquired through the bootstrap program; the calling of the partition backup data of the subsequent operating system is facilitated, the data backup speed is accelerated, and the efficiency and the accuracy of the data backup are improved.
It can be understood that the original data backup path is imported from a local disk to the boot disk through the boot program, but since the storage space of the boot disk is not enough to store the operating system partition backup data, the calling disk of the operating system partition backup data can be effectively stored after being redirected from the boot disk to the target non-boot disk, so as to prepare for restoring the subsequent backup data.
Step S40, acquiring a system boot program from the operating system partition backup data, and calling the system boot program to boot and restore the operating system.
It can be understood that the system boot program is a data file necessary for booting the operating system, and the operating system can be booted and restored by obtaining the system boot program from the backup data of the operating system partition and calling the system boot program, so that the operating system operates normally.
According to the scheme, when the storage space required by the backup data of the operating system partition is larger than that of the boot disk, the backup data of the operating system partition is stored in the target non-boot disk, and the storage space of the target non-boot disk is larger than that required by the backup data of the operating system partition; writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk; when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data and the size of the magnetic disk of the restoration target computer, the consistency and the safety of the restoration of the backup data are ensured, a user can more conveniently restore the backup operation, and the user experience is improved.
Further, fig. 3 is a schematic flowchart of a second embodiment of the operating system restoring method of the present invention, and as shown in fig. 3, the second embodiment of the operating system restoring method of the present invention is proposed based on the first embodiment, and in this embodiment, the step S10 specifically includes the following steps:
and step S11, when the storage space required by the backup data of the operating system partition is larger than the storage space of the boot disk, generating and displaying the data recovery reminding information.
It can be understood that the data recovery reminding information is reminding information for reminding the target user to store the operating system partition backup data to the target non-boot disk, when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, the data recovery reminding information can be generated in time, the data recovery reminding information is fed back to the terminal device of the user, and the user can know that the boot disk does not have enough space to store the operating system partition backup data through the data recovery reminding information displayed by the terminal device.
And step S12, after receiving the confirmation instruction from the user, storing the operating system partition backup data in the target non-boot disk.
It should be understood that after receiving a confirmation instruction from a user, the operating system partition backup data may be directly stored in the target non-boot disk, and due to the confirmation of the user, a situation that a user experiences a bad experience due to an autonomous replacement of a storage disk is avoided.
Further, the step S12 specifically includes the following steps:
acquiring the disk capacity of other disks in the target host except the boot disk, and taking the disk with the disk capacity larger than the storage space required by the partition backup data of the operating system as a non-boot disk;
when the number of the non-boot disks is single, taking the non-boot disks as target non-boot disks;
and when the number of the non-boot disks is multiple, respectively calculating the capacity difference between the storage space of each non-boot disk and the storage space required by the backup data of the operating system partition, and taking the non-boot disk with the capacity difference matched with the target capacity difference in the preset disk selection strategy as the target non-boot disk.
It can be understood that the target host is a host capable of running the operating system partition backup data, the target host includes a plurality of disks, a non-boot disk whose disk capacity is larger than the storage space required by the operating system partition backup data can be screened out by obtaining the disk capacities of the other disks in the target host except the boot disk, and then when the number of the non-boot disks is single, the non-boot disk is directly determined as the target non-boot disk, and when the number of the non-boot disks is multiple, the capacity difference between the storage space of each non-boot disk and the storage space required by the operating system partition backup data is respectively calculated, and then the non-boot disk whose capacity difference matches the target capacity difference in a preset disk selection policy is taken as the target non-boot disk, and the preset disk selection policy is that the non-boot disk whose capacity difference is the largest can be taken as the target non-boot disk, the non-boot disk with the minimum capacity difference may be used as the target non-boot disk, or the non-boot disk that satisfies the requirement of sufficient disk storage space after the capacity difference is added to the preset capacity may be used as the target non-boot disk, or the target non-boot disk may be determined in other manners, which is not limited in this embodiment; the method and the device ensure that the partition backup data of the operating system can be effectively stored, save the storage space, avoid the waste of the storage space and save the data backup cost.
According to the scheme, when the storage space required by the backup data of the operating system partition is larger than the storage space of the boot disk, the data recovery reminding information is generated and displayed; after receiving a confirmation instruction of a user, storing the operating system partition backup data into a target non-boot disk, particularly when the number of the non-boot disks is multiple, calculating a capacity difference between a storage space of each non-boot disk and a storage space required by the operating system partition backup data, and taking the non-boot disk with the capacity difference matched with a target capacity difference in a preset disk selection strategy as the target non-boot disk, so that the condition that bad experience is caused to the user due to the fact that the storage disks are replaced independently is avoided, the backup data reduction efficiency is improved, and the cost for reducing the backup data is saved.
Further, fig. 4 is a schematic flowchart of a third embodiment of the operating system restoring method of the present invention, and as shown in fig. 4, the third embodiment of the operating system restoring method of the present invention is proposed based on the second embodiment, and in this embodiment, the step S20 specifically includes the following steps:
step S21, acquiring a data logical address of the operating system partition backup data in the target non-boot disk, and taking the data logical address as a target storage address.
It should be noted that after the operating system partition backup data is stored in the target non-boot disk, there is a corresponding data logical address, and after the data logical address corresponding to the operating system partition backup data is acquired, the data logical address may be used as a target storage address to prepare for subsequent data calling.
And step S22, writing the target storage address into the boot program in the boot disk.
It should be understood that, by writing the target storage address into the boot program of the boot disk, subsequent data call can be more convenient and accurate, and the speed and efficiency of restoring the backup data are further increased.
Correspondingly, the step S22 specifically includes the following steps:
and writing the target storage address of the backup data of the operating system partition into the configuration parameters of the bootstrap program in the bootstrap disk.
It should be understood that, writing the target storage address into the boot program, specifically, writing the target storage address of the operating system partition backup data into the configuration parameters of the boot program in the boot disk, and in actual operation, writing the target storage address into the configuration data of the redirection boot program, thereby increasing the speed of storing the backup data.
Further, after the step of writing the target storage address of the operating system partition backup data into the configuration parameters of the boot program in the boot disk, the operating system restoring method further includes the following steps:
and restarting the bootstrap program in the boot disk so as to enable the configuration parameters of the bootstrap program in the boot disk to take effect.
It can be understood that, by restarting the boot program in the boot disk, the configuration parameters of the boot program in the boot disk can be enabled to take effect, and the operating system is rapidly started and restored by using the operating system partition backup data; in a specific implementation, the bootstrap program is restarted, so that after the configuration parameters take effect, the restored operation partition can be directly known from the configuration parameters, and then the system boot program and the parameters of the system boot program can be acquired from the operation partition, and then the system boot program can be executed according to the parameters, so that the operation system can be started quickly; the redirected bootstrap program can read the system start program copied and corrected configuration information from the bootstrap disk, and the system start program is executed via the parameters of the system start program to start the operation system fast.
Correspondingly, the step S30 specifically includes the following steps:
and when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by the boot program in the boot disk according to the target storage address in the configuration parameters.
It can be understood that, when receiving an operating system start instruction, the boot program in the boot disk redirects to the operating system partition backup data in the target non-boot disk according to the target storage address in the configuration parameters, thereby ensuring that the operating system obtains the corresponding configuration parameters required by the operating system start in time when starting, further making the subsequent data call more convenient and accurate, facilitating the subsequent backup restoring operation, and accelerating the speed and efficiency of the backup data restoring.
According to the scheme, the data logic address of the operating system partition backup data in the target non-boot disk is obtained, the data logic address is used as the target storage address, and the target storage address is written into the boot program in the boot disk, so that subsequent data calling is more convenient and accurate, the speed and the efficiency of backup data restoration are further increased, the time of backup data restoration is saved, and the user experience is improved.
Based on the embodiment of the operating system restoring method, the invention further provides an operating system restoring device.
Referring to fig. 5, fig. 5 is a functional block diagram of an os restore apparatus according to a first embodiment of the present invention.
In a first embodiment of the os restore apparatus according to the present invention, the os restore apparatus includes:
the storage module 10 is configured to store the operating system partition backup data in a target non-boot disk when a storage space required by the operating system partition backup data is greater than a storage space of the boot disk, where the storage space of the target non-boot disk is greater than the storage space required by the operating system partition backup data.
It should be noted that, the backup data of the operating system partition is data that needs to be backed up by the system, when the storage space required by the operating system partition to backup data is greater than the storage space of the boot disk, i.e., the storage space of the boot disk is not enough to store the os partition backup data, the os partition backup data may be stored to the target non-boot disk, the target non-boot disk is a predetermined disk for storing backup data of the operating system, the storage space of the target non-boot disk is greater than the storage space required by the operating system partition to backup data, that is, the target non-boot disk meets the condition of storing the backup data of the operating system partition, the boot disk and the target non-boot disk are computer software objects or hardware objects capable of storing data, and common hardware disks include: memory, flash memory, hard disk, etc.; common software disks are: a virtual memory linear access space, a file system volume, a hard disk partition, a Logical Unit Number (LUN), and the like, which is not limited in this embodiment; the backup data of the partition of the operating system may be default unchanged data or data updated in real time, which is not limited in this embodiment.
And the boot module 20 is configured to write the target storage address of the operating system partition backup data into the boot program in the boot disk.
It can be understood that, after the operating system partition backup data is stored in the target non-boot disk, a current storage address, that is, a target storage address of the operating system partition backup data may be acquired, and after the target storage address is written in a boot program of the boot disk, preparation may be made for importing the subsequent operating system partition backup data.
And a redirection module 30, configured to redirect, by the boot program in the boot disk, the operating system partition backup data in the target non-boot disk according to the target storage address when receiving an operating system start instruction.
It should be understood that the os boot instruction is an instruction sent by a target user to boot an os, and after receiving the os boot instruction, a redirection operation may be performed, that is, a bootstrap program in the boot disk redirects the os partition backup data in the target non-boot disk according to the target storage address; the operating system starting instruction may be a corresponding disk selection instruction input by a target user through a terminal device, or may be an instruction directly triggered by touching or clicking, or may be an instruction input by other means, which is not limited in this embodiment; the bootstrap program is a preset program for guiding the called operating system partition backup data, and the operating system partition backup data can be accurately acquired through the bootstrap program; the method and the device facilitate the calling of the backup data of the subsequent operating system partitions, accelerate the speed of restoring the backup data and improve the efficiency and the accuracy of restoring the backup data.
The starting module 40 is configured to obtain a system starting program from the operating system partition backup data, and call the system starting program to start and restore the operating system.
It can be understood that the system boot program is a data file necessary for booting the operating system, and the operating system can be booted and restored by obtaining the system boot program from the backup data of the operating system partition and calling the system boot program, so that the operating system operates normally.
The steps implemented by each functional module of the os restoration apparatus may refer to each embodiment of the os restoration method of the present invention, and are not described herein again.
In addition, an embodiment of the present invention further provides a storage medium, where an operating system restoring program is stored on the storage medium, and when executed by a processor, the operating system restoring program implements the following operations:
when the storage space required by the backup data of the operating system partition is larger than the storage space of a boot disk, storing the backup data of the operating system partition into a target non-boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the backup data of the operating system partition;
writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address;
and acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
when the restoration process of the backup data starts, acquiring the data capacity of the backup data of the partition of the operating system;
and judging whether the backup data of the operating system partition is larger than the storage space of the boot disk or not according to the data capacity.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
when the storage space required by the backup data of the partition of the operating system is larger than the storage space of the guide disk, generating and displaying data recovery reminding information;
and after receiving a confirmation instruction of a user, storing the backup data of the operating system partition into a target non-boot disk.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
acquiring the disk capacity of other disks in the target host except the boot disk, and taking the disk with the disk capacity larger than the storage space required by the partition backup data of the operating system as a non-boot disk;
when the number of the non-boot disks is single, taking the non-boot disks as target non-boot disks;
and when the number of the non-boot disks is multiple, respectively calculating the capacity difference between the storage space of each non-boot disk and the storage space required by the backup data of the operating system partition, and taking the non-boot disk with the capacity difference matched with the target capacity difference in the preset disk selection strategy as the target non-boot disk.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
acquiring a data logic address of the operating system partition backup data in the target non-boot disk, and taking the data logic address as a target storage address;
and writing the target storage address into a boot program in the boot disk.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
writing a target storage address of the operating system partition backup data into configuration parameters of a boot program in the boot disk;
correspondingly, when receiving an operating system startup instruction, redirecting, by the boot program in the boot disk, the operating system partition backup data in the target non-boot disk according to the target storage address, specifically including:
and when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by the boot program in the boot disk according to the target storage address in the configuration parameters.
Further, the operating system restoring program, when executed by the processor, further performs the following operations:
and restarting the bootstrap program in the boot disk so as to enable the configuration parameters of the bootstrap program in the boot disk to take effect.
According to the scheme, when the storage space required by the backup data of the operating system partition is larger than that of the boot disk, the backup data of the operating system partition is stored in the target non-boot disk, and the storage space of the target non-boot disk is larger than that required by the backup data of the operating system partition; writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk; when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system starting program is called to start and restore the operating system, the system backup data can be correctly restored without being limited by the size of the system backup data and the size of the magnetic disk of the restoration target computer, the consistency and the safety of the restoration of the backup data are ensured, a user can more conveniently restore the backup operation, and the user experience is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An operating system restoration method, comprising:
when the storage space required by the backup data of the operating system partition is larger than the storage space of a boot disk, storing the backup data of the operating system partition into a target non-boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the backup data of the operating system partition;
writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by a boot program in the boot disk according to the target storage address;
and acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
2. The operating system recovery method according to claim 1, wherein before storing the operating system partition backup data in the target non-boot disk when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, the operating system recovery method further comprises:
when the restoration process of the backup data starts, acquiring the data capacity of the backup data of the partition of the operating system;
and judging whether the backup data of the operating system partition is larger than the storage space of the boot disk or not according to the data capacity.
3. The operating system recovery method according to claim 2, wherein when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, the storing the operating system partition backup data in the target non-boot disk specifically includes:
when the storage space required by the backup data of the partition of the operating system is larger than the storage space of the guide disk, generating and displaying data recovery reminding information;
and after receiving a confirmation instruction of a user, storing the backup data of the operating system partition into a target non-boot disk.
4. The operating system recovery method according to claim 3, wherein storing the operating system partition backup data in the target non-boot disk after receiving the target user confirmation instruction specifically comprises:
acquiring the disk capacity of other disks in the target host except the boot disk, and taking the disk with the disk capacity larger than the storage space required by the partition backup data of the operating system as a non-boot disk;
when the number of the non-boot disks is single, taking the non-boot disks as target non-boot disks;
and when the number of the non-boot disks is multiple, respectively calculating the capacity difference between the storage space of each non-boot disk and the storage space required by the backup data of the operating system partition, and taking the non-boot disk with the capacity difference matched with the target capacity difference in the preset disk selection strategy as the target non-boot disk.
5. The operating system recovery method according to claim 4, wherein the writing the target storage address of the operating system partition backup data into the boot program in the boot disk specifically includes:
acquiring a data logic address of the operating system partition backup data in the target non-boot disk, and taking the data logic address as a target storage address;
and writing the target storage address into a boot program in the boot disk.
6. The operating system recovery method according to claim 5, wherein the writing the target storage address into a boot program in the boot disk specifically includes:
writing a target storage address of the operating system partition backup data into configuration parameters of a boot program in the boot disk;
correspondingly, when receiving an operating system startup instruction, redirecting, by the boot program in the boot disk, the operating system partition backup data in the target non-boot disk according to the target storage address, specifically including:
and when an operating system starting instruction is received, redirecting the operating system partition backup data in the target non-boot disk by the boot program in the boot disk according to the target storage address in the configuration parameters.
7. The operating system restore method of claim 6, wherein after writing the target storage address of the operating system partition backup data into the configuration parameters of the boot program in the boot disk, the operating system restore method further comprises:
and restarting the bootstrap program in the boot disk so as to enable the configuration parameters of the bootstrap program in the boot disk to take effect.
8. An operating system recovery apparatus, the apparatus comprising:
the storage module is used for storing the operating system partition backup data into a target non-boot disk when the storage space required by the operating system partition backup data is larger than the storage space of the boot disk, wherein the storage space of the target non-boot disk is larger than the storage space required by the operating system partition backup data;
the boot module is used for writing a target storage address of the backup data of the operating system partition into a boot program in the boot disk;
the redirection module is used for redirecting the backup data of the operating system partition in the target non-boot disk to the bootstrap program in the boot disk according to the target storage address when receiving an operating system starting instruction;
and the starting module is used for acquiring a system starting program from the backup data of the operating system partition, and calling the system starting program to start and restore the operating system.
9. An operating system restore apparatus, characterized in that the operating system restore apparatus comprises: a memory, a processor, and an operating system restore program stored on the memory and executable on the processor, the operating system restore program configured to implement the steps of the operating system restore method of any of claims 1 to 7.
10. A storage medium having stored thereon an operating system restore program which, when executed by a processor, implements the steps of the operating system restore method of any of claims 1 to 7.
CN201911248405.6A 2019-12-06 2019-12-06 Operating system restoration method, device, equipment and storage medium Active CN110941516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911248405.6A CN110941516B (en) 2019-12-06 2019-12-06 Operating system restoration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911248405.6A CN110941516B (en) 2019-12-06 2019-12-06 Operating system restoration method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110941516A true CN110941516A (en) 2020-03-31
CN110941516B CN110941516B (en) 2023-02-17

Family

ID=69909596

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911248405.6A Active CN110941516B (en) 2019-12-06 2019-12-06 Operating system restoration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110941516B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000342A (en) * 2020-08-14 2020-11-27 北京浪潮数据技术有限公司 Operating system installation method, device, equipment and storage medium
CN116225784A (en) * 2023-02-27 2023-06-06 惠州市海葵信息技术有限公司 Application program guide backup method, single chip microcomputer and computer readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707440A (en) * 2004-12-21 2005-12-14 西安三茗科技有限责任公司 Data backup recovery and authority control method for hard disk linux document system
CN101183324A (en) * 2007-12-10 2008-05-21 上海北大方正科技电脑系统有限公司 Recovery method of computer system
CN102214127A (en) * 2010-11-15 2011-10-12 上海安纵信息科技有限公司 Method for intensively storing and backing up data based on operating system virtualization theory
CN102567136A (en) * 2010-12-15 2012-07-11 研祥智能科技股份有限公司 Backup and recovery method of computer system, device and computer system
CN103559101A (en) * 2013-10-15 2014-02-05 华为技术有限公司 Data backup and recovery method of operating system, storage device and terminal
US20140195791A1 (en) * 2013-01-08 2014-07-10 Symantec, Inc. Methods and systems for instant restore of system volume
CN107193506A (en) * 2017-06-22 2017-09-22 山东超越数控电子有限公司 A kind of implementation method for kylin system root partition dilatation of getting the bid
CN108062262A (en) * 2017-12-25 2018-05-22 厦门市美亚柏科信息股份有限公司 Operating system backup-and-restore method and its system based on storage sector data
CN109144779A (en) * 2018-08-01 2019-01-04 中影环球(北京)科技有限公司 The backup and restoration methods of TMS server, (SuSE) Linux OS

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1707440A (en) * 2004-12-21 2005-12-14 西安三茗科技有限责任公司 Data backup recovery and authority control method for hard disk linux document system
CN101183324A (en) * 2007-12-10 2008-05-21 上海北大方正科技电脑系统有限公司 Recovery method of computer system
CN102214127A (en) * 2010-11-15 2011-10-12 上海安纵信息科技有限公司 Method for intensively storing and backing up data based on operating system virtualization theory
CN102567136A (en) * 2010-12-15 2012-07-11 研祥智能科技股份有限公司 Backup and recovery method of computer system, device and computer system
US20140195791A1 (en) * 2013-01-08 2014-07-10 Symantec, Inc. Methods and systems for instant restore of system volume
CN103559101A (en) * 2013-10-15 2014-02-05 华为技术有限公司 Data backup and recovery method of operating system, storage device and terminal
CN107193506A (en) * 2017-06-22 2017-09-22 山东超越数控电子有限公司 A kind of implementation method for kylin system root partition dilatation of getting the bid
CN108062262A (en) * 2017-12-25 2018-05-22 厦门市美亚柏科信息股份有限公司 Operating system backup-and-restore method and its system based on storage sector data
CN109144779A (en) * 2018-08-01 2019-01-04 中影环球(北京)科技有限公司 The backup and restoration methods of TMS server, (SuSE) Linux OS

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000342A (en) * 2020-08-14 2020-11-27 北京浪潮数据技术有限公司 Operating system installation method, device, equipment and storage medium
CN116225784A (en) * 2023-02-27 2023-06-06 惠州市海葵信息技术有限公司 Application program guide backup method, single chip microcomputer and computer readable storage medium
CN116225784B (en) * 2023-02-27 2024-04-09 惠州市海葵信息技术有限公司 Application program guide backup method, single chip microcomputer and computer readable storage medium

Also Published As

Publication number Publication date
CN110941516B (en) 2023-02-17

Similar Documents

Publication Publication Date Title
US9870288B2 (en) Container-based processing method, apparatus, and system
US10067835B2 (en) System reset
US20110213954A1 (en) Method and apparatus for generating minimum boot image
US20070226436A1 (en) File system based offline disk management
CN109445861A (en) System start method, device, computer installation and storage medium
CN110941516B (en) Operating system restoration method, device, equipment and storage medium
CN110109628B (en) Data reconstruction method, device, equipment and storage medium of distributed storage system
CN112612417B (en) Data migration method, device, equipment and storage medium
CN112596950A (en) Virtual machine data backup method, device, equipment and storage medium
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
JPWO2004081791A1 (en) Virtual machine system and firmware update method in virtual machine system
CN108446144B (en) Application program starting method and device, terminal and storage medium
KR101552580B1 (en) Method for system recovery including mobile device and backup supporting multi operation system
US20220413733A1 (en) mon service migration method, apparatus, and device, and readable storage medium
CN108509252B (en) Virtual machine starting device and method and host
US20130179653A1 (en) Apparatus and method for partitioning memory area for application preloading in a wireless terminal
CN114253752A (en) Application crash processing method, device, equipment and medium
CN115437748A (en) Virtual machine starting method and device and electronic equipment
CN114217869A (en) Starting method, device and medium for diskless client
CN116627515A (en) Partition switching starting method and device of embedded system
CN112612646A (en) Application quick recovery method, device, equipment and storage medium
CN114328415A (en) Log recording method, apparatus and non-volatile storage medium
CN115220672A (en) Layer display method, device, equipment and medium
CN117806767A (en) Method and device for improving virtual machine creation time, storage medium and electronic equipment
CN117472272A (en) Method and terminal for formatting magnetic disk

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
GR01 Patent grant
GR01 Patent grant