System writing method for USB flash disk by USB flash disk recording tool
By using technical means such as Ubuntu system and Shell Script in the operation and maintenance USB disk, the problem that existing operation and maintenance USB disk solutions cannot update the kernel and support new hardware is solved, the system maintenance and update functions are realized, and the USB disk burning tool that supports multi-boot mode and Windows system is reduced, which reduces operation and maintenance costs and complexity.
Patent Information
- Application Number
- CN202411900952.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-18
AI Technical Summary
The existing operation and maintenance USB drive solution cannot update the kernel to support new hardware, resulting in missing drivers and misjudgment on-site operation and maintenance; it does not support the integration of commonly used test tools, and the update and maintenance process is cumbersome; it can only support a single boot mode and does not support the USB drive burning tool for Windows systems, resulting in operation and maintenance personnel needing to prepare multiple USB drives, which increases physical costs.
Ubuntu system is used as the base system for operating and maintaining U disks. By installing and updating the software source, installing the required software toolkits and server hardware testing tools, and setting the system to automatically log in to the root user. Write Shell Script to integrate partition formatting, restore root file system, modify partition tables, and install boot loader operations. Use the remastersys tool to make the configured base system into a real-time operating system, integrate kernel and virtual disk environment files, and adjust the content of the grub.cfg document to support Legacy and UEFI dual boot modes.
It realizes maintenance and update functions for USB drive systems, supports integration with new hardware and commonly used testing tools, simplifies the update and maintenance process, supports USB drive burning tools for Windows systems, and reduces physical costs and operation and maintenance complexity.
Smart Images

Figure CN119847544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer storage, and in particular to a method for implementing a system writing method of a USB disk by a USB disk burning tool. Background Art
[0002] With the rapid development of big data and cloud computing, the number of servers in Internet data centers (IDCs) has increased dramatically, which has put forward higher requirements on the operation and maintenance efficiency of server manufacturers. The operation and maintenance of server hardware is mainly undertaken by manufacturers, so it is necessary to deploy operation and maintenance personnel and engineers on site in IDCs and use Linux-based operation and maintenance USB flash drives to deal with various server problems.
[0003] There are two main USB disk solutions for operation and maintenance: the first is to modify the Live OS that comes with the official Linux release installation image. The basic operation of this solution is to mount the image file and copy it to a new path, then decompress the Live OS, switch the root path to the root file system of the Live OS for modification, and finally put the modified Live OS back to the corresponding path in the USB disk; the second is to install the independent Linux system directly into the USB disk, use the USB disk as a simple storage medium, and then directly enter the installed USB disk system to install various software packages and tools. Although these two solutions have their own advantages, they also have obvious defects.
[0004] The problem with the existing technology is that Solution 1 cannot update the kernel to support new hardware due to the fixed kernel version, resulting in driver loss and misjudgment of on-site operation and maintenance. In addition, the solution does not support the integration of common testing tools, and the update and maintenance process is cumbersome. Although Solution 2 is easy to operate, it can only support a single boot mode and does not support the USB flash drive burning tool of the Windows system, resulting in the need for on-site operation and maintenance personnel to prepare multiple USB flash drives, increasing physical costs. The existing technologies are all insufficient and cannot meet the needs. Summary of the invention
[0005] The purpose of the present invention is to provide a method for writing a system to a USB flash drive using a USB flash drive, aiming to solve the problem that the existing USB flash drive solution cannot update the kernel to support new hardware, resulting in driver loss and misjudgment of on-site operation and maintenance. The integration of common test tools is not supported, and the update and maintenance process is cumbersome. The USB flash drive burning tool can only support a single boot mode and does not support the Windows system, resulting in the need for on-site operation and maintenance personnel to prepare multiple USB flash drives, which increases the physical cost.
[0006] To achieve the above object, the present invention provides a method for implementing a system writing method to a USB flash drive using a USB flash drive burning tool, comprising the following steps:
[0007] Select Ubuntu system as the base system of the operation and maintenance USB disk system, and select the boot file of its installation image file as the boot loader of the operation and maintenance USB disk system;
[0008] Install the base system and update its software source, install the required software toolkits and server hardware testing tools, set the system to automatically log in to the root user, and change the system hostname to the machine's SN;
[0009] By writing Shell Script, we can integrate the operations of formatting the storage medium partition, restoring the root file system, modifying the partition table, and installing the boot loader to achieve the maintenance function of the USB disk system.
[0010] Use the remastersys tool to make the configured base system into a real-time operating system and its matching kernel and virtual disk environment files;
[0011] Integrate the generated real-time operating system files, kernel and virtual disk environment files, and create a path for interacting with the Windows system;
[0012] Adjust the grub.cfg file content to meet the startup conditions of Ubuntu Live OS;
[0013] Make the integrated files into a bootable image in ISO file format.
[0014] Among them, by installing the Ubuntu system as its base system and updating the software source, installing the required software toolkit and server hardware testing tools, setting the system to automatically log in to the root user and changing the system's hostname to the machine's SN, the steps also include:
[0015] Use the Ubuntu installation image to install a new Ubuntu system on a non-volatile storage medium as the base system of the operation and maintenance USB disk. After the installation is complete, log in to the system as the root user;
[0016] Update the base system software source and make sure to use the official synchronized local source to obtain the latest software package;
[0017] Install commonly used software toolkits through software sources, including compilation environment, server hardware tools, document editors, and software dependency packages;
[0018] Install server hardware testing tools, including stress testing tools, performance testing tools, and stability testing tools;
[0019] Configure the base system to automatically log in to the root user, modify the / root / .profile file, and add a statement to automatically set the hostname to the machine's SN each time the system starts;
[0020] Choose whether to change the base system kernel based on the usage scenario or customer needs. If necessary, install the new kernel in the usual way.
[0021] Install drivers for various hardware based on the configuration diversity of IDC servers.
[0022] The steps of writing Shell Script to integrate the operations of formatting the storage medium partition, restoring the root file system, modifying the partition table, and installing the boot loader are used to implement the function of maintaining the USB disk system. The steps also include:
[0023] Create a Shell Script;
[0024] Add operations to partition and format the target storage medium in the Shell Script;
[0025] Confirm the root file system object that needs to be restored, and add the operation of restoring the root file system to the target storage medium in the Shell Script;
[0026] Place the EFI boot file in a separate partition. In the Shell Script, ensure that the root file system restore operation also includes the processing of the EFI partition.
[0027] After restoring the root file system to the target medium, add the operation of modifying the partition table information in the target medium to the Shell Script.
[0028] In the Shell Script, add the operation of installing the Bootloader on the target storage medium to ensure that the USB flash drive system restored to the target storage medium can be started from the target storage medium.
[0029] The generated real-time operating system files, kernel and virtual disk environment files are integrated, and a path for interacting with the Windows system is created. The steps also include:
[0030] Mount the previously used Ubuntu system boot image in the current system;
[0031] Create a new empty folder in the system to store the files copied later;
[0032] Copy the real-time operating system files generated using the remastersys tool into the newly created empty folder;
[0033] From the mounted Ubuntu system boot image, copy the boot and EFI folders to an empty folder;
[0034] Make sure that the empty folder contains the real-time operating system files, kernel files, virtual disk environment files, and boot and EFI folders, so that it has the basic characteristics of an operation and maintenance USB flash drive;
[0035] Create an empty folder named "Linux2Win" in the empty folder to store files that communicate with the Windows system, so that file interaction can be conveniently performed on the FAT32 formatted USB flash drive.
[0036] The step of adjusting the content of the grub.cfg file to meet the startup conditions of the Ubuntu real-time operating system further includes:
[0037] Modify the contents of the file named grub.cfg in the boot folder copied from the Ubuntu boot image in the created folder to adapt to the actual boot conditions.
[0038] The integrated files are made into a boot image in ISO file format, and the steps further include:
[0039] Use the grub-mkrescue command to make all files in the current directory into an ISO image file that supports Legacy and UEFI dual-boot modes.
[0040] A U disk burning tool of the present invention realizes a system writing method for a U disk, and the root file system used is a customized root file system, and the installation of various software drivers by the customized root file system is also demonstrated therein, which is impossible to do by using the root file system provided in the official installation image in the mainstream solution. The method of restoring the root file system is used to add the function of updating and maintaining the customized root file system. Through this function, the customized root file system in the operation and maintenance U disk can be restored, and then various updates and maintenance can be performed on the restored root file system, and finally the updated root file system and the kernel, Ram disk and other files can be remade into an ISO boot image. However, none of the existing mainstream solutions have the function of updating and maintaining. The technical defects of the two mainstream solutions are solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a reference diagram of the installed Ubuntu base system of the present invention.
[0043] Figure 2 It is a schematic diagram of the process of updating the source after the base system of the present invention is installed.
[0044] Figure 3 This is an example diagram of installing a commonly used software toolkit for a base system through a software source according to the present invention.
[0045] Figure 4 It is a statement reference diagram for adding corresponding statements in the / root / .profile document of the base system of the present invention.
[0046] Figure 5 It is a reference diagram of some hardware driver information installed in the base system of the present invention.
[0047] Figure 6 It is a code fragment reference diagram for partitioning and formatting the target storage medium in the Shell Script of the present invention.
[0048] Figure 7 It is a code reference diagram for restoring a root file system to a target storage medium in the Shell Script of the present invention.
[0049] Figure 8 It is a code reference diagram for creating partition table information for a target storage medium in the Shell Script of the present invention.
[0050] Fig. 9 It is a code reference diagram for installing the Bootloader for the target storage medium in the Shell Script of the present invention.
[0051] Fig.10 It is a command schematic diagram of installing the remastersys tool under the base system of the present invention.
[0052] Fig.11 It is a schematic diagram of the process of executing the "remastersys backup cdfs" command of the present invention.
[0053] Fig.12It is a reference diagram in which Live OS and other related files generated after the execution of the instructions of the present invention are located in the fixed path of " / home / remastersys / ISOTMP / live".
[0054] Fig.13 It is a schematic diagram of the process of burning the prepared ISO boot image into the operation and maintenance USB disk of the present invention.
[0055] Fig.14 It is a reference diagram of the modified grub.cfg file content of the present invention.
[0056] Fig.15 It is an operation reference diagram of the present invention for making the integrated files into a startup image in the ISO file format.
[0057] Fig.16 This is an example diagram of a USB disk system of the present invention that has been recorded and can be directly used for on-site operation and maintenance.
[0058] Fig.17 The present invention is Fig.16 The provided example is a customized example diagram based on step S102.
[0059] Fig.18 The present invention is Fig.16 The provided example implements the process of restoring the root file system of the USB flash drive of the current instance to the target storage medium in step S103.
[0060] Fig.19 The present invention is Fig.18 After the process, the expected result of successfully entering the target storage medium can be achieved, that is, the example diagram of verifying that step S103 is normal and available.
[0061] Fig. 20 It is a schematic diagram of the hierarchical structure of the on-site operation and maintenance USB disk solution of the present invention.
[0062] Fig.21 It is a flow chart of the steps of a method for implementing a system writing method to a U disk by a U disk burning tool of the present invention. DETAILED DESCRIPTION
[0063] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0064] For the on-site maintenance USB disk solution of the present invention, its hierarchical structure is as follows Fig. 20As shown, it generally includes three parts, namely: Bootloader (boot loader. It is the environment responsible for the booting function before the kernel of operating systems such as Linux and Windows works. Without it, the system disk cannot be successfully booted. The most commonly used Bootloader in the Linux system is grub.), Live OS (real-time operating system. It is the platform that carries the installation program in the installation image of each version of the Linux system. After being written to the U disk, it has a fixed path for file transfer between Windows or Linux; any operation modification performed in this type of OS will be restored to the initial state after the system is restarted if it is not placed in the fixed path mentioned above.) related content and interaction with the Windows system.
[0065] In view of the Linux (an open source UNIX-like operating system. It is currently widely used on servers of major Internet companies at home and abroad, and its existence is equivalent to the commonly used Windows system. Common Linux systems include Ubuntu, Debian, RHEL, etc.) installation image itself is compatible with Legacy and UEFI (two boot modes of the operating system. The two modes are independent of each other and affect the systems installed in their respective boot modes: if the system is installed in the Legacy boot mode, it cannot be successfully booted in the UEFI boot mode, and vice versa. Currently, the number of servers in the IDC using the UEFI boot mode accounts for more than 90%.) two boot modes, the Bootloader part in the present invention also directly uses the boot file that comes with the Linux installation image, which also avoids the possibility of being unable to boot due to the boot file being installed separately through the Bootloader.
[0066] The part related to Live OS is implemented by customizing the root file system in the present invention, which is quite different from the mainstream solution. Therefore, this part is the main technical problem solved by the present invention. In this part, the present invention mainly solves the problem that the mainstream solution cannot simultaneously include compatibility with new hardware, lacks common testing and verification tools, and lacks maintenance and update functions.
[0067] The file interaction part with the Windows system is a secondary problem that needs to be solved. Since the customized root file system is eventually burned into the USB flash drive, after the previous part is completed, the present invention adopts the method of creating a separate folder to clarify the specific path of the interaction between the USB flash drive system and the Windows system. Finally, it is only necessary to integrate these three parts of the hierarchical content into the ISO image file, so that it can be used through the common USB flash drive burning tool under the Windows system to realize the system writing to the USB flash drive.
[0068] See also Figures 1 to 21 The present invention provides a method for implementing a system writing method of a USB flash drive using a USB flash drive burning tool, comprising the following steps:
[0069] S101: Select the Ubuntu system as the base system of the operation and maintenance USB disk, and select the boot file of its installation image file as the boot loader of the operation and maintenance USB disk system;
[0070] Specifically, because the present invention is implemented based on the Ubuntu system, and the installation image of the Ubuntu system also supports the Legacy and UEFI dual-boot modes synchronously like the installation images of other Linux distribution systems, the present invention will directly select the boot file of the Ubuntu installation image file as the base system as the Bootloader of the operation and maintenance U disk system. The installation of the Bootloader will be sorted out together with other important files in step S104.
[0071] S102: Install the base system and update its software source, install the required software toolkit and server hardware testing tool, set the system to automatically log in to the root user, and change the system hostname to the SN of the machine;
[0072] Specifically, based on the characteristics of the Linux system, any version of the Linux system needs to provide a kernel and a paired Ram disk (virtual disk environment. It provides the software environment necessary for the Linux system to start up and must be used in pair with the kernel version. Without it, the root file system cannot be successfully entered, that is, the Linux system cannot be used. In the Linux system, it is generally named initrd.img.) file, otherwise the system cannot be successfully entered. The kernel and Ram disk file used in the present invention will be paired with a customized root file system, and then the kernel (the core of the Linux system. Responsible for managing the communication and resources between the hardware and the user process. If the hardware driver does not match the kernel version or the kernel version of the current system is too old, the hardware cannot be used under this version of the kernel.), Ram disk and the root file system in the Live OS mode are made into an ISO boot image and burned into a U disk, so that it can be made into an on-site operation and maintenance U disk for use. Based on the boot process of the Linux system, after gradually transitioning from BIOS (Basic Input Output System. It is the first software environment loaded after the server or computer is turned on, and includes functions such as initializing hardware, adjusting hardware settings, and providing boot mode.) to Ram disk, the initialization program in the Ram disk will mount the real root file system, and finally switch to the root file system. In addition, combined with the foregoing, the mainstream solution 1 directly uses the root file system and kernel that comes with the installation image, resulting in the problem of being unable to update the kernel and difficulty in maintenance, and the present invention will also add corresponding functions to the self-made root file system to solve these problems. Therefore, customizing the root file system is the most important step of the present invention. The implementation method of this step will be specifically explained below.
[0073] First, you need to take an empty non-volatile storage medium and install a new system in it. This system will serve as the base system in the operation and maintenance USB disk. Since the present invention is based on the Ubuntu system, we choose to directly use the Ubuntu installation image mentioned in step S101. The installation process here is consistent with the common installation process, and after the installation is complete, you must log in to the system as the root user, which will not be repeated here. A fully installed Ubuntu system can be referred to as follows Figure 1 shown.
[0074] After the base system is installed, the software source used by it needs to be updated. The source used in this invention is a source synchronized from the official source to the local source. Its software package content is no different from the official source. Generally, the official source can be used directly. The process of updating the source can be referred to Figure 2 .
[0075] After the software source is updated, you need to install commonly used software tool packages for the current system through the software source. These software depend on personal choice. Figure 3 An example is shown. Given that the final use scenario of the system is on-site operation and maintenance of the server, it is recommended to include at least the following software:
[0076] 1. Compilation environment (such as GCC, make, etc.)
[0077] 2. Common server hardware tools (such as nvme-cli, ipmitool, etc.)
[0078] 3. Document editor (such as vim, nano, etc.)
[0079] 4. Dependency packages of some software (such as libaio, dkms, net-tools, etc.)
[0080] After the above software is installed, you need to install common server hardware testing tools. Common server on-site operation and maintenance testing tools mainly include the following categories:
[0081] 1. Stress testing tools: Stressapptest, AVT, etc.
[0082] 2. Performance testing tools: FIO, Stream, etc.
[0083] 3. Stability testing tools: DC Cycle script, Reboot Cycle script, etc.
[0084] The test tools can be installed according to personal needs. The installation methods are all common installation methods and will not be repeated here.
[0085] After the above two software installations, the system has initially established a basic environment for server testing. However, in the on-site operation and maintenance scenario, the machine's SN is generally used as the unique identifier. Therefore, the system also needs to meet the following requirements:
[0086] 1. Ability to automatically log in to the root user
[0087] 2. Use the machine's SN as the system's hostname every time you enter the system
[0088] The operation method of the first requirement is consistent with the common method, so it will not be repeated here; for the second requirement, the present invention adopts the method of adding corresponding statements in the / root / .profile file so that when entering the system, the hostname is directly modified to the SN of the current machine. The statement can be referred to Figure 4 Contents shown in the box.
[0089] After completing the previous steps, the next step is to change the system kernel according to specific needs. This part is optional. Whether to change the kernel depends on the specific usage scenario or customer requirements. The method of installing the kernel is the same as the conventional method, so it will not be repeated here.
[0090] If the kernel does not need to be changed or has already been changed, you need to install the hardware driver for the current system. Since the server configurations in IDC are diverse, based on the principle of universality, you should install as many common hardware drivers as possible, such as GPU, HBA, DPU, NIC, etc. Since the methods for installing each hardware driver are independently provided by each hardware manufacturer and are not uniform, you can follow the installation methods provided by each manufacturer and will not list them one by one here. Figure 5 This is some hardware driver information installed in the system by the present invention, which is for reference only. The specific drivers that need to be installed depend on actual needs.
[0091] After all the above software and drivers are installed, the system has the two features of being compatible with the latest hardware and supporting commonly used test and verification tools. At this time, this step is completed.
[0092] S103: Implementing the function of maintaining the USB disk system by writing a Shell Script to integrate operations of formatting the storage medium partition, restoring the root file system, modifying the partition table, and installing the boot loader;
[0093] Specifically, when describing the defects of the mainstream solution, it is mentioned that if only one USB flash drive is used to boot the system in Legacy and UEFI dual modes, and it needs to be able to communicate with the Windows system, then it is necessary to use the Live OS technology to achieve it. However, since the mainstream solution is to directly use the Live OS that comes with the installation image, it will cause difficulties in subsequent updates and maintenance. Therefore, the present invention will use the method of restoring the root file system in Live OS to achieve the function of adding updates and maintenance to the operation and maintenance USB flash drive system. The following will explain the process of implementing this step in the present invention.
[0094] The essence of restoring the system is actually the process of transferring the existing system to another storage medium. For the Linux system, the process basically includes four parts: hard disk partition formatting, root file system restoration, partition table modification, and Bootloader installation. In the present invention, a Shell Script (a programming language that comes with the Linux system. It can be used to complete customized settings in the Linux system conveniently and quickly without taking up a lot of storage space.) will be used to integrate the functions of these four parts.
[0095] It is very simple to partition and format the hard disk under Linux system. Figure 6 This is a code snippet of the function of this part in the present invention, which can be used for reference.
[0096] If you want to restore the root file system to the target storage medium, first you need to confirm the real object of the restoration. It is mentioned in step S102 that since the current system will eventually exist in the U disk in the form of Live OS, the root file system that actually needs to be restored will exist in the U disk in the form of Live OS. Under the premise that the present invention is based on the Ubuntu system, after booting into the system through the U disk, the path where the root file system is located is fixed to " / run / live / rootfs / filesystem.squashfs", so the object that needs to be restored here should be all the contents in the path. In addition, since the root file system is to be completely restored to the target storage medium, considering that the BIOS (Basic Input Output System. It is the first software environment loaded after the server or computer is turned on, including initializing hardware, hardware settings adjustment, providing boot mode and other functions.) of the current server motherboard is almost all started in UEFI mode, it is also necessary to store the possible EFI boot files separately in an independent partition. Figure 7 The code used to implement this function in the present invention.
[0097] After completing the operation of restoring the root file system to the target medium, the partition table information already existing in the target storage medium needs to be modified. The function code of this part of the present invention can refer to Figure 8 .
[0098] The last step of the process is to install the Bootloader. Fig. 9 shown.
[0099] After completing the above-mentioned entire system restoration process, the function of adding maintenance and update to the operation and maintenance USB disk system has been realized. Moreover, because the entire system restoration process is only implemented by this automated Shell Script, it also has the advantages of easy operation and does not occupy storage space.
[0100] S104: using the remastersys tool to make the configured base system into a real-time operating system and a kernel and virtual disk environment file that matches the real-time operating system;
[0101] Specifically, because the present invention is based on the Ubuntu system, the present invention uses the remastersys tool to complete the operation content of this step. After the operation of step S102 is completed, the base system has been in a state where the software source has been configured. At this time, remastersys can be installed directly through the source installation method. The command to install the tool in Ubuntu is as follows: Fig.10 Shown in the box.
[0102] The method of using remastersys to make the current system into a Live OS is very simple. You only need to execute the "remastersys backup cdfs" command to automatically generate the Live OS of the current system and the matching kernel and Ram disk files in the / home path. The command execution process is as follows: Fig.11 After the command is executed, the Live OS and other related files generated are located in the fixed path " / home / remastersys / ISOTMP / live", which can be referred to Fig.12 As shown in the box, the file named filesystem.squashfs is the Live OS corresponding to the current root file system.
[0103] S105: Integrate the generated real-time operating system files, kernel and virtual disk environment files, and create a path for interacting with the Windows system;
[0104] Specifically, to complete this operation, first mount the Ubuntu system boot image used above under the base system, then create an empty folder, completely copy the parent path of the Live OS file generated by remastersys in step S103 (i.e., the folder named live under the path " / home / remastersys / ISOTMP") to the empty folder, and then completely copy the boot and EFI folders in the mount path of the Ubuntu system boot image to the empty folder. At this point, the empty folder has become a path structure with the basic characteristics of an operation and maintenance USB flash drive.
[0105] As mentioned above, when the prepared ISO boot image is burned into the operation and maintenance USB flash drive, the format of the USB flash drive will become FAT32. At this time, the USB flash drive has the function of interacting with Windows system files. In order to more conveniently find files that communicate with the Windows system, the present invention adopts the method of creating a separate empty folder named "Linux2Win" to improve this function. The complete process of the present invention processing this step can be referred to Fig.13 Contents shown.
[0106] S106: Adjust the content of grub.cfg file to meet the startup conditions of Ubuntu Live OS;
[0107] Specifically, this step needs to modify the content of a document named grub.cfg (which is the configuration file of the bootloader of the Linux system. Since the Linux system uses a bootloader manager named grub, the external configuration interface of grub is grub.cfg, so modifying grub.cfg can adjust the configuration during booting.) in the boot folder copied from the Ubuntu boot image in the folder created in step S104 to adapt to the actual startup conditions. Since the present invention uses the Ubuntu system as the basic system of Live OS, the modification of the grub.cfg document must meet the startup conditions of Ubuntu LiveOS. Fig.14 This is the modified grub.cfg file content of the present invention, for reference only.
[0108] S107: Create a boot image in ISO file format from the integrated files.
[0109] Specifically, after all the five steps S102-S106 are completed, return to the path after the files are integrated in step S104 (i.e., the folder with the name corresponding to the empty folder created in step S104), and then use the grub-mkrescue command to make all the files in the current directory into an ISO image file that supports Legacy and UEFI dual boot modes. The specific operation of the present invention can be referred to Fig.15 , the box contains the command to be executed, and the file with the suffix ".iso" is the target file to be generated. Finally, the practical use of the present invention can be realized by simply using a USB burning tool under Windows system such as Rufus or Ultra ISO to burn the newly generated ISO boot image into a USB disk.
[0110] Compared with the prior art, the present invention has the following beneficial effects:
[0111] 1. In step S102 of the present invention, it is mentioned that the root file system used in the present invention is a customized root file system, and the installation of various software drivers in the customized root file system is also shown therein, which is impossible to do using the root file system provided in the official installation image in the mainstream solution.
[0112] 2. In step S103, the present invention adds an update and maintenance function to the custom root file system by restoring the root file system. This function can restore the custom root file system in the operation and maintenance USB disk, and then perform various updates and maintenance on the restored root file system. Finally, the updated root file system and the kernel, Ram disk and other files are remade into an ISO boot image (i.e., repeating the four steps S104, S105, S106, and S107 of the present invention). However, none of the existing mainstream solutions have the update and maintenance function. Specific embodiment:
[0114] After making the ISO boot file according to the steps described in the technical solution, transfer it from the Linux system to the Windows system, and then use Rufus or UltraISO and other USB disk burning software to burn it into the USB disk. At this time, the USB disk has been made into an operation and maintenance USB disk. After inserting the USB disk into the USB port of the server to be maintained, enter the BIOS option interface, select the USB disk boot item and enter the USB disk system. Reference Fig.16 shown.
[0115] After entering the USB disk system, you can view or use the customized operations done in step S102 of the technical solution, such as installed test tools, hardware drivers and other software information. Fig.17 The displayed content is completely customized by the user, and is not like the root file system in the official installation image that cannot be customized. This is also one of the most important innovative functions included in the present invention.
[0116] When the root file system needs to be updated and maintained, since the root file system in Live OS format cannot be directly updated in the U disk, it is necessary to restore the root file system of the U disk to an empty storage medium first, and then enter the system of the storage medium to perform relevant update and maintenance after the restoration is completed. At this time, the Shell Script for restoring the root file system written in step S103 of the present invention can be used to directly restore the root file system under the current U disk to the empty storage medium. Fig.18 The restoration process is shown. Fig.19 This shows the situation after the restoration is completed and the storage medium system is entered. After the restoration is completed and the system in the storage medium is entered, the system can be updated and maintained.
[0117] The root file system used is a custom root file system, and it also shows how to install various software drivers in the custom root file system, which is impossible to do with the root file system that comes with the official installation image in the mainstream solution. The method of restoring the root file system adds the function of updating and maintaining the custom root file system. This function can restore the custom root file system in the operation and maintenance USB flash drive, and then perform various updates and maintenance on the restored root file system. Finally, the updated root file system and the kernel, Ram disk and other files can be remade into an ISO boot image. However, none of the existing mainstream solutions have the function of updating and maintaining. The technical defects of the two mainstream solutions are solved.
[0118] What is disclosed above is only a preferred embodiment of the present invention, and it certainly cannot be used to limit the scope of rights of the present invention. Ordinary technicians in this field can understand that all or part of the processes of the above embodiment and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A method for writing a system to a USB flash drive using a USB flash drive burning tool, characterized in that: The following steps are involved: Select Ubuntu system as the base system of the operation and maintenance USB disk, and select the boot file of its installation image file as the boot loader of the operation and maintenance USB disk system; Install the base system and update its software source, install the required software toolkits and server hardware testing tools, set the system to automatically log in to the root user, and change the system hostname to the machine's SN; By writing Shell Script, we can integrate the operations of formatting the storage medium partition, restoring the root file system, modifying the partition table, and installing the boot loader to achieve the maintenance function of the USB disk system. Use the remastersys tool to make the configured base system into a real-time operating system and its matching kernel and virtual disk environment files; Integrate the generated real-time operating system files, kernel and virtual disk environment files, and create a path for interacting with the Windows system; Adjust the grub.cfg file content to meet the startup conditions of Ubuntu Live OS; Make the integrated files into a bootable image in ISO file format.
2. A method for implementing a system writing method to a USB flash drive by a USB flash drive burning tool as claimed in claim 1, characterized in that: By installing the base system and updating its software source, installing the required software toolkit and server hardware testing tool, setting the system to automatically log in to the root user and changing the system hostname to the SN of the machine, the steps also include: Use the Ubuntu installation image to install a new Ubuntu system on a non-volatile storage medium as the base system of the operation and maintenance USB disk. After the installation is complete, log in to the system as the root user; Update the software source of the base system and make sure to use the official synchronized local source to obtain the latest software package; Install commonly used software toolkits through software sources, including compilation environment, server hardware tools, document editors, and software dependency packages; Install server hardware testing tools, including stress testing tools, performance testing tools, and stability testing tools; Configure the base system to automatically log in the root user, modify the / root / .profile file, and add a statement to automatically set the hostname to the machine's SN each time the system starts; Choose whether to change the system kernel based on the usage scenario or customer needs. If necessary, install the new kernel in the usual way. Install drivers for various hardware based on the configuration diversity of IDC servers.
3. The method for implementing a system writing method to a USB flash drive by a USB flash drive burning tool as claimed in claim 1, characterized in that: By writing Shell Script to integrate the operations of formatting the storage medium partition, restoring the root file system, modifying the partition table, and installing the boot loader, the maintenance function of the USB disk system is realized. The steps also include: Create a Shell Script; Add operations to partition and format the target storage medium in the Shell Script; Confirm the root file system object that needs to be restored, and add the operation of restoring the root file system to the target storage medium in the Shell Script; Place the EFI boot file in a separate partition. In the Shell Script, ensure that the root file system restore operation also includes the processing of the EFI partition. After restoring the root file system to the target medium, add the operation of modifying the partition table information in the target medium to the Shell Script. In the Shell Script, add the operation of installing the Bootloader on the target storage medium to ensure that the USB flash drive system restored to the target storage medium can be started from the target storage medium.
4. A method for implementing a system writing method to a USB flash drive by a USB flash drive burning tool as claimed in claim 1, characterized in that: Integrate the generated real-time operating system files, kernel and virtual disk environment files, and create a path for interacting with the Windows system. The steps also include: Mount the previously used Ubuntu system boot image in the current system; Create a new empty folder in the system to store the files copied later; Copy the real-time operating system files generated using the remastersys tool into the newly created empty folder; From the mounted Ubuntu system boot image, copy the boot and EFI folders to an empty folder; Make sure that the empty folder contains the real-time operating system files, kernel files, virtual disk environment files, and boot and EFI folders, so that it has the basic characteristics of an operation and maintenance USB flash drive; Create an empty folder named "Linux2Win" in the empty folder to store files that communicate with the Windows system, so that file interaction can be conveniently performed on a FAT32-formatted USB flash drive.
5. The method for implementing a system writing method to a USB flash drive by a USB flash drive burning tool as claimed in claim 1, characterized in that: Adjusting the content of the grub.cfg file to meet the startup conditions of the Ubuntu real-time operating system, the steps further include: Modify the contents of the file named grub.cfg in the boot folder copied from the Ubuntu boot image in the created folder to adapt to the actual boot conditions.
6. A method for implementing a system writing method to a USB flash drive by a USB flash drive burning tool as claimed in claim 1, characterized in that: The integrated files are made into a boot image in ISO file format, and the steps further include: Use the grub-mkrescue command to make all files in the current directory into an ISO image file that supports Legacy and UEFI dual-boot modes.
Citation Information
Cited By
Installation disk generation method and device, computer equipment and storage medium
CN120255916A