System hierarchical isolation method and device, equipment and storage medium
By migrating the system read/write partition and root partition to a temporary running directory and stacking them to the real root directory in the embedded Linux device, the problems of slow read/write speed and easy data loss are solved, and the stability and performance of the system are optimized.
Patent Information
- Application Number
- CN202511186951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2025-12-16
AI Technical Summary
Embedded Linux devices suffer from slow read/write speeds, small storage space, and easy data loss, especially when the system partition is not protected, making data recovery difficult.
By adopting a system-level isolation method, the mount points of the system read/write partition and the system root partition are migrated to a temporary running directory, and then stacked and mounted to the real root directory through joint mount technology, thereby achieving multi-level system protection and performance optimization.
By maintaining the root partition of the basic system in a read-only state through a layered isolation mechanism, business operations are prevented from damaging core files. Temporary running directories are used to accelerate data reading and writing, reduce the frequency of read and write operations on the physical disk, and ensure that data is not lost after a restart.
Smart Images

Figure CN121144102A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of Linux operating systems, and provides a system hierarchical isolation method and device, equipment and a storage medium. BACKGROUND
[0002] In the field of embedded Linux devices, early business program functions are relatively single. Nowadays, more and more embedded devices support the deployment of standard operating systems, and users can independently install third-party Red Hat Package Manager (RPM) software and carry out secondary development.
[0003] However, embedded devices generally have the characteristic of limited performance, and usually use a Serial Advanced Technology Attachment Solid State Drive (SATA SSD) or an embedded Multi Media Card (EMMC) as a storage medium, which not only has a small storage space, but also has a relatively slow read-write speed. If a standard system is directly deployed to the device, since the system partition is not protected, the device is prone to data loss during operation, and data recovery is extremely difficult after an accident occurs.
[0004] Therefore, it is necessary to provide a new system hierarchical isolation method to overcome the above-mentioned defects. SUMMARY
[0005] The embodiments of the present application provide a system hierarchical isolation method, device, equipment and storage medium to solve the problems of slow read-write speed and easy data loss.
[0006] In a first aspect, the embodiments of the present application provide a system hierarchical isolation method, comprising:
[0007] When it is determined that the temporary root file system is configured with a system read-write partition, migrating partition mount points of the system read-write partition and a system root partition to a temporary running directory, and stacking and mounting the two partition mount points to a real root directory;
[0008] Migrating a partition mount point of a system temporary partition to the temporary running directory, and stacking and mounting the three partition mount points to the real root directory;
[0009] Migrating the three partition mount points from the originally mounted temporary running directory to a real running directory.
[0010] Optionally, the migrating the partition mount points of the system read-write partition and the system root partition to the temporary running directory, and stacking and mounting the partition mount points of the two partitions to the real root directory comprises:
[0011] migrating the partition mount point of the system read-write partition to a temporary running system read-write directory, and migrating the partition mount point of the system root partition to a temporary running system root directory;
[0012] stacking and mounting the partition mount points of the two partitions to the real root directory by a joint mounting technique.
[0013] Optionally, the migrating the partition mount point of the system temporary partition to the temporary running directory and stacking and mounting the three partition mount points to the real root directory comprises:
[0014] migrating the partition mount point of the system temporary partition to a temporary running system temporary directory;
[0015] stacking and mounting the partition mount points of the three partitions to the real root directory by a joint mounting technique.
[0016] Optionally, the migrating the three partition mount points from the originally mounted temporary running directory to a real running directory comprises:
[0017] migrating the partition mount point of the system read-write partition from the temporary running system read-write directory to a real running system read-write directory;
[0018] and migrating the partition mount point of the system root partition from the temporary running system root directory to a real running system root directory;
[0019] and migrating the partition mount point of the system temporary partition from the temporary running system temporary directory to a real running system temporary directory.
[0020] Optionally, after the migrating the three partition mount points from the originally mounted temporary running directory to a real running directory, the method further comprises:
[0021] switching the temporary root file system to a real root file system;
[0022] when the real root file system is abnormal, repairing the system basic partition of the real root file system based on a boot backup partition and a system root backup partition.
[0023] Optionally, after the switching the temporary root file system to the real root file system, the method further comprises:
[0024] when the real root file system is not abnormal and the system read-write partition is configured, stacking and mounting an image directory for accessing a business image file to the system root partition;
[0025] Timing monitoring whether the temporary directory of the real running system partition of the system temporary partition is changed, and synchronizing the change memory increment to the temporary running system read-write directory of the system read-write partition.
[0026] Optionally, after switching the temporary root file system to the real root file system, further comprising:
[0027] When the real root file system is not abnormal and the system read-write partition is not configured, directly stacking the mirror directory of the service mirror file to the system root partition.
[0028] In a second aspect, the embodiments of the present application further provide a system hierarchical isolation device, comprising:
[0029] The first hierarchical construction module is configured to, when determining that the temporary root file system is configured with the system read-write partition, migrate the partition mounting points of the system read-write partition and the system root partition to the temporary running directory, and stack and mount the two partition mounting points to the real root directory;
[0030] The second hierarchical construction module is configured to migrate the partition mounting point of the system temporary partition to the temporary running directory, and stack and mount the three partition mounting points to the real root directory;
[0031] The stacking and mounting module is configured to migrate the three partition mounting points from the originally mounted temporary running directory to the real running directory.
[0032] Optionally, the first hierarchical construction module is configured to:
[0033] migrate the partition mounting point of the system read-write partition to the temporary running system read-write directory, and migrate the partition mounting point of the system root partition to the temporary running system root directory;
[0034] stack and mount the partition mounting points of the two partitions to the real root directory through a joint mounting technology.
[0035] Optionally, the second hierarchical construction module is configured to:
[0036] migrate the partition mounting point of the system temporary partition to the temporary running system temporary directory;
[0037] stack and mount the partition mounting points of the three partitions to the real root directory through a joint mounting technology.
[0038] Optionally, the stacking and mounting module is configured to:
[0039] migrate the partition mounting point of the system read-write partition from the temporary running system read-write directory to the real running system read-write directory;
[0040] and migrating a partition mount point of the system temporary partition from the temporary running system temporary directory to a real running system temporary directory.
[0041] and migrating a partition mount point of the system temporary partition from the temporary running system temporary directory to a real running system temporary directory.
[0042] Optionally, after the three partition mount points are migrated from the originally mounted temporary running directories to real running directories, the system switching module and the system repairing module are further included:
[0043] The system switching module is configured to switch the temporary root file system to a real root file system.
[0044] The system repairing module is configured to, when the real root file system is abnormal, repair a system basic partition of the real root file system based on a boot backup partition and a system root backup partition.
[0045] Optionally, after the temporary root file system is switched to the real root file system, the timing monitoring module is further included:
[0046] The stacking mounting module is further configured to, when the real root file system is not abnormal and the system read-write partition is configured, stack a mirror directory for accessing a business mirror file to the system root partition.
[0047] The timing monitoring module is configured to, in a timing manner, monitor whether a real running system temporary directory of the system temporary partition is changed, and synchronize a change memory increment to a temporary running system read-write directory of the system read-write partition.
[0048] Optionally, after the temporary root file system is switched to the real root file system, the stacking mounting module is further configured to:
[0049] When the real root file system is not abnormal and the system read-write partition is not configured, directly stack a mirror directory of a business mirror file to the system root partition.
[0050] In a third aspect, an embodiment of the present application further provides a computer device including a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes steps of any one of the system hierarchical isolation methods.
[0051] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium including program code, and when the program product is run on a computer device, the program code is used to make the computer device execute steps of any one of the system hierarchical isolation methods.
[0052] In a fifth aspect, the embodiments of the present application further provide a computer program product comprising computer instructions for implementing the steps of any of the system hierarchical isolation methods described above.
[0053] The present application has the following advantages:
[0054] The embodiments of the present application provide a system hierarchical isolation method, device, equipment and storage medium. The method comprises the following steps: when a temporary root file system configures a system read-write partition, mounting the system read-write partition and a system root partition to a temporary running directory, and stacking and mounting the two partitions to a temporary root directory; then mounting a system temporary partition to the temporary running directory, and mounting and integrating the three partitions again; finally, migrating the mounting points of the three partitions from the temporary running directory to a real running directory.
[0055] The technical scheme of mounting the system read-write partition, the system root partition and the temporary partition to the temporary running directory in sequence and merging, and finally migrating to the real running directory, can realize multi-level system protection and performance optimization. The hierarchical isolation mechanism is used to keep the basic system root partition in a read-only state, avoiding damage to the core files caused by business operations; the temporary running directory is used to accelerate temporary data reading and writing, reducing the reading and writing operation frequency of the physical disk or the underlying storage device; and the system read-write partition is used to store the runtime modified data independently, ensuring that the data is not lost after restarting.
[0056] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the structure particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF DRAWINGS
[0057] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the specification and illustrate illustrative embodiments of the present application and together with the description serve to explain the present application. In the drawings:
[0058] Figure 1 FIG. 1 is a schematic diagram of a system hierarchical architecture in the embodiments of the present application;
[0059] Figure 2A FIG. 3 is a flowchart of a mixed stacking root partition provided by the embodiments of the present application;
[0060] Figure 2B FIG. 5 is a system stacking implementation provided by the embodiments of the present application;
[0061] Figure 2C FIG. 6 is another system stacking implementation provided by the embodiments of the present application;
[0062] Figure 3 A complete flowchart of the hierarchical construction and data repair of the root file system provided by the embodiment of the present application is shown in the figure;
[0063] Figure 4 A structural diagram of a system hierarchical isolation device provided by the embodiment of the present application is shown in the figure;
[0064] Figure 5 A hardware component structural diagram of a computer device applying the embodiment of the present application is shown in the figure;
[0065] Figure 6 A hardware component structural diagram of another computer device applying the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0066] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described below in detail with the accompanying drawings of 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 described in the present application document, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the technical solutions of the present application.
[0067] The design idea of the embodiments of the present application will be briefly introduced as follows:
[0068] In the field of Linux devices, the early business program functions are relatively single. Nowadays, more and more embedded devices support the deployment of standard operating systems, and users can install RPM software and develop secondarily by themselves.
[0069] However, the embedded devices generally have the characteristics of limited performance, and usually use SATA SSD or EMMC as storage media. Not only the storage space is small, but also the read-write speed is relatively slow. If the standard system is directly deployed to the device, since the system partition is not protected, the device is prone to data loss during operation, and the data recovery is extremely difficult after the accident.
[0070] Therefore, it is necessary to provide a new system hierarchical isolation method to overcome the above-mentioned defects.
[0071] The method comprises the following steps: when the temporary root file system configures the system read-write partition, mounting the system read-write partition and the system root partition to a temporary running directory, and stacking and mounting the two partitions to a temporary root directory; then mounting the system temporary partition to the temporary running directory, and mounting and integrating the three partitions again; finally, migrating the mounting points of the three partitions from the temporary running directory to the real running directory.
[0072] The technical scheme of sequentially mounting the system read-write partition, the system root partition and the temporary partition to the temporary running directory and merging them, and finally migrating to the real running directory, can realize multi-level system protection and performance optimization. The layered isolation mechanism is used to keep the root partition of the basic system in a read-only state, avoiding damage to the core files by business operations. The temporary running directory is used to speed up the temporary data read-write and reduce the read-write operation frequency of the physical disk or underlying storage device. The system read-write partition stores the modified data during running, ensuring that the data is not lost after restart.
[0073] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0074] The present application innovatively proposes a hybrid stacking system model and a matching technical scheme applied to an embedded device. In view of the problems of slow read-write speed, limited computing performance, small storage space and the like of the embedded device, through the targeted design of the layered standard system architecture, efficient data read-write, seamless deployment of third-party software and flexible integration of the body business software are realized, and finally the technical goal of improving the system stability, functional flexibility and operation and maintenance maintainability of the embedded device is achieved.
[0075] The hybrid stacking system model constructs the system root partition through the layered architecture, including the basic system layer (SYSROOT), the semi-persistent layer (SYS_RW) and the cache layer (SYS_TMP), and designs a cache synchronization strategy to ensure efficient flow and persistence of data between different levels. In addition, for the body software of the embedded device, a multi-partition image scheme is designed to support multi-level stacking of the business image to the root partition, realizing seamless integration of the basic system and business functions; at the same time, a system recovery scheme is provided to restore the system to the original standard state through one-key operation, greatly reducing the operation and maintenance complexity.
[0076] As shown in Figure 1 On the system storage architecture design, the present application clearly stipulates the partitioning strategy of the device storage medium (SSD or EMMC): it is divided into nine partitions, namely, the boot partition (BOOT), the system root partition (SYSROOT), the business image partition (BIN), the business data partition (DATA), the database (DATABASE), the boot backup partition (BOOT_BAK), the system root backup partition (SYSROOT_BAK), the business backup partition (BIN_BAK) and the system read-write partition (SYS_RW).
[0077] The system consists of a boot partition, a system root partition, and a business image partition. These serve as the system's foundational partitions, storing the kernel files, the initial RAM filesystem (initramfs) boot image, and business image files, providing core support for system operation. Correspondingly, the BAK partitions (boot backup partition, system root backup partition, and business backup partition) act as backup storage, enabling rapid recovery in case of system anomalies. The business data partition and database are dedicated to storing business data, meeting the application's requirements for persistent data storage and efficient access. The system read / write partition, acting as a semi-persistent layer, stores writable data generated during system runtime, including user configurations and temporary logs. This design achieves dynamic data updates while avoiding direct modification of the underlying system layer through a layered mechanism, ensuring system stability from the ground up. Furthermore, the semi-persistent layer supports the installation and deployment of third-party software, flexibly meeting diverse business expansion needs and providing elasticity for functional expansion while maintaining the purity of the underlying system.
[0078] During system startup, the patent employs a unique cache loading mechanism: the initramfs boot image prioritizes mounting a temporary memory file system (tmpfs) and uses it as a cache layer (SYS_TMP). Tmpfs, implemented in memory, boasts extremely fast read / write speeds and automatic data clearing upon system restart, making it suitable for storing temporary files (such as compilation caches and inter-process communication data) and frequently updated cached data. Coupled with a cache synchronization strategy, data within the system temporary partition (SYS_TMP) can be synchronized periodically or on demand to the system read / write partition or business data partition, ensuring the persistence of critical data while releasing memory resources and maintaining efficient system operation. This layered storage and cache management mechanism effectively balances system performance, data security, and storage resource utilization efficiency, providing a solid guarantee for the stable operation of embedded devices.
[0079] Based on a deep understanding of the system architecture, combined with Figure 2A The flowchart shown below will be followed by a detailed explanation of the overlayroot hybrid stacking root partitioning process. This process, through standardized mount-merge-migrate operations, ultimately achieves multiple technical goals: read-only protection for the basic system, dynamic writing of business data, and system performance optimization. This provides embedded devices with a layered operating environment that combines stability and flexibility.
[0080] S201: When it is determined that the temporary root file system is configured with a system read / write partition, the mount points of the system read / write partition and the system root partition are moved to the temporary running directory, and the two partition mount points are stacked and mounted to the real root directory.
[0081] When the system read-write partition is configured in the temporary root file system, enter the overlayroot hybrid stacked root partition process.
[0082] In the initial state, the real root directory ( / sysroot) is the mounting point of the system root partition. At the same time, only one file system instance can be corresponding to one mounting point. Directly mounting the system read-write partition to the real root directory will cause the original system root directory to be unmounted or overwritten, and the original system files in the directory will be hidden and cannot be accessed.
[0083] To solve this problem, the application uses the characteristics of the temporary running directory ( / run) that is easy to mount and efficient in reading and writing, and migrates the partition mounting point of the system read-write partition to the temporary path of the temporary running system read-write directory ( / run / sys_rw). Through the temporary mounting of the temporary running system read-write directory, the physical storage location of the writable layer is prepared in advance without modifying the original system structure, the writable space is quickly established in the system initialization stage, and the performance bottleneck caused by directly operating the physical storage device (such as EMMC) is avoided.
[0084] In the initial state, the real root directory is originally the mounting path of the system root partition, and at this time the directory is directly associated with the file system. Due to the path occupation, the mounting conflict cannot be used as the merged directory of OverlayFS. To solve this problem, the application realizes the construction of the hierarchical architecture through the following process:
[0085] First, the partition mounting point of the system root partition is migrated from the real root directory to the temporary running system root directory ( / run / sysroot). The path is released through the temporary path transition, and at this time the real root directory is no longer associated with any file system, so it can be used as the mounting point of overlayfs.
[0086] After moving, the temporary running system root directory saves all the data of the system root partition, and at this time it can be specified as the lower directory (lowerdir) of OverlayFS to ensure that the basic system files can be read but not modified. And the temporary running system read-write directory is specified as the upper directory (upperdir) of OverlayFS, which is used to store modified or new files. Subsequently, through joint mounting technologies such as OverlayFS, the partition mounting point of the system read-write partition (upper directory upperdir) and the partition mounting point of the system root partition (lower directory lowerdir) are stacked and mounted to the real root directory, so that the real root directory is used as the merged directory.
[0087] The operation is performed in an embedded system or a hybrid file system startup process, and the layered mounting and path isolation of the file system are realized through a temporary path, which lays a foundation for building a hybrid stacking architecture of "read-only basic system + writable function layer", effectively solves the path conflict problem and realizes data read-write separation.
[0088] However, before step 201 is performed, the following steps also need to be performed: when the temporary root file system enters the normal startup mode, load the initramfs startup image in the boot partition, mount the system root partition to the real root directory in the initramfs startup image, and then judge whether the system read-write partition is configured in the hybrid stacking system switch.
[0089] initramfs is a temporary file system that contains necessary drivers, tools and configuration files for initializing and configuring the system before the kernel is started and the real root file system is mounted. For example, it will load the system clock, SELinux, system host information, disk mounting strategy in / etc / fstab file, disk quota, etc., and also initialize system programs, start boot services, start virtual consoles, etc.
[0090] In the initramfs startup image, the system root partition is mounted to the real root directory, mainly to isolate the temporary root file system and the real root file system through standardized path ( / sysroot) during system initialization, so that subsequent switching to the real root file system through chroot or pivot_root mechanism can accurately access the basic system files (such as kernel modules, configuration files, etc.), while avoiding file path conflicts and ensuring the standardization and compatibility of hardware driver loading, file system detection and other operations in the startup process.
[0091] In a hybrid stacking system (such as an overlayfs-based layered file system architecture), the design pattern of separating system read-write partition from system read-only partition (SYS_RO) is usually adopted. The system read-write partition refers to the partition in the system that allows write operations, and is used to store temporary data generated during runtime, user configuration modifications, etc. Corresponding to it is the system read-only partition, which is used to protect core system files from accidental modification.
[0092] If all read-write operations are directly performed on the system read-only partition, the system core files may be damaged due to accidental operation or abnormal write. If the system read-write partition is not configured, the modified content such as log records, user configuration files and temporary data generated during system runtime cannot be stored persistently, and data loss will occur after reboot, which will cause the system state to be unable to recover.
[0093] And after configuring the system read-write partition, the writable data and the read-only system file are logically isolated, effectively protecting the integrity of the basic system. In addition, the system read-write partition supports backup or recovery operations independent of the basic system. When the basic system is upgraded, the partition can retain user data and configuration information, avoiding data loss problems caused by upgrades, and significantly improving the disaster recovery capability of the system.
[0094] The overlay.ini file is read by a text editor, the overlay.ini configuration file structure is viewed, and it is judged whether the hybrid stacking system switch is configured with the system read-write partition. If there is an upperdir parameter and the path points to an independent partition (such as / sys_rw), it means that the system read-write partition is configured; if there is no upperdir parameter or the path overlaps with the system root partition (such as upperdir= / sysroot), it is not correctly configured.
[0095] S202: Migrate the partition mounting point of the system temporary partition to the temporary running directory, and stack mount the three partition mounting points to the real root directory.
[0096] If the system temporary partition is directly mounted to the real root directory and other core paths, it will overwrite the basic system file. By using the temporary storage feature of the temporary running directory, the partition mounting point of the system temporary partition is migrated to the temporary running system temporary directory ( / run / sys_tmp), and then the three partition mounting points are stacked and mounted to the real root directory by using the joint mounting technology.
[0097] At this time, the real root directory contains both the underlying system file and the upper layer cache data, and the upper layer file will overwrite the lower layer file with the same name, so that the system directly accesses the merged view of "basic system + cache data" during running, and the following effects are achieved:
[0098] (1) Cache acceleration: The access to the system file preferentially reads the cache (such as the generated temporary file) of the upper layer temporary running system temporary directory, reduces the read-write operation frequency of the physical disk or the underlying storage device, and thus optimizes the system performance, prolongs the hardware life or reduces the resource consumption.
[0099] (2) Write operation isolation: all write operations (such as temporary configuration modification) to the system file are performed on the upper layer temporary running system temporary directory, without affecting the underlying read-only system.
[0100] S203: Migrate the three partition mounting points from the originally mounted temporary running directory to the real running directory.
[0101] In the Linux system startup process, the temporary root file system of initramfs only exists in the startup stage, and when the switch_root is executed to switch from the temporary root file system to the real root file system, the root directory (such as / run) of initramfs will be unmounted, and if the partition mounting point is still retained under / run, the partition access will be invalid.
[0102] The real root file system usually takes the real root directory as the system base directory, and the structure thereof is determined through configuration before startup. In order to ensure that the original partition mounting point can still be accessed in the new root environment, the partition mounting points of the system root partition, the system read-write partition and the system temporary partition are migrated from the temporary running directory to the real root directory, so that the partition path is compatible with the structure of the real root directory, the access loss caused by the directory unmounting is avoided, and it is a key operation to ensure the continuity of the partition after the switching.
[0103] Specifically, the partition mounting point of the system read-write partition is migrated from the temporary running system read-write directory to the real running system read-write directory ( / sysroot / run / sys_rw); and the partition mounting point of the system root partition is migrated from the temporary running system root directory to the real running system root directory ( / sysroot / run / sysroot); and the partition mounting point of the system temporary partition is migrated from the temporary running system temporary directory to the real running system temporary directory ( / sysroot / run / sys_tmp).
[0104] In an embedded system or a multi-stage startup architecture, initramfs serves as a temporary root environment, is responsible for loading hardware drivers and mounting real root partitions, and does not contain complete system repair tools (such as file system checking and data recovery scripts). However, the recovery mode needs to access system tools (such as fsck and backup recovery programs) in the real root partition, so after the three partition mounting points are migrated from the originally mounted temporary running directory to the real running directory, the switch_root must be run to switch the temporary root file system to the real root file system.
[0105] The judgment of whether to enter the repair mode through the kernel boot parameter is a key link of the system disaster recovery and repair mechanism. The init process (such as systemd) of the real root file system reads / proc / cmdline to detect the recovery parameter. If the parameter exists, it is determined that the real root file system is abnormal, the normal startup process is skipped, the repair operation (such as file system repair, system image restoration) is performed, the system basic partition of the real root file system is repaired based on the boot backup partition and the system root backup partition, and after completion, it is restarted or returned to the normal mode; if the parameter does not exist, the boot partition, business image partition, business data partition and database are mounted in the real root file system, and other subsequent operations are performed.
[0106] At present, for the problem of easy loss of data of embedded devices, the existing solutions mainly face two challenges: on the one hand, most solutions realize system backup and repair by deploying third-party disaster recovery software on the server side, but such software not only significantly increases the cost, but also lacks compatibility support for embedded devices, resulting in poor disaster recovery effect, or even cannot be used; on the other hand, some solutions use Redundant Array of Independent Disk (RAID) group to realize disaster recovery, but this solution will directly increase the hardware cost.
[0107] In order to break through the cost and compatibility bottleneck, the present application proposes a lightweight disaster recovery solution. The repair system discards the hybrid stacking architecture to avoid resource consumption and compatibility problems caused by complex hierarchical mechanisms, and uses the boot backup partition and the system root backup partition as the basic disaster recovery unit to automatically repair the main partition (BOOT, SYSROOT, BIN). Based on the design of the minimum system partition, disaster recovery function can be realized without additional deployment of cluster devices or other hardware, which has low hardware resource occupation and stronger compatibility for embedded devices; the automatic repair process can restore the system main partition with one key, reduces manual intervention, and the data partition is not affected, which improves the disaster recovery efficiency and reliability. The solution significantly reduces the disaster recovery cost and technical threshold of embedded devices under the premise of ensuring the disaster recovery effect through the design of "lightweight backup + automatic repair".
[0108] The boot loader (such as GRUB) usually presets multiple startup entries, including "normal startup mode" and "repair mode". When the system detects an exception (such as damage to the main boot partition, kernel loading failure) or the user manually triggers (such as pressing a specific key), the boot loader will select and load the kernel and initramfs image dedicated for the repair mode.
[0109] The initramfs image of the repair mode contains independent initialization scripts, drivers and repair tools (such as fsck, mount, chroot), which are completely isolated from the initramfs of the main system. Even if the file system of the main system is damaged, the initramfs of the repair mode can still be normally loaded to provide a basic system environment.
[0110] The boot backup partition and the system root backup partition are usually located in different physical storage areas or use independent file system formats from the main partition (BOOT, SYSROOT). The boot backup partition is mounted to a specified directory using the mount command. Similarly, the system root backup partition is mounted to a specified directory using the mount command.
[0111] After the mounting of the two backup partitions is completed, the repair mode is entered. The repair tool can access the backup boot partition files such as kernel images and bootloader configuration files in the specified directory, copy the correct kernel image and bootloader configuration from the boot backup partition to the main boot partition, and use the fsck tool in the backup partition to scan the main system partition and restore the damaged file metadata.
[0112] The / mnt / sysroot_bak directory mounted by the system root backup partition will present a complete basic system file structure, including system library files, configuration files and executable programs, etc. The repair tool copies the missing system library (such as / lib64 / libc.so) or configuration file (such as / etc / network / interfaces) from the system root backup partition to the corresponding path of the main system. After completing the repair operation, the repair mode is exited and the device is restarted.
[0113] If the recovery parameter is not detected in / proc / cmdline, it indicates that the real root file system is not abnormal, and the boot partition, service image partition, service data partition and database are mounted in the real root file system.
[0114] The service image partition is a partition that stores binary image files related to services (such as system programs, application service packages), and usually contains executable programs, configuration files and other basic components for system operation, serving as the bottom layer (read-only layer) of OverlayFS, providing stable business programs and resources.
[0115] The service image file is read from the service image partition, and the file is mounted to a temporary directory (such as / tmp / image). By accessing the temporary directory, the overlay.ini configuration in the file is read to determine whether to enable the system read-write partition switch. If enabled, it will trigger the OverlayFS to load the system read-write partition; otherwise, the service image is directly mounted to / app in read-only mode, prohibiting write operations.
[0116] The essence of reading the business mirror from the business mirror partition and judging the system read-write partition configuration is to realize the layered architecture of "read-only mirror + writable layer" through OverlayFS technology. The bottom layer mirror (such as version update) can be directly replaced, and the data of the writable layer (such as user configuration) is not affected. When the data of the writable layer is abnormal, it can also be recovered by remounting the mirror without rebuilding the entire system. In this way, the stability of the business program is ensured, and the write permission at runtime is flexibly controlled through the configuration switch to achieve a balance between data isolation, upgrade convenience and system security.
[0117] As shown in Figure 2B When the real root file system does not appear abnormal and the system read-write partition is configured, the mirror directory (romfs.img) used to access the business mirror file is stacked and mounted to the system root partition, and the business software is fused on the standard system as a unified system; the system uses a cache synchronization strategy to monitor whether the real running system temporary directory of the system temporary partition has changed, and synchronizes the incremental memory changes to the real running system read-write directory of the system read-write partition.
[0118] The essence of stacking and mounting the business software mirror to the root partition of the standard system through OverlayFS is to use the logical merging capability of the layered file system to stack the business software as a writable layer on the read-only standard system bottom layer. The standard system as a read-only bottom layer maintains stability, and the modification of the business software (such as configuration, log) only exists in the upper layer, avoiding damage to the core files of the system due to business abnormalities. The business software as a writable upper layer supports dynamic updating, and the upper layer data (such as user configuration) is not affected. This architecture not only ensures the stability and compatibility of the basic system, but also allows the business software to be integrated into the system in an incremental overlay manner, ultimately forming a unified system view that can share standard resources and support business customization, achieving a balance between stability and flexibility.
[0119] The system temporary partition is used to store temporarily generated temporary files at runtime. Typical scenarios include: temporary log files (such as intermediate logs during process runtime), cache files (such as temporary cache data generated by the system or application), inter-process communication files (such as socket, pipe files), and temporary configuration files (such as dynamically generated temporary configurations). The core characteristics are temporary data and frequent dynamic changes, but some temporary data may need to be persisted or synchronized to other storage under certain conditions (such as system restart, service switching).
[0120] Changes (such as addition, modification, deletion) of temporary files may contain key information that needs to be synchronized to other partitions (such as DATA, DATABASE), in order to ensure the consistency and persistence of temporary data, the system needs to monitor the directory mounted by the temporary partition at regular intervals to determine whether changes have occurred.
[0121] The system timer (such as systemd timer, crontab) can periodically scan the file status (modification time, size, existence) of the temporary running system temporary directory, and synchronize the changes in memory to the temporary running system read-write directory in the system read-write partition, to realize the periodic polling of the system temporary partition mounted directory. It can also actively trigger data synchronization when the directory changes by combining the file system change notification mechanism such as inotify. To avoid event loss, a backup solution is provided.
[0122] During the operation of the business software, data modification will inevitably occur, such as generating configuration files, temporary caches, logs, etc. If there is no independent read-write partition, these data can only be directly written to the system root partition. As the core partition of the system, the system root partition should ideally remain read-only, which can not only ensure that the system update does not contaminate the basic files with business data, but also ensure the data consistency during the multi-version system switching (such as dual-system startup). The method of directly writing data to the system root partition not only has a high risk of damaging the basic system files, but also cannot persistently store data, which will be lost after system restart, making it difficult to meet the business continuity requirements.
[0123] To solve this problem, as shown in Figure 2C , the application directly stacks the mirror directory (romfs.img) of the business image file on the system root partition when the real root file system is not abnormal and the system read-write partition is not configured. The business software is integrated into the system root directory, breaking the traditional layered isolation mode, and reducing the impact on the basic system through permission control and directory planning.
[0124] Next, combined with the flowchart shown in Figure 3 , the complete process of layering the root file system and repairing data is introduced.
[0125] S301: When the temporary root file system enters the normal startup mode, load the initramfs startup image in the boot partition;
[0126] S302: In the initramfs startup image, mount the system root partition to the real root directory ( / sysroot); S303: Determine whether the hybrid stacking system switch is configured with a system read-write partition (SYS_RW), if yes, execute step 304; otherwise, execute step 307;
[0127] S304: migrating the partition mounting point of SYS_RW to the temporary running system read-write directory ( / run / sys_rw), and migrating the partition mounting point of SYSROOT to the temporary running system root directory ( / run / sysroot), and stacking and mounting / run / sys_rw and / run / sysroot to / sysroot through OverlayFS; S305: migrating the partition mounting point of SYS_TMP to the temporary running system temporary directory ( / run / sys_tmp), and stacking and mounting / run / sys_rw, / run / sysroot and / run / sys_tmp to / sysroot;
[0128] S306: migrating the partition mounting point of SYS_RW from / run / sys_rw to the real running system read-write directory ( / sysroot / run / sys_rw); and migrating the partition mounting point of SYSROOT from run / sysroot to the real running system root directory ( / sysroot / run / sysroot); and migrating the partition mounting point of SYS_TMP from / run / sys_tmp to the real running system temporary directory ( / sysroot / run / sys_tmp); S307: running switch_root to switch the temporary root file system to the real root file system;
[0129] S308: judging whether to enter the repair mode through the kernel boot parameter, if yes, performing step 314; otherwise, performing step 309;
[0130] S309: mounting the boot partition (BOOT), the service image partition (BIN), the service data partition (DATA) and the database (DATABASE) in the real root file system, and mounting the service image file in BIN to the temporary directory;
[0131] S310: accessing the temporary directory, judging whether to enable the SYS_RW switch, if yes, performing step 311; otherwise, performing step 313;
[0132] S311: stacking and mounting the image directory for accessing the service image file to the system root partition;
[0133] S312: periodically scanning / run / sys_tmp through the system timer, and synchronizing the incremental changes in memory to / run / sys_rw of SYS_RW;
[0134] S313: directly stacking the image directory of the service image file to SYSROOT;
[0135] S314: using the mount command, respectively, the boot backup partition (BOOT_BAK) and system root backup partition (SYSROOT_BAK) is mounted to the specified directory.
[0136] S315: after the mounting of the two backup partitions is completed, taking BOOT_BAK and SYSROOT_BAK as the basic disaster recovery unit, automatically repairing the main partition (BOOT, SYSROOT, BIN).
[0137] Based on the same inventive concept as the above method embodiment, the embodiment of the present application also provides a system hierarchical isolation device. As shown in the figure, the system hierarchical isolation device 400 can include: Figure 4
[0138] The first hierarchical construction module 401 is configured to, when it is determined that the temporary root file system is configured with a system read-write partition, migrate the partition mounting points of the system read-write partition and the system root partition to a temporary running directory, and stack mount the two partition mounting points to a real root directory.
[0139] The second hierarchical construction module 402 is configured to migrate the partition mounting point of the system temporary partition to the temporary running directory, and stack mount the three partition mounting points to the real root directory.
[0140] The stacking mounting module 403 is configured to migrate the three partition mounting points from the originally mounted temporary running directory to a real running directory.
[0141] Optionally, the first hierarchical construction module 401 is configured to:
[0142] migrate the partition mounting point of the system read-write partition to a temporary running system read-write directory, and migrate the partition mounting point of the system root partition to a temporary running system root directory.
[0143] Stack mount the partition mounting points of the two partitions to the real root directory through a joint mounting technology.
[0144] Optionally, the second hierarchical construction module 402 is configured to:
[0145] migrate the partition mounting point of the system temporary partition to a temporary running system temporary directory.
[0146] Stack mount the partition mounting points of the three partitions to the real root directory through a joint mounting technology.
[0147] Optionally, the stacking mounting module 403 is configured to:
[0148] migrating the partition mount point of the system read-write partition from the temporary running system read-write directory to a real running system read-write directory;
[0149] migrating the partition mount point of the system root partition from the temporary running system root directory to a real running system root directory;
[0150] migrating the partition mount point of the system temporary partition from the temporary running system temporary directory to a real running system temporary directory.
[0151] Optionally, after migrating the three partition mount points from the originally mounted temporary running directories to real running directories, the system switching module 404 and the system repairing module 405 are further included:
[0152] The system switching module 404 is configured to switch the temporary root file system to a real root file system.
[0153] The system repairing module 405 is configured to, when the real root file system is abnormal, repair the system basic partition of the real root file system based on a boot backup partition and a system root backup partition.
[0154] Optionally, after switching the temporary root file system to the real root file system, the timing monitoring module 406 is further included:
[0155] The stack mounting module 403 is further configured to, when the real root file system is not abnormal and the system read-write partition is configured, stack mount an image directory for accessing a business image file to the system root partition.
[0156] The timing monitoring module 406 is configured to, in a timing manner, monitor whether the real running system temporary directory of the system temporary partition is changed, and synchronize a change memory increment to the temporary running system read-write directory of the system read-write partition.
[0157] Optionally, after switching the temporary root file system to the real root file system, the stack mounting module 403 is further configured to:
[0158] When the real root file system is not abnormal and the system read-write partition is not configured, directly stack the image directory of the business image file to the system root partition.
[0159] For the convenience of description, each part is described as a module (or unit) according to the function. Of course, the functions of each module (or unit) can be implemented in the same or multiple software or hardware in the implementation of the present application.
[0160] After introducing the system layered isolation method and device of the exemplary embodiments of the present application, next, the computer device according to another exemplary embodiment of the present application is introduced.
[0161] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be specifically implemented as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here.
[0162] Based on the same inventive concept as the above method embodiments, the present embodiment also provides a computer device. In an embodiment, the computer device can be a server. In this embodiment, the structure of the computer device 500 is as shown in Figure 5 The computer device 500 can at least include a memory 501, a communication module 503, and at least one processor 502.
[0163] The memory 501 is used to store computer programs executed by the processor 502. The memory 501 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and programs required for running instant messaging functions, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc.
[0164] The memory 501 can be a volatile memory such as a random-access memory (RAM); the memory 501 can also be a non-volatile memory such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 501 can be any other medium capable of carrying or storing desired computer programs in the form of instructions or data structures and capable of being accessed by a computer, but is not limited to this. The memory 501 can be a combination of the above memories.
[0165] The processor 502 can include one or more central processing units (CPUs) or digital processing units, etc. The processor 502 is used to implement the above system layered isolation method when invoking the computer programs stored in the memory 501.
[0166] The communication module 503 is used to communicate with terminal devices and other servers.
[0167] This application embodiment does not limit the specific connection medium between the memory 501, communication module 503, and processor 502 described above. This application embodiment... Figure 5 The memory 501 and the processor 502 are connected via a bus 504, and the bus 504 is in Figure 5 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 504 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 5 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.
[0168] The memory 501 stores a computer storage medium, which in turn stores computer-executable instructions. These instructions are used to implement the system hierarchical isolation method of this application embodiment. The processor 502 is used to execute the aforementioned system hierarchical isolation method, such as... Figure 2A As shown.
[0169] In another embodiment, the computer device may also be other types of computer devices. In this embodiment, the structure of the computer device may be as follows: Figure 6 As shown, it includes components such as a communication component 610, a memory 620, a display unit 630, a camera 640, a sensor 650, an audio circuit 660, a Bluetooth module 670, and a processor 680.
[0170] The communication component 610 is used to communicate with the server. In some embodiments, it may include a Wireless Fidelity (WiFi) module, which is a short-range wireless transmission technology, and the electronic device can send and receive information through the WiFi module.
[0171] The memory 620 can be used to store software programs and data. The processor 680 executes various functions of the terminal device and data processing by running the software programs or data stored in the memory 620. The memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The memory 620 stores an operating system that enables the terminal device to run. In this application, the memory 620 can store the operating system and various application programs, and may also store computer programs that execute the system hierarchical isolation method of the embodiments of this application.
[0172] The display unit 630 can also be used to display information input by the object or information provided to the object, as well as the graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 630 can include a display screen 632 disposed on the front of the terminal device. Among them, the display screen 632 can be configured in the form of a liquid crystal display, a light-emitting diode, etc. The display unit 630 can be used to display the defect detection interface, the model training interface, etc. in the embodiments of the present application.
[0173] The display unit 630 can also be used to receive input digital or character information, generate signal input related to the object settings and function control of the terminal device. Specifically, the display unit 630 can include a touch screen 631 disposed on the front of the terminal device, which can collect touch operations of the object thereon or nearby, such as clicking buttons, dragging scroll boxes, etc.
[0174] Among them, the touch screen 631 can be overlaid on the display screen 632, or the touch screen 631 can be integrated with the display screen 632 to realize the input and output functions of the terminal device, and after integration, it can be simply referred to as a touch display screen. The display unit 630 in the present application can display application programs and corresponding operation steps.
[0175] The camera 640 can be used to capture still images, and the object can publish the images taken by the camera 640 through the application. The camera 640 can be one or more. The object generates an optical image through a lens and projects it to a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 680 to convert it into a digital image signal.
[0176] The terminal device can also include at least one sensor 650, such as an acceleration sensor 651, a distance sensor 652, a fingerprint sensor 653, a temperature sensor 654. The terminal device can also be configured with a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, a motion sensor, and other sensors.
[0177] The audio circuit 660, the speaker 661 and the microphone 662 can provide an audio interface between a user and the terminal device. The audio circuit 660 can convert received audio data into an electrical signal, which is transmitted to the speaker 661 and converted into a sound signal by the speaker 661. The terminal device can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 662 converts a sound signal collected into an electrical signal, which is received by the audio circuit 660 and converted into audio data, which is output to the communication component 610 for transmission to another terminal device, for example, or to the memory 620 for further processing.
[0178] The Bluetooth module 670 is used to interact with other Bluetooth devices having a Bluetooth module through a Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (e.g., a smart watch) having a Bluetooth module through the Bluetooth module 670, and thus interact with the wearable electronic device.
[0179] The processor 680 is the control center of the terminal device, which connects all parts of the terminal device through various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs stored in the memory 620 and calling data stored in the memory 620. In some embodiments, the processor 680 can include one or more processing units; the processor 680 can also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the baseband processor mainly processes wireless communication. It can be understood that the above-mentioned baseband processor can also not be integrated into the processor 680. In the present application, the processor 680 can run an operating system, an application program, a user interface display and a touch response, and a system hierarchical isolation method of the embodiments of the present application. In addition, the processor 680 is coupled with the display unit 630.
[0180] In some possible implementation manners, various aspects of the system hierarchical isolation method provided in the present application can also be implemented in the form of a program product, which includes a computer program for causing a computer device to execute the steps of the system hierarchical isolation method according to various exemplary embodiments of the present application described above in the specification when the program product is run on the computer device, for example, the computer device can execute the steps as shown in Figure 2A
[0181] The program product of the embodiments of the present application can employ any combination of one or more computer-readable media. The computer-readable media can be a computer-readable storage medium or a computer-readable signal medium. The computer-readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0182] The program product of the embodiments of the present application can employ a portable compact disc read-only memory (CD-ROM) and include a computer program, and can be executed on an electronic device. However, the program product of the present application is not limited thereto, and in the present document, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with a command execution system, apparatus, or device.
[0183] The computer-readable signal medium can include a data signal that is propagated in baseband or that is propagated as part of a carrier wave. Such propagated data signals can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium that is not a storage medium, that is capable of storing the program for use by or in connection with a command execution system, apparatus, or device.
[0184] The computer program contained in the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination thereof.
[0185] The computer program for performing the operations of the present application can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, and the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer program can be executed entirely on the user's computer device, partially on the user's computer device and partially on a remote computer device, as a stand-alone software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device. In the case of a remote computer device, the remote computer device can be connected to the user's computer device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer device (for example, connected to the Internet using an Internet service provider).
[0186] It should be noted that while several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, according to an embodiment of the application, features and functionalities of two or more units described above can be embodied in one unit. Conversely, features and functionalities of one unit described above can be further divided into units embodied by several units.
[0187] Moreover, while operations of the methods of the present application are described in a particular order in the figures, this is not required or implied in any manner, nor is it required that all of the illustrated operations be performed to achieve desirable results. Additionally or alternatively, certain steps can be omitted, combined into fewer steps, and / or separated into additional steps.
[0188] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer program instructions.
[0189] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing system or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 The flowchart illustrations and / or block diagrams Figure 1 Apparatus for performing the functions specified in the flowchart illustrations and / or block diagrams
[0190] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 The flowchart illustrations and / or block diagrams Figure 1 Apparatus for performing the functions specified in the flowchart illustrations and / or block diagrams
[0191] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operations steps are performed on the computer or other programmable devices to generate computer-implemented processes, so that the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in the flowchart Figure 1 one or more flows and / or blocks Figure 1 one or more blocks or steps of the functions specified in the flowchart
[0192] Although preferred embodiments of the application have been described, those skilled in the art will recognize that additional modifications and variations may be made thereto without departing from the spirit and scope of the application. It is therefore intended that the appended claims cover all such modifications and variations as fall within the scope of the application.
[0193] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore intended that the application be covered within the scope of the claims, and that the scope of the claims be interpreted not to be limited by the embodiments set forth in the specification.
Claims
1. A system hierarchical isolation method, characterized in that, include: When it is determined that the temporary root file system is configured with a system read-write partition, the partition mount points of the system read-write partition and the system root partition are migrated to the temporary running directory, and the two partition mount points are stacked and mounted to the real root directory. The system temporary partition's mount point is moved to the temporary running directory, and the three partition mount points are stacked and mounted to the real root directory; The three partition mount points were moved from the original temporary running directories to the actual running directories.
2. The method as described in claim 1, characterized in that, The step of migrating the mount points of the system read / write partition and the system root partition to a temporary running directory, and stacking the mount points of the two partitions to mount them to the real root directory, includes: The system read / write partition's mount point is moved to the temporary running system read / write directory, and the system root partition's mount point is moved to the temporary running system root directory; By using a combined mounting technique, the mount points of the two partitions are stacked and mounted to the real root directory.
3. The method as described in claim 1, characterized in that, The step of migrating the system temporary partition's mount point to the temporary running directory and stacking the three partition mount points to the real root directory includes: Move the mount point of the system's temporary partition to the temporary directory of the temporary running system; By using a combined mounting technique, the mount points of the three partitions are stacked and mounted to the real root directory.
4. The method as described in claim 1, characterized in that, The process of migrating the three partition mount points from the original temporary running directories to the actual running directories includes: The partition mount point of the system read / write partition is moved from the temporary running system read / write directory to the real running system read / write directory; In addition, the partition mount point of the system root partition is moved from the temporary running system root directory to the real running system root directory; In addition, the mount point of the system's temporary partition is moved from the temporary directory of the temporary running system to the temporary directory of the real running system.
5. The method according to any one of claims 1-4, characterized in that, After migrating the three partition mount points from the original temporary running directories to the actual running directories, the process also includes: Switch the temporary root file system to the real root file system; When the real root file system encounters an anomaly, the system base partition of the real root file system is repaired based on the boot backup partition and the system root backup partition.
6. The method as described in claim 5, characterized in that, After switching the temporary root file system to the real root file system, the process also includes: When the real root file system is not abnormal and the system read / write partition is configured, the image directory used to access the business image file is stacked and mounted to the system root partition. The system periodically monitors whether the temporary directory of the actual running system in the temporary partition has changed, and synchronizes the changed memory increment to the temporary running system read / write directory of the system read / write partition.
7. The method as described in claim 5, characterized in that, After switching the temporary root file system to the real root file system, the process also includes: When the real root file system is not abnormal and the system read / write partition is not configured, the image directory of the business image file is directly stacked onto the system root partition.
8. A system hierarchical isolation device, characterized in that, include: The first layered construction module is used to migrate the partition mount points of the system read-write partition and the system root partition to the temporary running directory when it is determined that the temporary root file system is configured with a system read-write partition, and to stack the two partition mount points to the real root directory. The second layered construction module is used to migrate the partition mount point of the system temporary partition to the temporary running directory, and stack the three partition mount points to the real root directory; The stacked mount module is used to migrate the three partition mount points from the original temporary running directory to the actual running directory.
9. A computer device, characterized in that, It includes a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It includes program code that, when run on a computer device, causes the computer device to perform the steps of the method according to any one of claims 1-7.
11. A computer program product, characterized in that, Includes computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-7.
Citation Information
Cited By
Method and equipment for detecting and repairing glibc damage in Linux system
CN121807612A
