A system installation method supporting flexible partition layout

The image creation method based on file content solves the problems of large disk space occupation and long installation time in the prior art, and realizes flexible partition layout adjustment and efficient system installation.

CN116301940BActive Publication Date: 2025-09-30CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310259389.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2025-09-30
Estimated Expiration
2043-03-10

AI Technical Summary

Technical Problem

The existing user image format based on simulated block devices occupies a large amount of disk space, the installation process is time-consuming, and the disk partition layout and image binding cannot be flexibly adjusted.

Method used

The system installation is finally completed by adopting a file content-based image creation method, through standard user image creation, image file extraction and compression, MD5 verification file generation, image deployment, adjustment of partition layout according to user needs, disk RAID configuration and system directory mounting.

Benefits of technology

It shortens the system file copying time during the installation process, reduces disk space usage, and supports flexible adjustment of partition layout to meet the needs of different users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116301940B_ABST
    Figure CN116301940B_ABST
Patent Text Reader

Abstract

The present invention relates to the fields of IT and software development, and specifically discloses a system installation method supporting flexible partition layout, comprising step S1, standard user image creation, and completing installation on a virtual machine using a standard DVD via kickstart / autoseed; step S2, image file extraction and compression into a target format; step S3, generating an md5sum verification file and a default disk partition layout file; step S4, image deployment: image deployment requires simultaneous deployment of the file generated in step S3; and step S5, image installation: a user requirement list including disk RAID, partition layout requirements, and user and network configurations. The present invention can not only reduce disk space occupation, but also significantly shorten the time consumption of the image installation process, and simultaneously provides a feasible method for meeting the different disk partition layout requirements of multiple users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of IT and software development, and in particular to a system installation method supporting flexible partition layout. Background Art

[0002] On mainstream cloud platforms, user image formats such as qcow2 and raw, which are based on simulated block devices, are commonly used. The advantages of this approach are simple image creation and modification, as well as easy installation, replication, and configuration, and the ease of integration with backup and snapshot processes. However, the disadvantages are also significant: the files occupy a large amount of disk space, and the installation process is time-consuming, especially with larger files.

[0003] Another problem is that this image format includes disk partition table information, and the disk partition layout is tied to the image, making it nearly impossible to change the partition layout during installation. If a user requests a new partition layout, a new system image is often required, making it impossible to flexibly adjust the partition layout to suit different user requirements.

[0004] Therefore, this patent addresses some of the shortcomings of image installation methods in disk formats such as qcow2 / raw, and proposes a system installation method that supports flexible partition layout based on file content and supports multiple file formats such as squashfs, tar, gzip, etc. Summary of the Invention

[0005] The present invention aims to provide a system installation method that supports flexible partition layouts. This method aims to address the issues with user images based on simulated block device files, such as qcow2 and raw files, which occupy large disk space, take up long installation copy times, and cannot be adjusted when the disk partition layout is tied to the image. The present method addresses these shortcomings by proposing a file content-based image creation method and corresponding installation method. This method improves disk space usage, significantly shortens the time required to copy system files during installation, and can also meet the diverse requirements for disk partition layout during installation.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a system installation method supporting flexible partition layout, the method comprising:

[0007] Step S1: Create a standard user image and use a standard DVD to complete the installation on the virtual machine using kickstart / autoseed.

[0008] Step S2, extracting the image file and compressing it into the target format;

[0009] Step S3, generating an md5 verification file and a default disk partition layout file;

[0010] Step S4, image deployment: Image deployment requires deploying the files generated in step S3 at the same time;

[0011] Step S5, image installation: user requirement list, including disk RAID, partition layout requirements, user and network configuration;

[0012] Step S6, mirror installation: perform disk RAID configuration, disk partitioning, and system directory mounting according to the information in step S5;

[0013] Step S7, mirror installation: copy the mirror file system file in step S2 to the mounted directory;

[0014] Step S8, image installation: complete the modification of host name, user, environment, and service configuration;

[0015] Step S9, image installation: grub boot information configuration and update;

[0016] Step S10: The system restarts and the installation is completed.

[0017] As a preferred embodiment of the present invention, the detailed steps of step S1, standard user image creation, are as follows:

[0018] S101, use the standard image to use the kickstart / autoseed method to install the system;

[0019] S102, configuring and customizing the installation system, including driver integration and basic configuration;

[0020] S103, after the system installation is completed, a qcow2 or raw image file is obtained;

[0021] S104, using libguestfs or virt-tar-out tools to extract the image file content, including all files in the system root directory, and create a squashfs or tar.gz compressed file;

[0022] S105, configure the default partition layout file, configure the .lvm layout file and the .direct layout file respectively according to whether the lvm logical volume function is used, and also according to whether the image supports different BIOS and UEFI boot modes; and generate the md5sum verification file of the image at the same time.

[0023] As a preferred implementation scheme of the present invention, in step S2, it is necessary to request a partition layout file and execute the MakeFileSystemLayout disk partition instruction according to the layout description.

[0024] As a preferred embodiment of the present invention, the detailed steps of step S3 include receiving an image copy instruction, obtaining a squashfs image and an md5 checksum file from an image service, and completing verification.

[0025] As a preferred embodiment of the present invention, the user information modified in step S8 includes the user password, and the information modified in step S8 also includes network relationship information configuration information and firewall configuration information.

[0026] As a preferred embodiment of the present invention, the mirror output format is a content-based file format.

[0027] As a preferred embodiment of the present invention, the file format supports multiple compression methods, with squashfs being the default, and the PXE environment can support these formats and read the system file content.

[0028] As a preferred embodiment of the present invention, each image is accompanied by a text file with a .lvm / .direct suffix, the content of which is the default disk partition layout information.

[0029] As a preferred embodiment of the present invention, when submitting a system installation request, the disk partition layout information is modified according to the requirements and submitted to the system for the installation process to call after verification.

[0030] As a preferred embodiment of the present invention, the partition layout supports BIOS, UEFI and LVM logical volume boot modes.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] 1. New image installation method, system file copying is based on file content rather than device blocks, which is more efficient;

[0033] 2. The image system file content is no longer bound to the disk partition table, and the partition layout can be flexibly adjusted;

[0034] 3. The image format can be more flexible;

[0035] 4. The image content and configuration can be modified without the help of a virtualization environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention.

[0037] Figure 1This is a flow chart of a system installation method supporting flexible partition layout according to the present invention;

[0038] Figure 2 A diagram showing the system module structure used in a system installation method supporting flexible partition layout according to the present invention;

[0039] Figure 3 This is a diagram illustrating the mirror installation process of a system installation method supporting flexible partition layout according to the present invention;

[0040] Figure 4 This is an example of an LVM logical volume partition layout file for a system installation method supporting flexible partition layout according to the present invention;

[0041] Figure 5 This is an example of a direct partition layout file for a system installation method supporting flexible partition layout according to the present invention. DETAILED DESCRIPTION

[0042] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0043] See also Figure 1-Figure 5 To achieve the above objectives, the present invention provides the following technical solutions: a system installation method that supports flexible partition layout. This method, leveraging the infrastructure and command data interaction of the Tianyi Cloud bare metal management platform, proposes an efficient user image installation method that differs from traditional methods. The method primarily includes the following steps:

[0044] Step S1: Create a standard user image and use a standard DVD to complete the installation on the virtual machine using kickstart / autoseed.

[0045] Step S2, extracting the image file and compressing it into the target format;

[0046] Step S3, generating an md5 verification file and a default disk partition layout file;

[0047] Step S4, image deployment: Image deployment requires deploying the files generated in step S3 at the same time;

[0048] Step S5, image installation: user requirement list, including disk RAID, partition layout requirements, user and network configuration;

[0049] Step S6, mirror installation: perform disk RAID configuration, disk partitioning, and system directory mounting according to the information in step S5;

[0050] Step S7, mirror installation: copy the mirror file system file in step S2 to the mounted directory;

[0051] Step S8, image installation: complete the modification of host name, user, environment, and service configuration;

[0052] Step S9, image installation: grub boot information configuration and update;

[0053] Step S10, the system restarts and the installation is completed;

[0054] This method includes the creation, deployment, and application (installation) of user images. Compared with other image installation methods, its special features are:

[0055] 1. The image output format is a content-based file format that supports multiple compression methods such as tar.gz. The default is squashfs. The PXE environment can support these formats and read the system file content.

[0056] 2. Each image is accompanied by a text file with the .lvm / .direct suffix, which contains the default disk partition layout information;

[0057] 3. When submitting a system installation request, the user can modify the disk partition layout information according to their needs. After verification, it can be submitted to the system for installation process call;

[0058] 4. The partition layout not only supports BIOS / UEFI boot mode, but also supports LVM logical volume.

[0059] In summary, compared with the existing installation method (user image installation in formats such as qcow2 / raw), the main advantages are:

[0060] 1. Small disk space occupation (file size is a fraction of qcow2 / raw);

[0061] 2. The time spent on copying system files during the installation process is significantly shortened;

[0062] 3. Unbind the system content and disk partitions, and flexibly adjust them according to needs during installation;

[0063] 4. Support multiple compression methods, such as tar.gz, squashfs, deflate, etc.;

[0064] To make the technical solutions and advantages of the present disclosure easier to understand and implement, the solutions in this patent are further described in detail below in conjunction with the accompanying drawings and embodiments. The specific embodiments described herein are only used to explain the present invention and are not intended to limit the scope of application of the present invention.

[0065] Example 1 (Mirror Image Production)

[0066] This embodiment is a process of using a standard Linux publicly released DVD image to create a cloud platform user image in a certain project. The specific work content of the original project does not limit this embodiment, so it will not be described in detail.

[0067] The specific operation process is described as follows:

[0068] S101. Use a standard image to install the system using methods such as kickstart and autoseed. This process is usually done on a virtual machine.

[0069] S102. Configure and customize the installation system, including driver integration and basic configuration;

[0070] S103. The system installation is complete, and a qcow2 or raw image file is obtained.

[0071] S104. Use the libguestfs (virt-tar-out) tool to extract the image file contents (all files in the system root directory) and create a compressed file such as squashfs or tar.gz;

[0072] S105. Configure the default partition layout file. Usually, the .lvm layout file is configured separately according to whether the lvm logical volume function is used. Figure 4 ) and .direct layout files ( Figure 5 ), and there are slight differences depending on whether the image supports BIOS or UEFI boot modes; at the same time, the md5sum verification file of the image is generated.

[0073] The mirroring process is complete.

[0074] This implementation follows the conventional production process, but significantly differs in that it includes the extraction and recompression of image system files. This unbundles the user image from the partition layout and introduces a file-defined partition layout that supports both LVM logical volumes and direct partitions. This approach not only significantly reduces the image file size but also allows for flexible partition layout customization based on user needs when installing the image into the user system.

[0075] Example 2 (Mirror Image Installation)

[0076] This embodiment is a process of applying the image file in the first embodiment to a certain project to perform a user system installation process. The specific work content of the original project does not limit this embodiment, so it will not be described in detail.

[0077] The system installation process is carried out in a command interactive manner. The specific process is described as follows. Figure 3 As shown:

[0078] S201. Request a partition layout file and execute the MakeFileSystemLayout disk partition instruction according to the layout description;

[0079] S202. Receive the image copy instruction, obtain the squashfs image and md5 checksum file from the image service, and complete the verification; mount according to the partition layout, and execute the WriteImage system file copy instruction. The execution command line is as follows:

[0080] unsquashfs-fd / tmp / tmphniouu9n / chroot / tmp / tmphniouu9n / temp / CentOS-7.6-amd64-bios.squashfs

[0081] S203. Repair the boot information, install grub and configure the system boot information, the command is as follows:

[0082] grub2-install

[0083] grub2-mkconfig

[0084] S204. Mount the directory and complete the modification of system configurations such as host name, user password, network information, and firewall;

[0085] S205. The device restarts and completes the boot.

[0086] The system installation process is complete.

[0087] This embodiment includes steps such as partition layout file information acquisition, image download and verification, and image installation. The system files and disk partition layout are decoupled, and the image file download can be verified. Compared with traditional methods, it is more efficient and time-consuming (usually several hours is shortened to more than ten minutes).

[0088] The above description is a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the scope of the present invention should be included in the scope of protection of the present invention.

[0089] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0090] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A system installation method supporting flexible partition layout, characterized in that: The method comprises: Step S1: Create a standard user image and use a standard DVD to complete the installation on the virtual machine using kickstart / autoseed. Step S2, extracting the image file and compressing it into the target format; Step S3, generating an md5 verification file and a default disk partition layout file; Step S4, image deployment: Image deployment requires deploying the files generated in step S3 at the same time; Step S5, image installation: user requirement list, including disk RAID, partition layout requirements, user and network configuration; Step S6, mirror installation: perform disk RAID configuration, disk partitioning, and system directory mounting according to the information in step S5; Step S7, mirror installation: copy the mirror file system file in step S2 to the mounted directory; Step S8, image installation: complete the modification of host name, user, environment, and service configuration; Step S9, image installation: grub boot information configuration and update; Step S10, the system restarts and the installation is completed; The detailed steps of step S1, standard user image creation are as follows: S101, use the standard image to use the kickstart / autoseed method to install the system; S102, configuring and customizing the installation system, including driver integration and basic configuration; S103, after the system installation is completed, a qcow2 or raw image file is obtained; S104, using libguestfs or virt-tar-out tools to extract the image file content, including all files in the system root directory, and create a squashfs or tar.gz compressed file; S105, configure the default partition layout file, configure the .lvm layout file and the .direct layout file respectively according to whether the lvm logical volume function is used, and the partition layout file will be different according to whether the image supports BIOS and UEFI boot modes; at the same time, generate the md5sum verification file of the image.

2. A system installation method supporting flexible partition layout according to claim 1, characterized in that: In step S2, it is necessary to request a partition layout file and execute the MakeFileSystemLayout disk partition instruction according to the layout description.

3. A system installation method supporting flexible partition layout according to claim 2, characterized in that: The detailed steps of step S3 include receiving an image copy instruction, obtaining a squashfs image and an md5 checksum file from an image service, and completing verification.

4. A system installation method supporting flexible partition layout according to claim 3, characterized in that: The user information modified in step S8 includes the user password, and the information modified in step S8 also includes network relationship information configuration information and firewall configuration information.

5. The system installation method supporting flexible partition layout according to claim 4, characterized in that: The image output format is based on the content of the file format.

6. The system installation method supporting flexible partition layout according to claim 5, characterized in that: The content-based file format supports multiple compression methods, the default is squashfs, and the PXE environment can support the file format and read the system file content.

7. A system installation method supporting flexible partition layout according to claim 6, characterized in that: Each image is accompanied by a text file with the .lvm / .direct suffix, which contains the default disk partition layout information.

8. The system installation method supporting flexible partition layout according to claim 7, characterized in that: When submitting a system installation request, modify the configuration disk partition layout information according to requirements, and submit it to the system for installation process call after verification.

9. The system installation method supporting flexible partition layout according to claim 8, characterized in that: The partition layout supports BIOS, UEFI and LVM logical volume boot modes.

Citation Information

Patent Citations

  • Method and device for installing operating system

    CN114579148A

  • A method and system for expanding virtual machine capacity based on LVM

    CN114936068A