System disk switching method and device, equipment and storage medium

By detecting the system disk startup operation and automatically switching to the backup disk in case of a failure, the problem of manual intervention in the system disk boot failure in the prior art is solved, and the high availability of the computer system is achieved.

CN120234053AInactive Publication Date: 2025-07-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510725180.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-07-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, manual intervention in switching is required when the system disk boot fails, resulting in slow switching speed and the high availability of the computer system cannot be guaranteed.

Method used

The monitoring software detects the startup operation of the system disk, determines whether it is enabled, and starts the timer after receiving the startup fault signal. If the startup success signal is not detected before the timer expires, it will automatically switch to the backup system disk to boot the system.

Benefits of technology

It realizes automatic switching without manual intervention when the system fails during startup, ensuring high availability of the computer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234053A_ABST
    Figure CN120234053A_ABST
Patent Text Reader

Abstract

The invention discloses a system disk switching method and device, equipment and a storage medium, and relates to the technical field of storage systems.The method comprises the steps that if starting operation of a first system disk is detected, whether monitoring software is enabled or not is judged; wherein the first system disk starting operation is used for guiding system starting through the first system disk; starting a timer under the condition that the monitoring software is enabled and the starting fault signal is received; the starting fault signal is used for indicating that the system breaks down in the starting process; if the starting success signal is not detected before the timer is overdue, judging whether a second system disk exists or not; the starting success signal is used for indicating system starting success; and if yes, switching to guide the system to start through the second system disk. By the adoption of the technical scheme, manual intervention is not needed, automatic switching can be achieved when faults occur in the system starting process, and then high availability of the computer system is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of storage systems, and particularly to a method, device, equipment and storage medium for switching system disks. Background Art

[0002] In a computer system, the system disk is a key component for booting the operating system. However, due to reasons such as hardware failures, software errors, or virus attacks, the system disk may experience a boot failure, causing the entire system to malfunction. To solve this problem, existing technologies usually adopt a redundant system disk configuration. When the default system disk has a boot failure, it is then manually switched to the backup system disk.

[0003] However, this method relies on manual intervention, has a slow switching speed, and cannot ensure the high availability of the system.

[0004] Therefore, there is an urgent need for a method for switching system disks that can automatically switch without manual intervention when a failure occurs during the system startup process, thereby ensuring the high availability of the computer system. Summary of the Invention

[0005] This application provides a method, device, equipment and storage medium for switching system disks to at least solve the problems in the related technologies that rely on manual intervention, have a slow switching speed, and cannot ensure the high availability of the system.

[0006] This application provides a method for switching system disks, the method comprising: If a first system disk startup operation is detected, then determine whether monitoring software is enabled; wherein, the first system disk startup operation is used to boot the system through the first system disk; When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process; If a startup success signal is not detected before the timer expires, then determine whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process; If so, then switch to boot the system through the second system disk.

[0007] This application also provides a device for switching system disks, the device comprising: A first detection module, configured to determine whether monitoring software is enabled if a first system disk startup operation is detected; wherein, the first system disk startup operation is used to boot the system through the first system disk; A startup module, configured to start a timer when the monitoring software is enabled and a startup fault signal is received; the startup fault signal is used to indicate that a fault occurs during the startup process of the system; A second detection module, configured to determine whether there is a second system disk if a startup success signal is not detected before the timer expires; the startup success signal is used to indicate that the system starts successfully during the startup process; A switching module, configured to switch to booting the system through the second system disk if so.

[0008] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above system disk switching methods when executing the computer program.

[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above system disk switching methods are implemented.

[0010] The present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above system disk switching methods are implemented.

[0011] Through the present application, if a startup operation of the first system disk is detected, it is determined whether the monitoring software is enabled. The startup operation of the first system disk is used to boot the system through the first system disk. When the monitoring software is enabled and a startup fault signal is received, a timer is started. If a startup success signal is not detected before the timer expires, it is determined whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process; if so, switch to booting the system through the second system disk. With the technical solution of the present application, it is possible to automatically switch without manual intervention when a fault occurs during the system startup process, thereby ensuring the high availability of the computer system. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0013] Figure 1 The flowchart showing a system disk switching method provided by an embodiment of the present application is shown; Figure 2 The flowchart showing a system disk switching method provided by an embodiment of the present application is shown; Figure 3 The structural schematic diagram of a switching device for a system disk provided by an embodiment of the present application is shown. Detailed implementation manners

[0014] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0015] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0017] Specifically, Figure 1 The flowchart of a switching method for a system disk provided by an embodiment of the present application is shown. The specific steps of this method are as follows: S101. If a first system disk startup operation is detected, it is determined whether the monitoring software is enabled; wherein, the first system disk startup operation is used to boot the system through the first system disk.

[0018] In one example, before determining whether the monitoring software is enabled, the method further includes: Configuring the enabling of the monitoring software according to a preset logic.

[0019] In one example, the first system disk is a key component for booting the system. The monitoring software can be a watchdog, which is used to monitor the running state of the system. The system needs to send a signal to the watchdog regularly to indicate its normal operation. If the system fails and cannot send the signal on time, the watchdog will trigger a predefined action, such as resetting the first system disk.

[0020] In this embodiment, configuring the enabling of the monitoring software according to a preset logic, specifically, reference can be made to Table 1.

[0021] Table 1 Configuring the enabling of the monitoring software according to a preset logic

[0022] In Table 1, NA means empty, Other OS means other systems, TRUE means the monitoring software is enabled, and FALSE means the monitoring software is not enabled.

[0023] S102: When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process.

[0024] In one example, the startup failure signal can be os loader start. If the monitoring software is enabled and the startup failure signal is received, it means that an abnormality occurs during the system startup process, and then the timer is started for timing at this time. The advantage of such a setting is that through the redundant time, the situation of erroneously switching the second system disk or restarting the first system disk due to misjudgment can be avoided.

[0025] S103: If a startup success signal is not detected before the timer expires, determine whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process.

[0026] In one example, if a startup success signal is not detected before the timer expires, it means that the system does not start successfully, and then it is determined whether there is a second system disk at this time.

[0027] In one example, the dual-system disk architecture involves two independent system disks, one as the primary system disk and the other as the backup system disk. In this embodiment, the first system disk is used as the primary system disk. When the first system disk cannot boot the system, the backup system disk will take over to ensure the continuous availability of the system.

[0028] S104: If so, switch to boot the system through the second system disk.

[0029] In one example, the second system disk is used as the backup system disk. After determining that it is a dual-system disk, the first system disk is switched to the second system disk, and then switched to boot the system through the second system disk.

[0030] A method for switching system disks provided by an embodiment of the present application, the method includes: if a first system disk startup operation is detected, determine whether the monitoring software is enabled; wherein, the first system disk startup operation is used to boot the system through the first system disk. When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process. If a startup success signal is not detected before the timer expires, determine whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process. If so, switch to boot the system through the second system disk. With this technical solution, it is possible to automatically switch without manual intervention when a failure occurs during the system startup process, thereby ensuring the high availability of the computer system.

[0031] Specifically, Figure 2 The flowchart of a method for switching system disks provided by an embodiment of the present application is shown, and the specific steps of the method are as follows: S201. If a first system disk startup operation is detected, determine whether the monitoring software is enabled; wherein, the first system disk startup operation is used to boot the system through the first system disk.

[0032] In one example, after determining whether the monitoring software is enabled, the method further includes: If not, stop the switching of the system disk.

[0033] In one example, if the monitoring software is not enabled, according to the situation in Table 1, it shows that there is no need to switch the system disk at this time, so stop the switching of the system disk.

[0034] In one example, after determining whether the monitoring software is enabled, the method further includes: Configure the monitoring duration and the configured timeout times of the monitoring software; wherein, the monitoring duration is the timing period of the timer; the configured timeout times are used to represent the number of times of switching the system disk.

[0035] In one example, the monitoring duration is the duration starting from when the timer starts. Among them, the timing period is preset by the user. For example, the timing period can be 10S, the start time of the timer is 12:10:40S, then the start time of the timer is 12:10:40S, and the end time of the timer is 12:10:50S.

[0036] In one example, the configured timeout times are used to represent the number of times of switching the system disk. For example, the configured timeout times can be 3 times, which means that the maximum number of times of switching the system disk is 3 times.

[0037] In one example, after switching to boot the system through the second system disk, the method further includes: Increase the number of switches by a preset number to obtain a target number; If the target number is greater than or equal to the configured timeout number, exit the monitoring software and record the state of the first system disk at the current moment.

[0038] In one example, the preset number can be 1. That is, when the system disk is switched once, the number of switches is increased by the preset number. For example, if the initial value of the number of switches is 0, after switching to boot the system using the second system disk, the target number is 1. If the target number is greater than or equal to 3, exit the monitoring software and record the state of the first system disk at the current moment. This indicates that the system disk is frequently switched, and it is necessary to maintain and record the state of the first system disk at the current moment so that the reason for the system startup failure can be queried in a timely manner.

[0039] S202. When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process.

[0040] In one example, the content of this step can refer to the content of step S102 and will not be elaborated here.

[0041] S203. If a startup success signal is not detected before the timer expires, determine whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process.

[0042] In one example, the expiration of the timer means exceeding the counting period.

[0043] In one example, the method further includes: If a startup success signal is detected before the timer expires, exit the monitoring software.

[0044] In one example, if a startup success signal is detected before the timer expires, it means that the system startup is delayed, but it has started successfully before the counting period. Since the system has started successfully, exit the monitoring software.

[0045] In one example, after determining whether there is a second system disk, the method further includes: If not, restart the system to boot using the first system disk.

[0046] In one example, if there is no second system disk, it is still necessary to restart the system to boot using the first system disk. At this time, the number of switches can be increased by the preset number to obtain a target number; if the target number is greater than or equal to the configured timeout number, exit the monitoring software and record the state of the first system disk at the current moment. In this embodiment, the number of switches can also be used to represent the number of times of restarting the same system disk.

[0047] The specific startup process of the first system disk can be referred to as follows: If a startup operation of the first system disk is detected, it is determined whether the monitoring software is enabled; wherein, the startup operation of the first system disk is used to boot the system through the first system disk. When the monitoring software is enabled and a startup failure signal is received, a timer is started; the startup failure signal is used to indicate that a failure occurs during the system startup process. If a startup success signal is detected before the timer expires, the monitoring software is exited.

[0048] S204. If so, if a startup operation of the second system disk is detected, it is determined whether the monitoring software is enabled; wherein, the startup operation of the second system disk is used to boot the system through the second system disk.

[0049] In one example, the method further includes: Configure the system disk status in the startup status register of the system disk to a second preset value, and configure the status of the storage disk position register to a third preset value.

[0050] Among them, the second preset value can be 0. Further, the second preset value is used to represent that a failure occurs during the process of booting the system. This failure may occur during the process of booting the system by the first system disk or during the process of booting the system by the second system disk.

[0051] In one example, the third preset value can be 1, wherein the third preset value is used to represent the identification information of the first system disk, that is, it indicates that the first system disk is currently used to boot the system.

[0052] In this embodiment, during the process of switching to booting the system through the second system disk, the status configuration of the storage disk position register is modified from the third preset value to the fourth preset value.

[0053] Among them, the fourth preset value can be 2, and the fourth preset value represents the identification information of the second system disk, that is, it indicates that the second system disk is currently used to boot the system. In this embodiment, if the status configuration of the storage disk position register is modified from the third preset value to the fourth preset value, it indicates that the startup operation of the system is switched from the first system disk to the second system disk.

[0054] The advantage of such a setting is that it is possible to determine whether the system startup is successful by checking the system disk status in the startup status register of the system disk, and to determine which system disk is currently used to boot the system by checking the status of the storage disk position register.

[0055] S205. When the monitoring software is enabled and a startup success signal is received, configure the system disk status in the startup status register of the system disk to a first preset value, and then exit the monitoring software; where the first preset value is used to indicate that the system has started successfully during the startup process.

[0056] In this embodiment, the startup success signal indicates that the system has started successfully. If the system has started successfully, the system disk status in the startup status register of the system disk can be set to the first preset value. The first preset value is used to indicate that the system has started successfully during the startup process. Specifically, the system may be successfully booted by the first system disk or the second system disk.

[0057] S206. When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure has occurred during the system startup process.

[0058] In one example, the content of this step can refer to the content of step S102 and will not be elaborated here.

[0059] S207. If a startup success signal is not detected before the timer expires, determine whether there is a first system disk; the startup success signal is used to indicate that the system has started successfully during the startup process.

[0060] In one example, the content of this step can refer to the content of step S103 and will not be elaborated here.

[0061] S208. If so, switch to booting the system through the first system disk.

[0062] In one example, the content of this step can refer to the content of step S104 and will not be elaborated here.

[0063] A system disk switching method provided by an embodiment of the present application includes: after switching to booting the system through the second system disk, increase the number of switches by a preset number to obtain a target number; if the target number is greater than or equal to the configured timeout number, exit the monitoring software and record the status of the first system disk at the current moment. The number of switches can also be used to represent the number of times of restarting the same system disk. With this technical solution, the system disk will not be frequently switched or restarted, and the damage rate of the system disk can be reduced.

[0064] Specifically, Figure 3 FIG. shows a schematic structural diagram of a system disk switching device provided by an embodiment of the present application. The device 30 includes: A first detection module 301, configured to determine whether the monitoring software is enabled if a first system disk startup operation is detected; where the first system disk startup operation is used to boot the system through the first system disk. The startup module 302 is used to start a timer when the monitoring software is enabled and a startup failure signal is received; the startup failure signal is used to indicate that a failure occurs during the startup process of the system; The second detection module 303 is used to determine whether there is a second system disk if a startup success signal is not detected before the timer expires; the startup success signal is used to indicate that the system starts successfully during the startup process; The switching module 304 is used to, if so, switch to booting the system through the second system disk.

[0065] In one example, the device 30 further includes: The third detection module 305 is used to exit the monitoring software if a startup success signal is detected before the timer expires.

[0066] In one example, after determining whether the monitoring software is enabled, the device 30 further includes: The configuration module 306 is used to configure the monitoring duration and the configuration timeout times of the monitoring software; wherein, the monitoring duration is the timing period of the timer; the configuration timeout times are used to represent the number of times of switching the system disk.

[0067] In one example, after switching to booting the system through the second system disk, the device 30 further includes: The increment module 307 is used to increment the number of switching times by a preset number of times to obtain a target number; The exit module 308 is used to exit the monitoring software and record the state of the first system disk at the current moment if the target number is greater than or equal to the configuration timeout times.

[0068] In one example, the switching module 304 is used to: If a second system disk startup operation is detected, determine whether the monitoring software is enabled; wherein, the second system disk startup operation is used to boot the system through the second system disk; When the monitoring software is enabled and a startup success signal is received, configure the system disk state in the startup status register of the system disk to a first preset value, and exit the monitoring software; wherein, the first preset value is used to represent that the system starts successfully during the startup process; When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the startup process of the system; If a startup success signal is not detected before the timer expires, determine whether there is a first system disk; the startup success signal is used to indicate that the system starts successfully during the startup process; If so, switch to booting the system through the first system disk.

[0069] In one example, after determining whether there is a second system disk, the apparatus 30 further includes: A determination module 309, configured to, if not, restart the first system disk to boot the system.

[0070] In one example, after determining whether the monitoring software is enabled, the apparatus 30 further includes: A stop module 310, configured to, if not, stop the switching of the system disk.

[0071] For the description of the features in the corresponding embodiments of the system disk switching device, reference may be made to the relevant descriptions in the corresponding embodiments of the system disk switching method, which will not be elaborated here one by one.

[0072] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above embodiments of the system disk switching method.

[0073] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any one of the above embodiments of the system disk switching method when running.

[0074] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.

[0075] An embodiment of the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any one of the above embodiments of the system disk switching method are implemented.

[0076] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any one of the above embodiments of the system disk switching method are implemented.

[0077] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0078] The above has introduced in detail a method for switching system disks provided by this application. Specific examples have been used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for switching system disks, characterized in that, The method includes: If a first system disk startup operation is detected, determine whether the monitoring software is enabled; wherein, the first system disk startup operation is used to boot the system through the first system disk; When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process; If a startup success signal is not detected before the timer expires, determine whether there is a second system disk; the startup success signal is used to indicate that the system starts successfully during the startup process; If so, switch to booting the system through the second system disk.

2. The method for switching the system disk according to claim 1, wherein The method further includes: If a startup success signal is detected before the timer expires, exit the monitoring software.

3. The method for switching the system disk according to claim 1, wherein After determining whether the monitoring software is enabled, the method further includes: Configure the monitoring duration and the configured timeout count of the monitoring software; wherein, the monitoring duration is the counting period of the timer; the configured timeout count is used to represent the number of system disk switches.

4. The method for switching system disks according to claim 3, wherein, After switching to booting the system through the second system disk, the method further includes: Increase the number of switches by a preset number to obtain a target number; If the target number is greater than or equal to the configured timeout count, exit the monitoring software and record the state of the first system disk at the current moment.

5. The method for switching system disks according to claim 1, wherein The switching to booting the system through the second system disk includes: If a second system disk startup operation is detected, determine whether the monitoring software is enabled; wherein, the second system disk startup operation is used to boot the system through the second system disk; When the monitoring software is enabled and a startup success signal is received, configure the system disk state in the startup status register of the system disk to a first preset value and exit the monitoring software; wherein, the first preset value is used to represent that the system starts successfully during the startup process; When the monitoring software is enabled and a startup failure signal is received, start a timer; the startup failure signal is used to indicate that a failure occurs during the system startup process; If a startup success signal is not detected before the timer expires, determine whether there is a first system disk; the startup success signal is used to indicate that the system starts successfully during the startup process; If so, switch to booting the system through the first system disk.

6. The method for switching system disks according to claim 1, wherein After determining whether there is a second system disk, the method further includes: If not, restart the system to boot through the first system disk.

7. The method for switching the system disk according to claim 1, wherein After determining whether the monitoring software is enabled, the method further includes: If not, stop the switching of the system disk.

8. A switching device for a system disk, characterized in that The device includes: A first detection module, configured to determine whether the monitoring software is enabled if a first system disk startup operation is detected; wherein, the first system disk startup operation is used to boot the system through the first system disk; A startup module, configured to start a timer when the monitoring software is enabled and a startup failure signal is received; the startup failure signal is used to indicate that a failure occurs during the system startup process; A second detection module, configured to determine whether there is a second system disk if a startup success signal is not detected before the timer expires; the startup success signal is used to indicate that the system has started successfully during the startup process; A switching module, configured to, if so, switch to booting the system through the second system disk.

9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the system disk switching method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the system disk switching method according to any one of claims 1 to 7 when executed by a processor.

Citation Information

Patent Citations

  • System disk switching method and device for linux operating system

    CN104156286A

  • Method and system for starting computer with multiple operating systems

    CN115167930A

  • Double-insurance operation method and system for preventing system faults

    CN118609233A