Method for dynamically expanding partition of operating system
By retrieving, identifying and combining storage device units in the operating system, forming large-capacity storage and superimposing it onto the operating system partition, the problem of idle storage devices being unable to be utilized is solved, and dynamic expansion and stability improvement of operating system partitions are achieved.
Patent Information
- Application Number
- CN202510553826.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-04-29
AI Technical Summary
Idle small-capacity storage devices cannot be used again, and the operating system partition capacity is limited. It requires replacement of large-capacity hard disks to expand space, resulting in complex workload and time wasted.
By searching the available storage device units in the operating system, assigning combined identification information and encrypting, linearly combining to form large-capacity storage, superimposing it to the operating system partition, and using a joint file system to protect data integrity.
The secondary utilization of idle small-capacity storage is realized, and the operating system partition capacity is dynamically expanded, which reduces the complexity and time cost of hard disk replacement, and improves storage space utilization and system stability.
Smart Images

Figure CN120469638A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to a method for dynamically expanding an operating system partition. Background Art
[0002] With the development of social science and technology, the continuous iteration and increase of software functions have led to an increasing amount of software space occupation. For example, the office software that everyone is familiar with has increased from a few hundred megabytes more than ten years ago, to one or two gigabytes a few years ago, to several gigabytes now, and even the full-featured version has exceeded ten gigabytes.
[0003] With the enrichment of software functions and the continuous accumulation of digital data, the demand for storage space is getting higher and higher. In order to meet the relevant needs, more and more large-capacity storage is purchased. At the same time, the cost is also increasing. More and more small-capacity storage is being idle, and storage devices are fragmented and may eventually be wasted. Especially for large files, they cannot be reused due to limited storage space.
[0004] Large storage space requirements make replacing an expandable hard drive easy, but operating system partitions present a more complex task. Typically, system software can only run properly if installed in the operating system partition. Due to the limited capacity of the operating system partition, the only option to ensure proper operation of system software (including the operating system) is to replace it with a new, larger hard drive. This process also involves reinstalling the operating system and copying data, adding significant complexity and time. Summary of the Invention
[0005] In order to solve the technical problems of "idle, fragmented, small-capacity storage that cannot be reused; and the limited capacity of the operating system partition, which requires replacing a large-capacity hard disk to increase the space capacity of the operating system partition", the present invention provides the following technical solutions:
[0006] A method for dynamically expanding an operating system partition, comprising:
[0007] S1. Retrieve the available storage device unit in the operating system;
[0008] S2. From the available storage device units retrieved, select multiple storage device units to be combined for storage capacity, and assign combination identification information to each storage device unit selected for combination;
[0009] S3. Based on the combination identification information of the selected multiple storage device units, the multiple storage device units to be combined are selected one by one to be identified, the storage device units are combined after identification to obtain a large-capacity storage after the combination;
[0010] S4. The combined large capacity is stored in the operating system partition.
[0011] Furthermore, in step S3, the multiple storage device units to be combined are selected and identified one by one, wherein the identification method is to encrypt the combination identification information of each storage device unit and write the encrypted combination identification information into the location of storage block 0 of the corresponding storage device unit.
[0012] Furthermore, the combined identification information includes the time of adding to the mass storage, the location in the mass storage, the host device UUID, and the capacity of the current storage device unit added to the mass storage.
[0013] Furthermore, the combined identification information of each storage device unit is encrypted, wherein the encryption method is to use the hardware information of the host unit as the encryption key and the combined identification information as the content to be encrypted.
[0014] Furthermore, in step S3, the identified storage device units are combined, wherein the combination method adopts a stored linear combination.
[0015] Furthermore, in step S4, the combined large-capacity storage is superimposed on the operating system partition. The superimposition method adopts the method of directly appending the combined large-capacity storage to the operating system partition in the form of a linear combination of storage.
[0016] Furthermore, in step S4, a method for superimposing the combined large-capacity storage onto the operating system partition is adopted. The superimposition method adopts a joint file system, and uses the operating system partition as a read-only basic data partition, and the operating system partition as the lower layer; uses the combined large-capacity storage as a read-write layer, and the large-capacity storage as the upper layer; and maps all files on the operating system partition to the large-capacity storage one by one.
[0017] Compared with the prior art, the present invention has the following beneficial effects:
[0018] The present invention selects multiple storage device units for storage capacity combination, identifies and combines them, obtains a combined large-capacity storage, and superimposes the combined large-capacity storage onto the operating system partition. This allows N small-capacity storage device units to accumulate storage space capacity and ultimately combine them into a large-capacity storage, thus achieving secondary utilization of idle, fragmented small-capacity storage.
[0019] The synthesized large-capacity storage is associated with the operating system partition, so that the operating system partition can be dynamically expanded and the space capacity of the operating system partition can be increased without replacing the hard disk with a large capacity under the limited operating system partition capacity. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 The present invention is a flowchart of a method for dynamically expanding operating system partitions. DETAILED DESCRIPTION
[0021] The technical solution of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are not all embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0022] Glossary:
[0023] Mass storage: Combine multiple hard drives or USB flash drives into a single mass storage device. For example, a 1GB USB flash drive + an 8GB hard drive can be combined into a 9GB mass storage device.
[0024] Storage device unit: N storage hard disks or USB flash drives combined into a large-capacity storage are called a storage device unit; N = 1, 2, 3, ...
[0025] Example 1
[0026] like Figure 1 As shown, the present invention provides a method for dynamically expanding an operating system partition, comprising:
[0027] S1. Retrieve the available storage device unit in the operating system;
[0028] Find all connected storage devices in the operating system.
[0029] S2. Select a storage device unit to store large-capacity storage;
[0030] Summarize all available storage device units in the operating system retrieved in step S1, and then select multiple storage device units to be subjected to a storage capacity combination operation;
[0031] Each selected storage device unit is assigned combination identification information, and the combination identification information of each storage device unit is used as an identification for adding to a large-capacity storage. The large-capacity storage refers to a large-capacity storage composed of N storage device units.
[0032] S3 multiple storage device units are identified in accordance with the combination of identification information of each storage device unit, forming a large-capacity storage;
[0033] S31. The storage device units selected in step S2 are identified one by one;
[0034] Specifically, the storage device units are identified one by one, and the identification method adopted is: encrypting the combined identification information of each storage device unit, and writing the encrypted combined identification information into the location of the storage block 0 of the corresponding storage device unit.
[0035] To ensure both the security of identification information and the unique usability of storage device units, the combined identification information of each storage device unit is encrypted. The encryption method used uses the host unit hardware information as the encryption key, and the combined identification information as the encrypted content. The final encrypted content is then written to the storage unit's memory block 0. The encryption key primarily consists of the host device's unchangeable hardware information, such as the host serial number and CPU serial number.
[0036] By encrypting the combined identification information of the storage device unit, the security of the combined identification information of each storage device unit can be protected, preventing subsequent modification attempts to tamper with the combined identification information of the storage device unit, which would render the combined identification information of this storage device unit invalid and unable to be used normally, resulting in loss of user data.
[0037] The combined identification information includes: the time of adding the mass storage, the location in the mass storage, the host device UUID, the capacity of the current storage device unit added to the mass storage, etc.
[0038] The combination identification information includes the "time of adding the large-capacity storage" to take into account the different times of combining different storage device units, which facilitates subsequent tracing.
[0039] The combination identification information includes the "location in the mass storage" in order to ensure the correctness of the storage device unit combination order. Different storage device units will be assigned an increasing unique serial number (abbreviated as: storage device unit serial number). No matter how the access order of the storage device units or the access hardware positions are adjusted later, as long as the storage device unit serial number is obtained, the storage device unit serial number can be used to perform the correct combination and sorting to obtain the final correct combination.
[0040] The combination identification information includes the "host device UUID" to ensure that the current storage device unit is valid for the current host device during the combination process, avoiding the damage and loss of user data by connecting the combined storage device unit of other host devices to different host devices. A UUID (Universally Unique Identifier) is a 128-bit identifier. In host devices, UUID is often used to identify hardware, operating systems, or virtualization instances to ensure global uniqueness.
[0041] The combination identification information includes the "capacity of the current storage device unit added to the mass storage." This applies to a single storage device unit. Users may wish to retain their previous data while also combining some of the free storage space for mass storage. In this case, it is necessary to identify the mass storage usage of the storage device unit to enhance its versatility. If, later on, the user wishes to use all of the multi-purpose storage for mass storage, they can simply update the mass storage information for the current storage device unit.
[0042] S32 step S31 after the identification operation of the storage device unit is combined to form a large-capacity storage;
[0043] The combination method mainly uses linear combination of storage. Linear combination of storage means that after the space of a single storage device unit is fully used, the space of the next storage device unit will be used, thereby improving the efficient use of the single unit space. At the same time, if a storage device unit is damaged later, it can reduce user data loss.
[0044] S4. The combined large capacity is stored in the operating system partition;
[0045] The superposition method adopts the same storage device unit combination method as in step S3, and directly appends the large-capacity storage formed by the combination to the operating system partition in a linear combination manner.
[0046] This method can maximize the storage space utilization of the operating system partition. However, if problems arise during the use of the operating system and it cannot be used normally, the operating system will need to be reinstalled.
[0047] After the above operations, the dynamic expansion of the operating system partition can be completed.
[0048] Example 2
[0049] The present invention provides a method for dynamically expanding an operating system partition. Based on Example 1, this embodiment differs from the first embodiment in that a superposition method employs a joint file system, treating the operating system partition as a read-only base data partition (referred to as the lower layer) and the combined bulk storage as a read-write layer. All files on the operating system partition are mapped one-to-one to the bulk storage (referred to as the upper layer). After the mapping is complete, operations on files in the lower layer are performed through file operations on the upper layer, including file reading, file addition, file modification, and file deletion.
[0050] File reading: If there is a file with the same name in the same path directory in the upper layer, the corresponding file in the upper layer is read directly. If there is no file with the same name in the same path directory in the upper layer, the file mapped to the upper layer in the lower layer is read;
[0051] New file added: Unification is completed in the upper layer;
[0052] File modification: The file in the lower layer will be copied to the upper layer (called a copy), and then the copy of the upper layer file will be modified;
[0053] File deletion: If there is a file with the same name in the same path directory in the upper layer, the file in the upper layer will be deleted first. If there is a file with the same name in the same path directory in the lower layer, the corresponding file in the lower layer will be hidden and invisible to the user.
[0054] All of the above operations are performed on mass storage. The underlying operating system partition data can be considered shadow data and is read-only. Data corruption often occurs during write operations. If a write operation is interrupted unexpectedly and the data is not fully written or updated, data loss or corruption will occur, especially in the operating system partition, which can easily cause the operating system to become inoperable.
[0055] By using a joint file system, the operating system partition is treated as a read-only partition. All file system operations only occur in the upper-level large-capacity storage. This can minimize the possibility of damage to the operating system partition and greatly improve the stability and reliability of the operating system partition.
[0056] With this method, if there is a problem with the operating system during later use and it cannot be used normally, you only need to clear the data in the combined large-capacity storage to restore the operating system to the state at the time of installation, and you cannot reinstall the operating system.
[0057] After the above operations, the dynamic expansion of the operating system partition can be completed.
[0058] The above technical features constitute the best embodiment of the present invention, which has strong adaptability and best implementation effect. Non-essential technical features can be added or removed according to actual needs to meet the needs of different situations.
[0059] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions of the technical solution of the present invention by ordinary technicians in this field do not deviate from the essence and scope of the technical solution of the present invention.
Claims
1. A method for dynamically expanding an operating system partition, characterized in that: include: S1. Retrieve the available storage device unit in the operating system; S2. From the available storage device units retrieved, select multiple storage device units to be combined for storage capacity, and assign combination identification information to each storage device unit selected for combination; S3. Based on the combination identification information of the selected multiple storage device units, the multiple storage device units to be combined are selected one by one to be identified, the storage device units are combined after identification to obtain a large-capacity storage after the combination; S4. The combined large capacity is stored in the operating system partition.
2. The method for dynamically expanding an operating system partition according to claim 1, wherein: In step S3, the multiple storage device units to be combined are selected and identified one by one, wherein the identification method is to encrypt the combination identification information of each storage device unit and write the encrypted combination identification information into the storage block 0 position of the corresponding storage device unit.
3. The method for dynamically expanding an operating system partition according to claim 1, wherein: The combined identification information includes the time of adding to the mass storage, the location in the mass storage, the host device UUID, and the capacity of the current storage device unit added to the mass storage.
4. The method for dynamically expanding an operating system partition according to claim 2, wherein: The combined identification information of each storage device unit is encrypted, wherein the encryption method is to use the host unit hardware information as the encryption key and the combined identification information as the content to be encrypted.
5. The method for dynamically expanding operating system partitions according to claim 1, wherein: In step S3, the identified storage device units are combined, wherein the combination method adopts a linear combination of storage.
6. The method for dynamically expanding operating system partitions according to claim 1, wherein: In step S4, the combined large-capacity storage is superimposed on the operating system partition. The superimposition method adopts the method of directly appending the combined large-capacity storage to the operating system partition in the form of a linear combination of storage.
7. The method for dynamically expanding an operating system partition according to claim 1, wherein: In step S4, a method for overlaying the combined large-capacity storage onto the operating system partition is used. The overlay method adopts a joint file system, and the operating system partition is used as a read-only basic data partition, and the operating system partition is used as the lower layer; the combined large-capacity storage is used as a read-write layer, and the large-capacity storage is used as the upper layer; all files on the operating system partition are mapped one by one to the large-capacity storage.
Citation Information
Patent Citations
Method for establishing redundant magnetic disk array and control device thereof
CN101221485A
Memory card changer, method for reading or writing data in memory card changer
CN101849242A
System for integrating storage capacity
CN102103466A
Multi-disk aggregated data storage system and implementation method and application method thereof
CN107346209A
Storage system hard disk expansion realization method
CN107562377A
