Automatic partition method, device and equipment for desktop operating system and medium

By installing cloud initialization programs and automatic partitioning files in the ISO image file of the cloud desktop operating system, the problem of insufficient disk space of the virtual machine is solved, automatic disk partitioning is realized, and system ease of use is improved.

CN119576225APending Publication Date: 2025-03-07BEIJING TRICOLOR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411621979.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the cloud desktop operating system, the root disk space of the virtual machine created by the user is small, and the remaining space is not mounted in real time, resulting in insufficient free space and requires manual partitioning or expansion. The process is complicated and technically difficult.

Method used

By obtaining the original ISO image file of the operating system, installing the cloud initialization program, and creating a cloud initialization file containing an automatic partitioning scheme, regenerating and modifying the ISO image file, using the image file to create a virtual machine, and after startup, read the file through the cloud initialization program, and automatically partitioning the disk.

Benefits of technology

It realizes that after the user has created the desktop virtual machine, the disk partition is automatically partitioned without manually entering instructions, which improves the ease of use of the system and helps users quickly create required partitions and adjust them according to their needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576225A_ABST
    Figure CN119576225A_ABST
Patent Text Reader

Abstract

The invention provides an automatic partitioning method and device for a desktop operating system, equipment and a medium, and relates to the technical field of cloud desks.The method comprises the steps that an original ISO mirror image file of the operating system is obtained, a cloud initialization program is installed in the original ISO mirror image file, and a cloud initialization configuration file containing an automatic partitioning scheme is created for the cloud initialization program; regenerating a modified ISO mirror image file containing a cloud initialization program and a cloud initialization configuration file; and creating a virtual machine by using the modified ISO mirror image file, and after the virtual machine is started, reading a cloud initialization configuration file through a cloud initialization program so as to perform disk partitioning operation according to an automatic partitioning scheme in the operation system installation process. Therefore, after a user establishes the desktop virtual machine and enters an operating system, automatic disk partitioning is realized, and manual instruction input for partitioning setting is not needed. According to the method, the user can be helped to quickly create the required partition, adjustment can be carried out according to the requirements of the user, and the usability of the system is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud desktop technology, and more specifically, to a method, device, equipment and medium for automatically partitioning a desktop operating system. Background Art

[0002] The cloud desktop operating system is a desktop application solution based on cloud computing technology. It virtualizes the user's traditional desktop operating system and applications and stores them on cloud servers. Users can remotely access these virtual desktop resources through network connections. It has been widely used in various industries. However, when users use the cloud desktop operating system, when they create a desktop version of a virtual machine with a storage size of 100G and enter the desktop to use it, they find that the root directory disk space of the virtual machine is very small, perhaps only 20G, and the remaining 80G is not mounted in real time, resulting in only 20G of available space. Users need to manually repartition or expand the user space directory. In the case of standard partitioning, if the growpart automatic expansion command cannot be used, fdisk needs to be used for manual partitioning. The partitioning steps are relatively complicated and have certain technical difficulties. Summary of the invention

[0003] In view of this, the purpose of this application is to provide a method, device, equipment and medium for automatic partitioning of a desktop operating system, which can realize automatic disk partitioning after the user creates a desktop virtual machine and enters the operating system, thereby improving the usability of the operating system.

[0004] In a first aspect, an embodiment of the present application provides a method for automatically partitioning a desktop operating system, the method comprising the following steps:

[0005] Obtain an original ISO image file of the operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program;

[0006] Regenerate the modified ISO image file containing the cloud initialization program and cloud initialization configuration files;

[0007] A virtual machine is created using the modified ISO image file, and after the virtual machine is started, the cloud initialization configuration file is read by the cloud initialization program to perform a disk partition operation according to the automatic partitioning scheme during the operating system installation process.

[0008] In some embodiments, a cloud initialization configuration file including a method for specifying an automatic partitioning scheme is created in the following manner, including the following steps:

[0009] Set the script content of the automatic partitioning scheme and place the script in the specified directory of the operating system;

[0010] Set the script in the directory specified by the operating system to executable permissions, and execute the script in the directory specified by the operating system.

[0011] In some embodiments, a startup command is used to set the script in the directory specified by the operating system to have executable permissions, and the script in the directory specified by the operating system is executed.

[0012] In some embodiments, the script content of the automatic partitioning scheme is set in the following manner, including the following steps:

[0013] Use the partition editor to operate disk devices;

[0014] Delete a partition, recreate it, and resize the file system on the partition.

[0015] In some embodiments, an image generation tool is used and a distributed object storage block device rbd command is adopted to regenerate a modified ISO image file including a cloud initialization program and cloud initialization configuration files.

[0016] In some embodiments, the method further comprises the following steps:

[0017] After installing the operating system, check the disk partition status to verify whether the automatic partitioning is successful.

[0018] In some embodiments, if the verification of automatic partitioning fails, check whether the disk device is faulty; or search for error information related to disk partitioning based on the system log; or determine whether the automatic partitioning scheme in the cloud initialization configuration file is reasonable.

[0019] In a second aspect, an embodiment of the present application provides a device for automatically partitioning a desktop operating system, the device comprising:

[0020] A creation module is used to obtain an original ISO image file of the operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program;

[0021] A generation module is used to regenerate a modified ISO image file containing the cloud initialization program and cloud initialization configuration files;

[0022] The partition module is used to create a virtual machine using the modified ISO image file, and after starting the virtual machine, read the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the operating system installation process.

[0023] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the steps of the automatic partitioning method for a desktop operating system as described in any embodiment of the first aspect are executed.

[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for automatic partitioning of a desktop operating system as described in any embodiment of the first aspect are executed.

[0025] The present application provides a method, device, equipment and medium for automatic partitioning of a desktop operating system, which obtains the original ISO image file of the operating system, installs a cloud initialization program in the original ISO image file, and creates a cloud initialization configuration file containing an automatic partitioning scheme for the cloud initialization program; regenerates a modified ISO image file containing a cloud initialization program and a cloud initialization configuration file; uses the modified ISO image file to create a virtual machine, and after starting the virtual machine, reads the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the operating system. Thus, after the user creates a desktop virtual machine and enters the operating system, automatic disk partitioning is achieved without manually inputting instructions for partition settings. It can help users quickly create the required partitions, and can be adjusted according to user needs, greatly improving the ease of use of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 This is a flowchart of a method for automatically partitioning a desktop operating system in one embodiment of the present application;

[0028] Figure 2 A schematic diagram of a process for creating a cloud initialization configuration file containing a configuration file for specifying an automatic partitioning scheme as described in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of an original partition list of a virtual machine system disk in an embodiment of the present application;

[0030] Figure 4This is a schematic diagram of a modified virtual machine system disk partition list in an embodiment of the present application;

[0031] Figure 5 A structural block diagram of an automatic partitioning device for a desktop operating system in one embodiment of the present application;

[0032] Figure 6 A structural block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0033] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0034] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0035] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0036] In view of the defects of the background technology, the present application provides a method, device, apparatus, equipment and medium for automatic partitioning of a desktop operating system, which can realize automatic disk partitioning after the user creates a desktop virtual machine and enters the operating system, thereby improving the usability of the operating system.

[0037] In one embodiment, see the attached specification Figure 1 , a method for automatically partitioning a desktop operating system, the method comprising the following steps:

[0038] S1. Obtain an original ISO image file of a desktop operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program;

[0039] S2. Regenerate a modified ISO image file containing the cloud initialization program and cloud initialization configuration files;

[0040] S3. Create a virtual machine using the modified ISO image file, and after starting the virtual machine, read the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the desktop version of the operating system.

[0041] Specifically, in step S1, the original ISO image file of the desktop operating system can be obtained in the virt-box or vmware virtualization software, wherein the VirtualBox is an open source virtualization software that allows users to run multiple different operating systems on a physical computer at the same time, and these operating systems exist in the form of virtual machines; the vmware is a set of commercial virtualization solutions, including multiple products, such as VMware Workstation (mainly for individuals and developers), VMware vSphere (server virtualization for enterprise data centers), etc. It can also create multiple virtual machines on a physical computer, allowing each virtual machine to run an independent operating system. How to obtain the original ISO image file of the desktop operating system through virt-box or vmware should be a technical means well known to those skilled in the art, and will not be elaborated here.

[0042] The key point is that in this application, the automatic partitioning of the desktop operating system is realized by installing a cloud initialization program in the obtained original ISO image file. Specifically, a script executed when the virtual machine is started is set in the cloud initialization program, and the partitioning logic is added to the script. After the virtual machine is started, automatic partitioning and automatic expansion of the root directory can be automatically realized.

[0043] In one embodiment, when installing the cloud initialization program in the original ISO image file, the original ISO image file can be copied to a local working directory for modification. First, it is necessary to obtain the cloud initialization program (cloud-init software package) suitable for the desktop operating system from a reliable software source, and ensure that the version of the software package is compatible with the desktop operating system; then add the downloaded cloud initialization program (cloud-init software package) to the appropriate location of the copied original ISO image file, generally in the software package installation directory or the directory where the system initialization script is located. For example, create a new directory / tmp / kylin-work / packages in the working directory and put the cloud-init software package into it.

[0044] After installing the cloud initialization program in the original ISO image file, you also need to create a cloud initialization configuration file to specify the automatic partitioning scheme. Figure 2 , create a cloud initialization configuration file that specifies the automatic partitioning scheme as follows, including the following steps:

[0045] S101, setting the script content of the automatic partitioning scheme, and placing the script in a designated directory of the desktop version operating system;

[0046] S102: Setting the script in the specified directory of the desktop version operating system to have executable permissions, and executing the script in the specified directory of the desktop version operating system.

[0047] In one embodiment, a file is added to the cloud initialization configuration file ( / etc / cloud / cloud.cfg.d) of the cloud initialization program, containing the following content:

[0048] bootcmd:

[0049] [chmod,+x, / home / grow_part.sh]

[0050] [ / home / grow_part.sh]

[0051] The role of Bootcmd (startup command) in the cloud initialization program is to execute the shell statement in bootcmd every time the operating system starts. The two lines of code executed here express that the grow_part.sh script in the / home / directory of the operating system is first granted executable permissions, and then the grow_part.sh script is executed. Specifically, the first statement "[chmod,+x, / home / grow_part.sh]" uses the chmod (change mode) command to set the permissions of the script file " / home / grow_part.sh" to executable. The "+x" parameter explicitly indicates to add execution permissions. This is done to ensure that the script file can be run later; the second statement "[ / home / grow_part.sh]" directly executes the "grow_part.sh" script file located in the " / home" directory.

[0052] In one embodiment, add the grow_part.sh script to the server / home directory, and the script content is as follows:

[0053] fdisk / dev / vda< <EOF

[0054] d 4

[0056] n 4

[0058] w

[0059] EOF

[0060] resize2fs / dev / vda4

[0061] The specific content of the script means that "fdisk / dev / vda << EOF" indicates operating on the / dev / vda disk device using the fdisk tool (partition editor), and the subsequent commands are input in the form of "here-document" (<< EOF). "Here-document" allows a series of commands to be passed as standard input to the previous command (here it is fdisk); "d" represents an operation option in the fdisk command, meaning "delete", and here it will delete a partition; the number 4 indicates that the partition number to be deleted is 4, that is, delete the / dev / vda4 partition; "n" means "new", used to create a new partition on the disk; 4 indicates that the newly created partition number is 4, that is, create a new / dev / vda4 partition; "w" means "write", saving the modification of the partition table to the disk and exiting the fdisk program; "resize2fs / dev / vda" means that after creating or modifying the partition, use the resize2fs tool to adjust the size of the ext4 file system (resize2fs is mainly used for ext file systems) on the / dev / vda4 partition. This step is usually carried out after the partition size has changed (such as by changing the partition boundary through fdisk operations) to enable the file system to utilize the new partition size. That is, first delete the / dev / vda4 partition, then recreate the partition, and finally adjust the size of the ext4 file system on the partition to adapt to the new partition space.

[0062] In step S2, the xorriso or genisoimage mirror generation tool can be used and the distributed object storage block device rbd command can be adopted to regenerate the modified ISO mirror file containing the cloud initialization program and the cloud initialization configuration file. Among them, xorriso is an exclusive-or optical disc image making tool, which is a powerful command-line tool for creating, editing, and extracting optical disc image files (such as ISO, UDF, etc.); genisoimage is an optical disc image generation tool, which is mainly used to generate optical disc image files in the ISO 9660 format. And how to regenerate the modified ISO mirror file containing the cloud initialization program and the cloud initialization configuration file through the xorriso or genisoimage mirror generation tool and by adopting the distributed object storage block device rbd command should be well-known technical means to those skilled in the art and will not be elaborated here.

[0063] In step S3, a virtual machine can be created in a virtual machine software (such as VMware, VirtualBox, etc.) using the regenerated modified ISO image file containing the cloud initialization program and the cloud initialization configuration file. After the virtual machine is started, the cloud initialization program will read the cloud initialization configuration file and automatically perform disk partitioning during the operating system installation process, dividing the disk space according to the scheme specified in the cloud initialization configuration file.

[0064] In one embodiment, the original partition list of a virtual machine system disk is as shown in the attached manual. Figure 3 As shown, you can see that the disk where the system is located has a total of 50G, but only 25G is allocated to / , and the rest of the storage is not used; the modified virtual machine system disk partition list is as attached to the manual Figure 4 As shown, you can see that the available space changes from 25G to 47G.

[0065] In addition, it should be noted that after installing the desktop operating system, you can check the disk partition status (such as using the fdisk-l command) to verify whether the automatic partitioning is successful. The fdisk-l is a command for viewing the system disk partition information, which will display the detailed partition status of all disk devices in the system, including the disk device name, partition number, partition start and end position, partition size, partition type (such as Linux, Linux swap, etc.) and other information. If the automatic partitioning is found to be unsuccessful through comparison, you can find the error information related to the disk partition through the system log, such as the error report of the fdisk tool (partition editor), which may display information such as "Cannot create a partition because of insufficient disk space" or "Partition table is damaged"; or check whether the disk device is faulty, for example, by checking the SMART information of the disk (using the smartctl tool) to check the health of the disk; or determine whether the automatic partitioning scheme in the cloud initialization configuration file is reasonable, for example, if the total disk size is 100G, the total partition size set in the configuration file cannot exceed 100G.

[0066] It can be seen that the automatic partitioning method of the desktop operating system provided by the present application can realize automatic disk partitioning after the user creates a desktop virtual machine and enters the operating system, without the need for manual input of instructions for partition setting. It can help users quickly create the required partitions and can be adjusted according to user needs, greatly improving the usability of the system.

[0067] Based on the same inventive concept, an automatic partitioning device for a desktop operating system is also provided in an embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the automatic partitioning method for a desktop operating system in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0068] As the instruction manual Figure 5 As shown, in one embodiment, the present application provides a desktop operating system automatic partitioning device, the device comprising:

[0069] A creation module 501 is used to obtain an original ISO image file of a desktop operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program;

[0070] A generating module 502 is used to regenerate a modified ISO image file including a cloud initialization program and a cloud initialization configuration file;

[0071] The partition module 503 is used to create a virtual machine using the modified ISO image file, and after starting the virtual machine, read the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the desktop version operating system.

[0072] In a possible implementation, the creation module 501 creates a cloud initialization configuration file for specifying an automatic partitioning scheme, including: setting the script content of the automatic partitioning scheme, and placing the script in a specified directory of the desktop operating system; setting the script in the specified directory of the desktop operating system to executable permissions, and executing the script in the specified directory of the desktop operating system. Among them, a startup command is used to set the script in the specified directory of the desktop operating system to executable permissions, and execute the script in the specified directory of the desktop operating system.

[0073] In a possible implementation, the creation module 501 sets the script content of the automatic partitioning scheme, including: using a partition editor to operate a disk device; deleting a partition, recreating the partition, and adjusting the size of the file system on the partition.

[0074] In a possible implementation, the generation module 502 regenerates a modified ISO image file including a cloud initialization program and cloud initialization configuration files by using an image generation tool and a distributed object storage block device rbd command.

[0075] In a possible implementation, the device further includes:

[0076] The verification module is used to check the disk partition status after installing the desktop operating system to verify whether the automatic partitioning is successful. If the automatic partitioning verification fails, check whether the disk device is faulty; or find error information related to the disk partition based on the system log; or determine whether the automatic partitioning scheme in the cloud initialization configuration file is reasonable.

[0077] It can be seen that the present application provides an automatic partitioning device for a desktop operating system, which obtains the original ISO image file of the operating system through a creation module, installs a cloud initialization program in the original ISO image file, and creates a cloud initialization configuration file containing an automatic partitioning scheme for the cloud initialization program; regenerates a modified ISO image file containing a cloud initialization program and a cloud initialization configuration file through a generation module; creates a virtual machine using the modified ISO image file through a partitioning module, and after starting the virtual machine, reads the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the operating system. Thus, after the user creates a desktop virtual machine and enters the operating system, automatic disk partitioning is achieved without manually inputting instructions for partition settings. It can help users quickly create the required partitions, and can be adjusted according to user needs, greatly improving the ease of use of the system.

[0078] Based on the same concept of the present invention, the specification is attached Figure 6 As shown, the structure of an electronic device 600 provided in an embodiment of the present application includes: at least one processor 601, at least one network interface 604 or other user interface 603, a memory 605, and at least one communication bus 602. The communication bus 602 is used to realize the connection and communication between these components. The electronic device 600 optionally includes a user interface 603, including a display (for example, a touch screen, LCD, CRT, holographic imaging (Holographic) or projection (Projector), etc.), a keyboard or a pointing device (for example, a mouse, a trackball (trackball), a touch pad or a touch screen, etc.).

[0079] The memory 605 may include a read-only memory and a random access memory, and provides instructions and data to the processor 601. A portion of the memory 605 may also include a non-volatile random access memory (NVRAM).

[0080] In some implementations, the memory 605 stores the following elements, which may be protection modules or data structures, or subsets thereof, or extended sets thereof:

[0081] Desktop operating system 6051, including various system programs for implementing various basic services and processing hardware-based tasks;

[0082] The application module 6052 includes various application programs, such as a launcher, a media player, a browser, etc., which are used to implement various application services.

[0083] In an embodiment of the present application, by calling the program or instructions stored in the memory 605, the processor 601 is used to execute steps in a method for automatic partitioning of a desktop operating system, which can realize automatic disk partitioning after the user creates a desktop virtual machine and enters the operating system, thereby improving the usability of the operating system.

[0084] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the automatic partitioning method for a desktop operating system are executed.

[0085] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the above-mentioned desktop operating system automatic partitioning method can be executed.

[0086] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0087] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0088] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0089] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0090] Finally, it should be noted that the above embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for automatically partitioning a desktop operating system, characterized in that: The method comprises the following steps: Obtain an original ISO image file of a desktop operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program; Regenerate the modified ISO image file containing the cloud initialization program and cloud initialization configuration files; A virtual machine is created using the modified ISO image file, and after the virtual machine is started, the cloud initialization configuration file is read by the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the desktop version operating system.

2. According to claim 1, a method for automatically partitioning a desktop operating system, characterized in that: Create a cloud-init configuration file that specifies the automatic partitioning scheme by following these steps: Set the script content of the automatic partitioning scheme and place the script in the specified directory of the desktop operating system; Set the script in the specified directory of the desktop operating system to executable permissions, and execute the script in the specified directory of the desktop operating system.

3. According to claim 2, a method for automatically partitioning a desktop operating system, characterized in that: in, The startup command is used to set the script in the specified directory of the desktop operating system to executable permission, and the script in the specified directory of the desktop operating system is executed.

4. According to claim 3, a method for automatically partitioning a desktop operating system is characterized in that: The script content for setting the automatic partitioning scheme is as follows, including the following steps: Use the partition editor to operate disk devices; Delete a partition, recreate it, and resize the file system on the partition.

5. According to claim 4, a method for automatically partitioning a desktop operating system is characterized in that: in, Use the image generation tool and the distributed object storage block device rbd command to regenerate the modified ISO image file that contains the cloud initialization program and cloud initialization configuration files.

6. According to claim 5, a method for automatically partitioning a desktop operating system is characterized in that: The method further comprises the following steps: After installing the desktop operating system, check the disk partition status to verify whether the automatic partitioning is successful.

7. A method for automatically partitioning a desktop operating system according to claim 6, characterized in that: in, If the verification of automatic partitioning fails, check whether the disk device is faulty; or search for error information related to disk partitioning based on the system log; or determine whether the automatic partitioning scheme in the cloud initialization configuration file is reasonable.

8. An automatic partitioning device for a desktop operating system, characterized in that: The device comprises: A creation module is used to obtain an original ISO image file of a desktop operating system, install a cloud initialization program in the original ISO image file, and create a cloud initialization configuration file including an automatic partitioning scheme for the cloud initialization program; A generation module is used to regenerate a modified ISO image file containing the cloud initialization program and cloud initialization configuration files; The partition module is used to create a virtual machine using the modified ISO image file, and after starting the virtual machine, read the cloud initialization configuration file through the cloud initialization program to perform disk partitioning operations according to the automatic partitioning scheme during the installation of the desktop version operating system.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, the steps of the method for automatic partitioning of a desktop operating system as described in any one of claims 1 to 7 are executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for automatically partitioning a desktop operating system as described in any one of claims 1 to 7.