File system and hard disk remote backup and recovery method based on USB (Universal Serial Bus) guidance
By adopting a clientless architecture with USB boot on the Kylin V10 server operating system, automatically configuring IP and performing end-to-end encryption and decryption, the problems of insufficient architectural flexibility, security and scalability in existing technologies are solved, and an easy-to-maintain, secure and reliable file system and hard disk-level backup and recovery are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF COMP TECH & APPL
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies for file system and hard disk-level data backup and recovery on the Kylin V10 server operating system suffer from insufficient architectural flexibility, security vulnerabilities, and weak scalability.
It adopts a clientless architecture based on USB boot, automatically configures IP via DHCP, automatically mounts remote storage using SSHFS paths, loads client programs and performs end-to-end encryption and decryption, supports breakpoint resume, and provides an interface for interaction with upper-layer applications.
It achieves an easy-to-maintain, secure and reliable file system and hard disk-level backup and recovery, improving system maintenance efficiency and security, and supporting scalability for multiple application scenarios.
Smart Images

Figure CN121880099A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, specifically relating to a method for remote backup and recovery of a file system and hard disk based on USB boot. Background Technology
[0002] Currently, backup and recovery of file systems and hard disk-level data on the Kylin V10 server operating system mostly involves manually booting from a CD / USB drive and manually executing cloning tools. Alternatively, there are cases where large commercial backup and recovery software is deployed and an agent is installed within the operating system to achieve data or operating system backup and recovery.
[0003] However, there are some drawbacks to using existing conventional methods: First, the architecture lacks flexibility. The bootable CD / USB drive contains embedded client software, and updating the client software requires repackaging the boot image and creating a new bootable CD / USB drive, which is not conducive to client function maintenance.
[0004] Secondly, there are security vulnerabilities. During data transmission, unencrypted protocols such as NFS are often used, and the image itself does not support encryption. In scenarios with high security requirements, this poses a security risk.
[0005] Finally, conventional solutions do not expose interactive interfaces, making it impossible to highly customize upper-layer applications and extend interfaces, thus hindering extended development. Summary of the Invention
[0006] (a) Technical problems to be solved The technical problem to be solved by this invention is: how to provide a method for remote backup and recovery of file systems and hard disks to solve the problems of insufficient architectural flexibility, security and scalability of conventional solutions.
[0007] (II) Technical Solution To address the aforementioned technical problems, this invention provides a method for remote backup and recovery of file systems and hard disks based on USB boot. This method is applied to the Kylin server operating system and can automatically discover the server and load the client program to back up and restore data disk partitions with file systems or operating system disks with boot information.
[0008] Preferably, this method configures a remote backup and recovery environment on the server side, boots the server via USB, adopts a clientless architecture, automatically configures the local IP via DHCP, obtains the server IP and SSHFS path through the server's broadcast data, automatically mounts remote storage and loads remote resources, reads structured configuration files from the remote backup and recovery environment to perform corresponding file system or hard disk level backup and recovery operations, and supports breakpoint resume and end-to-end encryption and decryption of backup files during the operation process.
[0009] Preferably, this method first deploys the server-side program, client-side program, and structured configuration file on the server side, and then performs two stages: server-side environment configuration and client loading and execution of remote resources after USB boot, totaling four steps; the specific steps include: Server environment configuration: Step 1.1: When performing remote backup and recovery on the server, initialize the backup and recovery environment, start the DHCP service, and the server program continuously sends UDP broadcasts containing the server IP and SSHFS path information. Store the pre-configured JSON-formatted structured configuration file in the specified path. Loading and executing remote resources after USB boot: Step 1.2: The USB bootloader automatically configures the local IP address via DHCP. The bootloader starts automatically and receives UDP broadcasts from the server to obtain the server IP address and SSHFS path. Step 1.3: Mount the SSHFS path, load and execute the client program, read the structured configuration file, and obtain specific operation information; then execute steps 1.3.1 to 1.3.2. Step 1.3.1 When the operation is backup, there are two cases: backing up the file system or backing up the hard disk device. When backing up the file system, the partition specified in the structured configuration file is backed up. When backing up the hard disk device, the partition table, boot information and all file systems of the hard disk device specified in the structured configuration file are backed up, and the generated image file is stored in the SSHFS path. Step 1.3.2 When the operation is recovery, there are two cases: restoring the file system or restoring the hard disk device. When restoring the file system, the partition specified in the structured configuration file is restored using the specified partition backup image file. When restoring the hard disk device, the hard disk device specified in the structured configuration file is restored using the specified partition table, boot information, and partition backup image file. Step 1.4: After the backup or restore operation is completed, clean up the site and perform the operation according to the power policy.
[0010] Preferably, the structured configuration file in step 1.1 includes the following attributes: target_type for backup and recovery level, operation, target_device for backup or recovery, encryption / decryption during backup or recovery, key path information (kep_path) for encryption / decryption, health_check for reading hard disk device health information, and power-control for power configuration after the process is completed.
[0011] Preferably, when the health_check attribute in the structured configuration file is true, the backup and restore operations simultaneously read the hard disk device health information and store the relevant information in the SSHFS path.
[0012] Preferably, in step 1.3.1, when the value of the operation attribute is backup and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified, and a file system backup operation is performed; when the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved; if it is GPT, the corresponding GPT partition information is saved, and then a file system backup operation is performed on each partition. In step 1.3.2, when the value of the operation attribute is recovery and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified and a file system-level recovery operation is performed. When the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved. If it is GPT, the corresponding GPT partition information is saved, and then a file system-level recovery operation is performed on each partition.
[0013] Preferably, the backup or recovery process in step 1.3 performs end-to-end encryption and decryption using the AES-256 algorithm based on the enable status of the encryption attribute in the structured configuration file and the key specified by the key_path attribute.
[0014] Preferably, the real-time status of the backup or restore operation in step 1.3 is reported through a reserved interface JSON file and a lightweight agent. The reported content includes the current task status (current_stage), the real-time progress (progress_percentage), the current status (current_stage_description), and the error message (error_message).
[0015] Preferably, the backup or restore operation in step 1.3 is stopped by the server-side configuration signal file stop.flag. When the client program automatically detects the existence of the stop.flag file, the backup or restore operation stops and the process file is cleaned up.
[0016] Preferably, after the backup / restore operation in step 1.4 is completed, the value of the power-control attribute determines whether the client program performs automatic shutdown, restart, or no operation. The value of the power-control attribute is reboot, poweroff, or null. (III) Beneficial Effects This invention proposes a method for remote backup and recovery of a file system and hard disk based on USB boot, which has the following beneficial effects: It is easy to maintain: Through the clientless architecture design of the USB boot section, the software updates and maintenance of the entire solution can be completed on the server side.
[0017] It features secure and reliable transmission and storage: SSHFS and AES-256 algorithms ensure secure transmission and storage of image files, while rclone enables resume functionality, enhancing transmission reliability.
[0018] It is highly scalable: It provides an interface for interaction with upper-layer applications. Upper-layer applications can obtain the real-time status of the backup and recovery process through the interface, and can control the backup and recovery process, thus enabling rapid portability to multiple application scenarios. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0020] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0021] This invention provides a USB-boot-based method for remote backup and recovery of file systems and hard drives, applied to the Kylin V10 server operating system. It employs a clientless architecture, automatically discovering the server and loading client programs. It can back up and restore ordinary data disk partitions with file systems or operating system disks with boot information. This invention configures a remote backup and recovery environment on the server, which boots via USB. The clientless architecture automatically configures the local IP address via DHCP and obtains the server IP address and SSHFS path through server broadcast data. It automatically mounts remote storage and loads remote resources, reading JSON configuration files from the remote backup and recovery environment to perform corresponding file system / hard drive level backup and recovery operations. The process supports breakpoint resumption and end-to-end encryption / decryption of backup files, while reserving an interface for upper-layer applications on the server. This invention achieves end-to-end encryption / decryption of file systems / hard drives without local storage. The USB boot and clientless architecture, along with the upper-layer application interaction interface on the server, provide scalability and improve system maintenance efficiency and security.
[0022] To address the problems in the background art, the present invention can achieve the following: The clientless architecture design of the USB boot section can automatically discover the server, load and execute the client program. This design allows the entire software update and maintenance solution to be completed on the server side, improving the convenience of software maintenance.
[0023] The SSHFS algorithm and support for AES-256 encryption and decryption provide secure transmission and storage of image files, while rclone enables resume functionality to ensure reliable transmission.
[0024] It provides an interface for interaction with upper-layer applications. Upper-layer applications can obtain the real-time status of the backup and recovery process through the interface, and can control the backup and recovery process, thereby enabling rapid portability to multiple application scenarios.
[0025] This invention proposes a method for remote backup and recovery of a file system and hard disk based on USB boot. The overall design flowchart is as follows. Figure 1 As shown. This method first deploys the server-side program, client-side program, structured configuration file, and SSH public key file on the server side. Then, it executes two stages: server-side environment configuration and client loading and execution of remote resources after USB boot. The specific steps are as follows: Server environment configuration: Step 1.1: When performing remote backup and recovery on the server, initialize the backup and recovery environment, start the DHCP service, and the server program continuously sends UDP broadcasts containing the server IP and SSHFS path information. Store the pre-configured JSON-formatted structured configuration file in the specified path. Loading and executing remote resources after USB boot: Step 1.2: The USB bootloader automatically configures the local IP address via DHCP. The generic bootloader starts automatically and receives UDP broadcasts from the server to obtain the server IP address and SSHFS path. Step 1.3: Mount the SSHFS path, load and execute the client program, read the structured configuration file, and obtain specific operation information; then execute steps 1.3.1 to 1.3.2. Step 1.3.1 When the operation is backup, there are two cases: backing up the file system or backing up the hard disk device. When backing up the file system, the partition device specified in the structured configuration file is backed up. When backing up the hard disk device, the partition table, boot information and all file systems on the hard disk device specified in the structured configuration file are backed up, and the generated image file is stored in the SSHFS path. Step 1.3.2 When the operation is recovery, there are two cases: restoring the file system or restoring the hard disk device. When restoring the file system, the partition device specified in the structured configuration file is restored using the specified partition backup image file. When restoring the hard disk device, the hard disk device specified in the structured configuration file is restored using the specified partition table, boot information file, and partition backup image file. Step 1.4: After the backup or restore operation is completed, clean up the site and perform the operation according to the power policy.
[0026] This method provides server-side environment configuration suitable for the Kylin operating system.
[0027] The structured configuration file mentioned in step 1.1 includes the following attributes: the backup / restore level (target_type), the operation attribute, the backup or restore device name (target_device), whether encryption / decryption is performed synchronously during the backup or restore process (encryption), the key path information (kep_path) used for encryption / decryption, the hard disk device health information (health_check), and the power-control configuration after the process is completed.
[0028] This method supports reading hard disk health information and saving it as a file. When the health_check attribute in the structured configuration file is true, the backup and restore operations simultaneously read the hard disk device health information and store the relevant information in the SSHFS path.
[0029] The protocol content broadcast by the server in step 1.1 includes the server IP and SSHFS path information.
[0030] The USB boot process adopts a clientless architecture. The client program is loaded and executed from the server, and the execution process reports the real-time status through a JSON file or a lightweight agent.
[0031] In step 1.3.1, when the value of the operation attribute is backup and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified, and a file system backup operation is performed. When the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved. If it is GPT, the corresponding GPT partition information is saved, and then a file system backup operation is performed on each partition.
[0032] In step 1.3.2, when the value of the operation attribute is recovery and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified and a file system-level recovery operation is performed. When the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved. If it is GPT, the corresponding GPT partition information is saved, and then a file system-level recovery operation is performed on each partition.
[0033] The backup or restore process in step 1.3 performs end-to-end encryption and decryption using the AES-256 algorithm based on the enable status of the encryption attribute in the structured configuration file and the key specified by the key_path attribute. In step 1.3, the real-time status of the backup or restore operation is reported through a reserved interface JSON file and a lightweight agent. The reported content includes the current task status (current_stage), the real-time progress (progress_percentage), the current status (current_stage_description), and the error message (error_message).
[0034] The backup or restore operation in step 1.3 can be stopped by the server-side configuration signal file stop.flag. When the client program automatically detects the existence of the stop.flag file, the backup or restore operation will stop and the process files will be cleaned up.
[0035] After the backup / restore operation in step 1.4 is completed, the value of the power-control property determines whether the client program performs automatic shutdown, restart, or no operation. The value of the power-control property is reboot, poweroff, or empty.
[0036] It can be seen that the design features of this invention are as follows: 1. Firstly, it lies in the clientless design architecture.
[0037] In steps 1.1-1.3 of this invention, the architecture first deploys server-side programs, client-side programs, structured configuration files, and SSH public key files on the server side. The USB bootloader is configured with an IP address via DHCP. The server sends a broadcast protocol containing the server IP address and SSHFS path information. The generic bootloader in the USB bootloader receives and parses the broadcast, automatically mounts SSHFS, loads and executes the client-side program, reads the configuration file, and begins backup and restore operations. Through this design architecture, the server-side programs, client-side programs, and configuration files involved in this invention only need to be updated and maintained on the server side.
[0038] 2. Secondly, this invention is characterized by providing secure and reliable transmission and storage of image files. Traditional protocols such as NFS do not support transmission encryption, and conventional backup images do not support encryption operations. In step 1.3 of this invention, end-to-end security measures are integrated. The backup and restore processes can perform end-to-end encryption and decryption using the AES-256 algorithm based on the `encryption` enable status in the configuration file and the key specified by `key_path`. Simultaneously, the keys required for encryption and decryption are placed in a temporary path on the server before task execution, read and used by the client, and automatically cleared after the task is completed, achieving the principles of key temporariness and minimal exposure. Furthermore, the transmission of image files via SSHFS+rclone provides breakpoint resumption capability, effectively coping with unstable network environments and improving transmission reliability.
[0039] 3. This invention provides a real-time status feedback and control interface to extend upper-layer applications. It supports reporting the real-time status of the backup and recovery process through a reserved interface JSON file and a lightweight agent. The client program can control the suspension of the backup and recovery process by recognizing the stop.flag file.
[0040] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for USB boot-based file system and hard disk remote backup and recovery, characterized in that, This method is applied to the Kylin server operating system and can automatically discover the server and load the client program, and back up and restore data disk partitions with file systems or operating system disks with boot information.
2. The method of claim 1, wherein, This method configures a remote backup and recovery environment on the server side. The server boots via USB and adopts a clientless architecture. It automatically configures the local IP address via DHCP and obtains the server IP address and SSHFS path through the server's broadcast data. It automatically mounts remote storage and loads remote resources. It reads structured configuration files from the remote backup and recovery environment to perform corresponding file system or hard disk-level backup and recovery operations. The operation process supports breakpoint resumption and end-to-end encryption and decryption of backup files.
3. The method of claim 2, wherein, This method involves four steps: first, deploying the server program, client program, and structured configuration file on the server side; then, executing two phases: server environment configuration and client loading and execution of remote resources after USB boot. The specific steps include: Server environment configuration: Step 1.1: When performing remote backup and recovery on the server, initialize the backup and recovery environment, start the DHCP service, and the server program continuously sends UDP broadcasts containing the server IP and SSHFS path information. Store the pre-configured JSON-formatted structured configuration file in the specified path. Loading and executing remote resources after USB boot: Step 1.2: The USB bootloader automatically configures the local IP address via DHCP. The bootloader starts automatically and receives UDP broadcasts from the server to obtain the server IP address and SSHFS path. Step 1.3: Mount the SSHFS path, load and execute the client program, read the structured configuration file, and obtain specific operation information; then execute steps 1.3.1 to 1.3.
2. Step 1.3.1 When the operation is backup, there are two cases: backing up the file system or backing up the hard disk device. When backing up the file system, the partition specified in the structured configuration file is backed up. When backing up the hard disk device, the partition table, boot information and all file systems of the hard disk device specified in the structured configuration file are backed up, and the generated image file is stored in the SSHFS path. Step 1.3.2 When the operation is recovery, there are two cases: restoring the file system or restoring the hard disk device. When restoring the file system, the partition specified in the structured configuration file is restored using the specified partition backup image file. When restoring the hard disk device, the hard disk device specified in the structured configuration file is restored using the specified partition table, boot information, and partition backup image file. Step 1.4: After the backup or restore operation is completed, clean up the site and perform the operation according to the power policy.
4. The method of claim 3, wherein, The structured configuration file mentioned in step 1.1 includes the following attributes: the backup / restore level (target_type), the operation attribute, the backup or restore device name (target_device), whether encryption / decryption is performed synchronously during the backup or restore process (encryption), the key path information (kep_path) used for encryption / decryption, the hard disk device health information (health_check), and the power-control configuration after the process is completed.
5. The method of claim 4, wherein, When the health_check attribute in the structured configuration file is set to true, the backup and restore operations simultaneously read the hard disk device health information and store the relevant information in the SSHFS path.
6. The method of claim 4, wherein, In step 1.3.1, when the value of the operation attribute is backup and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified, and a file system backup operation is performed. When the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved. If it is GPT, the corresponding GPT partition information is saved, and then a file system backup operation is performed on each partition. In step 1.3.2, when the value of the operation attribute is recovery and the value of the target_type attribute is partition, the file system type of the specified partition is automatically identified and a file system-level recovery operation is performed. When the value of the target_type attribute is disk, the partition table type of the hard disk device is automatically identified. If it is DOS, the first 512 bytes of partition and boot information of the hard disk device are saved. If it is GPT, the corresponding GPT partition information is saved, and then a file system-level recovery operation is performed on each partition.
7. The method of claim 4, wherein, The backup or restore process in step 1.3 performs end-to-end encryption and decryption using the AES-256 algorithm based on the enabled state of the encryption attribute in the structured configuration file and the key specified by the key_path attribute.
8. The method as described in claim 4, characterized in that, In step 1.3, the real-time status of the backup or restore operation is reported through a reserved interface JSON file and a lightweight agent. The reported content includes the current task status (current_stage), the real-time progress (progress_percentage), the current status (current_stage_description), and the error message (error_message).
9. The method as described in claim 4, characterized in that, In step 1.3, the backup or restore operation is stopped by the server-side configuration signal file stop.flag. When the client program automatically detects the existence of the stop.flag file, the backup or restore operation stops and the process files are cleaned up.
10. The method as described in claim 4, characterized in that, After the backup / restore operation in step 1.4 is completed, the value of the power-control property determines whether the client program performs automatic shutdown, restart, or no operation. The value of the power-control property is reboot, poweroff, or empty.