CN110941516B - 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
CN110941516B
CN110941516B CN201911248405.6A CN201911248405A CN110941516B CN 110941516 B CN110941516 B CN 110941516B CN 201911248405 A CN201911248405 A CN 201911248405A CN 110941516 B CN110941516 B CN 110941516B
Authority
CN
China
Prior art keywords
operating system
boot
backup data
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.)
Active
Application number
CN201911248405.6A
Other languages
Chinese (zh)
Other versions
CN110941516A (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 Clerware Technology Co ltd
Original Assignee
Shenzhen Clerware 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 Clerware Technology Co ltd filed Critical Shenzhen Clerware 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 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 startup 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 guide 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 provided: 1. 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; 2. increasing the size of the 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 operating system partition backup data 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 partition of the operating system is larger than the storage space of a guide 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 that 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 boot 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 bootstrap program in the boot disk according to the target storage address in the configuration parameters.
Preferably, after writing the target storage address of the os partition backup data into the configuration parameter of the boot program in the boot disk, the os restore 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, where an operating system restoring program is stored, and the operating system restoring program, when executed by a processor, 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 bootstrap program in the bootstrap disk to the operating system partition backup data in the target non-bootstrap 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 partition backup data of the operating system and calling the system starting program so as 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 operating system partition backup data 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 present invention will be further described 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 do not 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 operating system partition backup data into a boot program in the boot disk; when an operating system starting instruction is received, a bootstrap program in the bootstrap disk redirects operating system partition backup data in a target non-bootstrap disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system startup 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 ensured, a user can more conveniently store backup data, the user experience is improved, and the technical problems that the data are easy to lose and the backup data cannot be effectively stored when the system backup data is restored in the prior art 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 recovery device configuration shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, 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 that 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 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;
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 capacities 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 the 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 bootstrap 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 operating system partition backup data into a boot program in the boot disk; when an operating system starting instruction is received, a bootstrap program in the bootstrap disk redirects operating system partition backup data in a target non-bootstrap 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 backup data of the operating system partition is larger than that of the 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 that required by the backup data of the operating system partition.
It should be noted that, the os partition backup data is data that needs to be backed up and restored, when a storage space required by the os partition backup data is larger than a storage space of a 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 a target non-boot disk, where the target non-boot disk is a disk that is predetermined to store 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 a condition for storing the os partition backup data, the boot disk and the target non-boot disk are computer software objects or hardware objects that can store data, and a common hardware disk includes: 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 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 partition of the operating system is larger than the storage space of a guide 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 backup data of the operating system partition into a 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 step S30, 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.
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 method is convenient for calling the partition backup data of the subsequent operating system, accelerates the data backup speed, and improves the efficiency and the accuracy of the data backup.
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.
And S40, acquiring a system starting program from the operating system partition backup data, and calling 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.
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, a bootstrap program in the bootstrap disk redirects operating system partition backup data in a target non-bootstrap disk according to the target storage address; acquiring a system starting program from the backup data of the operating system partition; the system startup 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 guide 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 S11, when the storage space required by the backup data of the operating system partition is larger than that of the boot disk, generating and displaying 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 that 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 S12, storing the backup data of the operating system partition into a target non-boot disk after receiving a confirmation instruction of a user.
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 capacities 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, and by obtaining disk capacities of other disks in the target host except the boot disk, a non-boot disk whose disk capacity is larger than a storage space required by the operating system partition backup data can be screened out, and then when the number of the non-boot disks is single, the non-boot disk is directly determined as a target non-boot disk, and when the number of the non-boot disks is multiple, a 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 a target capacity difference in a preset disk selection policy is taken as the target non-boot disk, where the preset disk selection policy may take the non-boot disk with the largest capacity difference as the target non-boot disk, may also take the non-boot disk with the smallest capacity difference as the target non-boot disk, and may also determine that the non-boot disk with the largest capacity difference satisfies the target storage space as the target non-boot disk, and this embodiment of course, and this embodiment does not restrict the non-boot disk; the partition backup data of the operating system can be effectively stored, the storage space is saved, the waste of the storage space is avoided, and the data backup cost is saved.
According to the scheme, when the storage space required by the backup data of the partition of the operating system is larger than that of the boot disk, the data recovery reminding information is generated and displayed; after receiving a confirmation instruction of a user, storing the partition backup data of the operating system into a target non-boot disk, particularly when the number of the non-boot disks is multiple, respectively calculating a capacity difference between a storage space of each non-boot disk and a storage space required by the partition backup data of the operating system, 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 independent replacement of the storage disk 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, obtaining a data logical address of the operating system partition backup data in the target non-boot disk, and using 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 obtained, the data logical address may be used as a target storage address to prepare for subsequent data calling.
And S22, writing the target storage address into a 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 writes the target storage address of the backup data of the operating system partition 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 bootstrap disk so as to enable the configuration parameters of the bootstrap program in the bootstrap 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 with copied and corrected configuration information from the bootstrap disc, 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 bootstrap program in the boot disk according to the target storage address in the configuration parameters.
It can be understood that, when an operating system start instruction is received, the boot program in the boot disk redirects 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, so that the subsequent data call is more convenient and accurate, the subsequent backup restoring operation is facilitated, and the speed and efficiency of the backup restoring data are increased.
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 operating system partition backup data is data that needs system backup, when a storage space required by the operating system partition backup data is larger than a storage space of a boot disk, that is, the storage space of the boot disk is not enough to store the operating system partition backup data, the operating system partition backup data may be stored in a target unguided disk, the target unguided disk is a predetermined disk for storing the operating system backup data, the storage space of the target unguided disk is larger than the storage space required by the operating system partition backup data, that is, the target unguided disk satisfies a condition for storing the operating system partition backup data, the boot disk and the target unguided disk are computer software objects or hardware objects that can store data, and a common hardware disk includes: 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 a boot module 20, configured to write a target storage address of the operating system partition backup data into a 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 starting the operating system, and the operating system can be started and restored by acquiring the system boot program from the backup data of the operating system partition and calling the system boot program, so that the operating system runs 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 that 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 capacities 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 implements 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 bootstrap 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 bootstrap disk so as to enable the configuration parameters of the bootstrap program in the bootstrap 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 operating system partition backup data 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 operating system partition backup data; the system startup 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 guide 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 one of 8230, and" comprising 8230does not exclude the presence of additional like elements in a process, method, article, or apparatus comprising 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 (8)

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, a bootstrap program in the bootstrap disk redirects operating system partition backup data in a target non-bootstrap disk according to the target storage address;
acquiring a system starting program from the operating system partition backup data, and calling the system starting program to start and restore an operating system;
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 into the target non-boot disk, including:
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;
after receiving a confirmation instruction of a user, acquiring the disk capacity of other disks except the boot disk in a target host, and taking the disk with the disk capacity larger than the storage space required by the backup data of the operating system partition 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.
2. The operating system restore method according to claim 1, wherein before storing 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 operating system restore 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 1, 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.
4. The operating system recovery method according to claim 3, 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 boot 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.
5. The operating system restore method of claim 4, 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.
6. 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;
the starting module is used for acquiring a system starting program from the operating system partition backup data and calling the system starting program so as to start and restore the operating system;
wherein the storage module is further configured to:
when the storage space required by the backup data of the partition of the operating system is larger than that of the guide disk, generating and displaying data recovery reminding information;
after receiving a confirmation instruction of a user, acquiring the disk capacity of other disks except the boot disk in a target host, and taking the disk with the disk capacity larger than the storage space required by the backup data of the operating system partition 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.
7. An operating system restore device, comprising: memory, a processor and an operating system restore program stored on the memory and executable on the processor, the operating system restore program being configured to implement the steps of the operating system restore method of any of claims 1 to 5.
8. A storage medium having an operating system recovery program stored thereon, wherein the operating system recovery program, when executed by a processor, implements the steps of the operating system recovery method according to any one of claims 1 to 5.
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 CN110941516A (en) 2020-03-31
CN110941516B true 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)

Families Citing this family (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
CN116225784B (en) * 2023-02-27 2024-04-09 惠州市海葵信息技术有限公司 Application program guide backup method, single chip microcomputer and computer readable storage medium

Citations (6)

* 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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214127B (en) * 2010-11-15 2013-01-09 上海安纵信息科技有限公司 Method for intensively storing and backing up data based on operating system virtualization theory
CN102567136B (en) * 2010-12-15 2016-08-24 研祥智能科技股份有限公司 The backup of a kind of computer system, method of reducing, device and computer system
US9384094B2 (en) * 2013-01-08 2016-07-05 Veritas Us Ip Holdings Llc Method and system for instant restore of system volume from a backup image

Patent Citations (6)

* 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
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

Also Published As

Publication number Publication date
CN110941516A (en) 2020-03-31

Similar Documents

Publication Publication Date Title
US9870288B2 (en) Container-based processing method, apparatus, and system
EP2652599B1 (en) System reset
US20110213954A1 (en) Method and apparatus for generating minimum boot image
JP6506412B2 (en) Application loading method and apparatus
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
CN109710286B (en) System upgrading method, device, equipment and storage medium
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
CN112596950A (en) Virtual machine data backup method, device, equipment and storage medium
US6470446B1 (en) Method for preparing computer hard disks during installation of a network operating system
US9619340B1 (en) Disaster recovery on dissimilar hardware
EP3769225B1 (en) Free space pass-through
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
CN108509252B (en) Virtual machine starting device and method and host
CN113950673A (en) Non-volatile storage partition identifier
EP2613254A2 (en) Apparatus and method for partitioning memory area for application preloading in a wireless terminal
JPWO2020065778A1 (en) Information processing equipment, control methods, and programs
JP7355876B2 (en) Program startup method, equipment, and storage medium
US20220358215A1 (en) Detection of Anomalous Backup Files Using Known Anomalous File Fingerprints
CN109564533B (en) Device and method for supporting execution of guide process in instant recovery process
CN114253752A (en) Application crash processing method, device, equipment and medium
CN114217869A (en) Starting method, device and medium for diskless client
CN112612646A (en) Application quick recovery method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant