CN113126893B - Method, device, storage medium and computer equipment for expanding system partition - Google Patents

Method, device, storage medium and computer equipment for expanding system partition Download PDF

Info

Publication number
CN113126893B
CN113126893B CN202010048638.8A CN202010048638A CN113126893B CN 113126893 B CN113126893 B CN 113126893B CN 202010048638 A CN202010048638 A CN 202010048638A CN 113126893 B CN113126893 B CN 113126893B
Authority
CN
China
Prior art keywords
image file
directory
preset
preset data
user data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010048638.8A
Other languages
Chinese (zh)
Other versions
CN113126893A (en
Inventor
肖骞
聂佳楠
李华斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oneplus Technology Shenzhen Co Ltd
Original Assignee
Oneplus Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oneplus Technology Shenzhen Co Ltd filed Critical Oneplus Technology Shenzhen Co Ltd
Priority to CN202010048638.8A priority Critical patent/CN113126893B/en
Priority to PCT/CN2021/072154 priority patent/WO2021143845A1/en
Publication of CN113126893A publication Critical patent/CN113126893A/en
Application granted granted Critical
Publication of CN113126893B publication Critical patent/CN113126893B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present application relates to a method, apparatus, computer readable storage medium and computer device for expanding a system partition, the method comprising: after the user data mirror image file is mounted to a first user data directory, acquiring a preset data mirror image file under the first user data directory; and mounting the preset data image file to a preset directory under a system directory so as to enable a processor to access data in the preset data image file. The method reduces the space occupation of the system directory and the space occupation of the system partition.

Description

Method, device, storage medium and computer equipment for expanding system partition
Technical Field
The present invention relates to the field of computer technology, and in particular, to a method, an apparatus, a computer readable storage medium, and a computer device for expanding a system partition.
Background
In the early development stage of a mobile device, an operating system of a conventional mobile device, such as an Android system, a Linux system, and the like, sets a partition table, and the partition table is used for partitioning a disk of the system. Each partition is used to store data of a different attribute, such as the system partition may be used to store system files, such as user interface data, system-resident software, and the like. Once the partition table is applied, the space size of each partition is fixed, and is difficult to change at a later stage.
However, as preset resources are continuously updated, the space of the system partition is insufficient.
Disclosure of Invention
Based on this, it is necessary to provide a method, an apparatus, a computer-readable storage medium, and a computer device for expanding a system partition, in response to the problem of insufficient space of the conventional system partition.
A method of expanding a system partition, the method comprising:
after the user data mirror image file is mounted to a first user data directory, acquiring a preset data mirror image file under the first user data directory;
and mounting the preset data image file to a preset directory under a system directory so as to enable a processor to access data in the preset data image file.
In one embodiment, the mounting the preset data image file to a preset directory under a system directory includes:
mounting the preset data image file to an intermediate directory, wherein the intermediate directory is empty;
and mapping the intermediate directory containing the preset data mirror image file to the preset directory.
In one embodiment, the mapping the intermediate directory containing the preset data image file to the preset directory includes:
and taking the intermediate directory containing the preset data image file as a subdirectory under the preset directory so as to map the intermediate directory to the preset directory.
In one embodiment, the method for obtaining the user data image file includes:
compiling preset data source codes to a preset data catalog;
packaging the preset data catalogue to obtain the preset data mirror image file;
moving the preset data image file to a second user data directory;
and packaging the second user data directory to obtain the user data mirror image file.
In one embodiment, the method further comprises:
acquiring a preset data image file to be upgraded, wherein the preset data image file to be upgraded is positioned in an over-the-air download software package, and the preset data image file to be upgraded is used for updating the preset data image file in the first user data directory.
In one embodiment, the method further comprises:
acquiring a factory setting restoration type;
when the factory setting recovery type is the first type, acquiring the identification of the preset data image file, and adding the identification of the preset data image file into a white list;
and when the factory setting recovery type is the second type, backing up the preset data mirror image file so as to restore the preset data mirror image file after the factory setting recovery is completed.
In one embodiment, the backing up the preset data image file includes:
and extracting the preset data mirror image file from the first user data directory, and storing the preset data mirror image file into a virtual memory file.
An apparatus for expanding a system partition, the apparatus comprising:
the acquisition module is used for acquiring a preset data mirror image file under the first user data directory after the user data mirror image file is mounted to the first user data directory;
and the mounting module is used for mounting the preset data image file to a preset directory under a system directory so as to enable the processor to access the data in the preset data image file.
A computer-readable storage medium having stored thereon computer-executable instructions for execution by a processor to perform the steps of a method of expanding a system partition:
after the user data mirror image file is mounted to a first user data directory, acquiring a preset data mirror image file under the first user data directory;
and mounting the preset data image file to a preset directory under a system directory so as to enable a processor to access data in the preset data image file.
A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that are executed by the processor to perform the steps of a method of expanding a system partition comprising:
after the user data mirror image file is mounted to a first user data directory, acquiring a preset data mirror image file under the first user data directory;
and mounting the preset data image file to a preset directory under a system directory so as to enable a processor to access data in the preset data image file.
According to the method, the device, the computer readable storage medium and the computer equipment for expanding the system partition, after the user data mirror image file is mounted to the first user data directory, the preset data mirror image file under the first user data directory is obtained, and the preset data mirror image file is mounted to the preset directory under the system directory so that the processor can access data in the preset data mirror image file. The preset data source codes are compiled and packaged into preset data mirror image files, the preset data mirror image files are burnt to the user data partitions of the magnetic disk along with the user data mirror image files, and when the mobile terminal is started, the preset data mirror image files in the user data mirror image files are mounted to the system catalog, so that the occupation of the space of the system catalog to the space of the system partitions is reduced.
Drawings
FIG. 1 is an internal block diagram of a terminal for implementing a method of expanding system partitions in one embodiment;
FIG. 2 is a flow diagram of a method of expanding system partitions in one embodiment;
FIG. 3 is a schematic diagram of an application environment for an upgrade operation in one embodiment;
FIG. 4 is a schematic diagram of an application environment for restoring factory set operations in one embodiment;
FIG. 5 is a schematic diagram of an application environment of a method of expanding system partitions in one embodiment;
FIG. 6 is a block diagram of an apparatus for expanding system partitions in one embodiment;
fig. 7 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
FIG. 1 is an application environment diagram of a method of expanding system partitions in one embodiment. The terminal 110 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. After the user data image file is mounted to the first user data directory, the terminal 110 obtains the preset data image file under the first user data directory. Then, the terminal 110 mounts the preset data image file to a preset directory under a system directory, so that the processor can access the data in the preset data image file.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the terminal to which the present application is applied, and that a particular terminal may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
As shown in FIG. 2, in one embodiment, a method of expanding a system partition is provided.
Referring to fig. 2, the method for expanding the system partition specifically includes the following steps:
s202, after the user data mirror image file is mounted to a first user data directory, acquiring a preset data mirror image file under the first user data directory.
The preset data refer to software, multimedia files and the like of the system. In the operating system of a mobile terminal, the disk is typically divided into a plurality of partitions, such as a system partition, a user data partition, and the like. The system partition may be used to store system files, such as interface data, preset data, etc. The user data partition may be used to store user data-third party software that the user installs autonomously, multimedia files authored by the user, downloaded, etc.
The image file may be used to describe a partition of the disk, for example, the system image file may be used to describe a system partition of the disk, and the system image file may be burned into the system partition of the disk; the user data image file may be used to describe a user data partition of the disk, and the user data image file may be burned into the user data partition of the disk.
In a conventional mobile terminal, a preset data source code is generally packaged into a system image file, and the system image file is burnt into a system partition of a disk, and the space of the system partition is increasingly tensed along with continuous updating of preset data. In this embodiment, the preset data source code is compiled and packaged into the preset data image file, the preset data image file is burned to the user data partition of the disk along with the user data image file, and when the mobile terminal is started, the preset data image file in the user data image file is mounted to the system directory, and because the space of the user data partition is far greater than that of the system partition, the problem of insufficient space of the system partition can be relieved.
The data of the partition of the disk cannot be directly accessed by the processor, and needs to be mounted to a mounting point to be accessed by the processor. Mounting means that the data of the partition of the disk is placed under the directory by using the directory as an entry point, and the processor can access the partition by entering the directory.
The mount point may be a directory of the root file system, and mounting the data of the partition of the disk to the directory of the root file system, thereby associating the partition with the directory, and the processor accessing the partition is equivalent to accessing the partition whenever the processor accesses the directory. The root file system is the first file system installed when the kernel is started, the image file of the kernel code is stored in the root file system, and the system boot startup program loads some initialization scripts and services into the memory to run after the root file system is installed.
Specifically, the preset data source code may be compiled and packaged into a preset data image file, the preset data image file is moved to a second user data directory, the second user data directory is packaged to obtain a user data image file, and the user data image file is burned into a user data partition of the disk. The second user data directory is a directory used in compiling and packaging processes, and is mainly used for storing preset data mirror files and compiling files of user data, and the second user data directory can exist in the terminal.
And mounting the user data mirror image file in the user data partition to a first user data directory of the root file system, acquiring a preset data mirror image file under the first user data directory, and mounting the preset data mirror image file to a preset directory under a system directory of the root file system. The user data mirror image file is mounted to the first user data catalog, the processor can access the preset data mirror image file under the first user data catalog, the preset data mirror image file is mounted to the preset catalog, and the processor can access the data of the preset data mirror image file under the preset catalog. The first user data directory refers to a directory under the root file system, and is mainly used for mounting user data image files of the user data partition, which may exist in the mobile terminal.
S204, mounting the preset data mirror image file to a preset directory under a system directory for a processor to access data in the preset data mirror image file.
The system directory refers to a directory under the root file system, and is generally mainly used for mounting system image files of a system partition. In this embodiment, the preset data image file stored in the user data partition is also mounted to the preset directory under the system directory. The preset catalog refers to a subdirectory under the system catalog, is designed on the mount of the preset data mirror image file, and can be set according to practical application.
Specifically, the manner of mounting the preset data image file to the preset directory under the system directory may be: and mounting the preset data mirror image file to a preset directory under the system directory through mounting equipment. Wherein the mounting device is a dummy device that uses a file emulation block device to mount an image file. Optionally, the preset data mirror image file is firstly mounted to an empty intermediate directory through the mounting device, and then the intermediate directory containing the preset data mirror image file is mapped to the preset directory.
According to the method for expanding the system partition, after the user data mirror image file is mounted to the first user data directory, the preset data mirror image file under the first user data directory is obtained, and the preset data mirror image file is mounted to the preset directory under the system directory so that the processor can access data in the preset data mirror image file. In this way, the preset data source codes are compiled and packaged into preset data mirror image files, the preset data mirror image files are burnt to the user data partitions of the magnetic disk along with the user data mirror image files, and when the mobile terminal is started, the preset data mirror image files in the user data mirror image files are mounted to the system catalog, so that the occupation of the space of the system partitions is reduced.
In one embodiment, the mounting the preset data image file to a preset directory under a system directory includes: mounting the preset data image file to an intermediate directory, wherein the intermediate directory is empty; and mapping the intermediate directory containing the preset data mirror image file to the preset directory.
In this embodiment, if the image file of the preset data is directly mounted to the preset directory under the system directory by the mounting device, the data under the preset directory may be all covered. In this embodiment, the mounting device mounts the preset data image file to the empty intermediate directory, and then maps the intermediate directory containing the preset data image file to the preset directory, so as to avoid data loss under the system directory.
The mounting device may be Loop device or the like. The intermediate directory may be used to mount the preset data image file. The intermediate directory may be a subdirectory of any directory under the root file system, such as a subdirectory of a system directory.
The mode of mapping the intermediate directory containing the preset data mirror image file to the preset directory may be: and mapping the intermediate directory containing the preset data image file to the preset directory as a subdirectory under the preset directory. That is, the intermediate directory containing the preset data image file is used as a subdirectory under the preset directory, and the original subdirectory under the preset directory is not interfered. This process may be implemented in an overridyfs manner.
According to the method for expanding the system partition, the preset data mirror image file is firstly mounted to the intermediate directory, then the intermediate directory containing the preset data mirror image file is mapped to the preset directory, and the data in the preset directory is prevented from being completely covered by the preset data mirror image file.
In one embodiment, the mapping the intermediate directory containing the preset data image file to the preset directory includes: and taking the intermediate directory containing the preset data image file as a subdirectory under the preset directory so as to map the intermediate directory to the preset directory.
Specifically, a preset catalog is used as a mounting point, and after the intermediate catalog containing the preset data mirror image file is mounted to the mounting point, the intermediate catalog containing the preset data mirror image file and the original subdirectory under the preset catalog exist under the preset catalog.
The mapping from the intermediate directory to the preset directory can be realized in an overlay fs mode. The overlay fs is a stacked file system, which depends on and builds on other file systems, does not directly participate in the division of the space of the disk, and only "merges" different directories in the underlying file system.
According to the method for expanding the system partition, the intermediate directory containing the preset data mirror image file is used as a subdirectory under the preset directory and mapped to the preset directory, so that original data loss in the preset directory is avoided.
In one embodiment, the method for obtaining the user data image file includes: compiling preset data source codes to a preset data catalog; packaging the preset data catalogue to obtain the preset data mirror image file; moving the preset data image file to a second user data directory; and packaging the second user data directory to obtain the user data mirror image file.
The preset data catalogue is used for compiling and packaging, is used for storing preset data compiling files and can exist in the terminal; the preset data compiling file is obtained by compiling a preset data source code; the preset data mirror image file is obtained by packing a preset data catalog containing preset data compiling files, and the preset data mirror image file can be in an ext4 format.
First, the preset data source code is compiled into a preset data directory. Taking an Android system as an example, after the preset data source code is developed, the preset data source code can be compiled through a compiling system by combining with an android.mk file. The Android system is used for describing compiling information of the module, and the Android system completes the compiling process by integrating the Android mk file. The compiling system may comprise: lunch, m, mm, mmm, make, etc.
And then, after compiling the preset data source code to the preset resource catalog, packaging the preset data catalog to obtain the preset data mirror image file. The preset resource catalog can be packaged through the compiling system to obtain the preset data mirror image file.
And finally, moving the preset data mirror image file to a second user data directory, and packaging the second user data directory to obtain the user data mirror image file. Packaging the second user data catalog through a compiling system to obtain a user data mirror image file; alternatively, the user data image file may be generated by a pseudo-target userdataimage-nodes without any dependency, and when make userdataimage-nodes are executed, the function build-userdataimage-target is called to directly generate the userdata. Img file.
According to the method for expanding the system partition, the preset data source codes are compiled and packaged into the preset data mirror image file, the preset data mirror image file is burnt to the user data partition along with the user data mirror image file, and space occupation of the system partition is reduced.
In one embodiment, the method further comprises: acquiring a preset data image file to be upgraded, wherein the preset data image file to be upgraded is positioned in an over-the-air download software package, and the preset data image file to be upgraded is used for updating the preset data image file in the first user data directory.
Specifically, the preset data image file may be updated through an over-the-air technology. Over The Air (OTA) is a technique that enables remote management of mobile terminal devices over the air interface of mobile communications.
As shown in fig. 3, when upgrading the preset data image file, mounting the user data image file (Userdata. Img) to the first user data directory (Userdata directory) to obtain a preset data image file (reserve. Img); and updating the original preset data mirror image file in the first user data directory by using the preset data mirror image file to be updated, thereby completing the updating of the preset data mirror image file. During this update process, the preset data image file in the user data partition of the disk is also updated.
The method for expanding the system partition realizes the upgrading of the preset data, and the upgrading operation does not occupy the space of the system partition.
In one embodiment, the method further comprises: acquiring a factory setting restoration type; when the factory setting recovery type is the first type, acquiring the identification of the preset data image file, and adding the identification of the preset data image file into a white list; and when the factory setting recovery type is the second type, backing up the preset data mirror image file so as to restore the preset data mirror image file after the factory setting recovery is completed.
The identification of the preset data mirror image file is used for representing the identity information of the preset data mirror image file, such as the name of the preset data mirror image file.
Restoring factory settings refers to an operation that initializes a disk or partition in a disk that causes all files in the existing disk or partition to be purged. The factory setting restoration type can comprise a first type and a second type, wherein the first type is based on deletion of a file level, and files and directories of a third party application program package and the like installed by a user when not in factory are deleted; the second type refers to re-emptying the disk content, restoring the state when leaving the factory, and all user data can be cleared, including photos, videos, third party application packages installed by users, and the like.
For the first type, the identification of the preset data image file may be added to the white list, and when the operation of restoring the factory settings is performed, the data in the white list may not be cleared.
For the second type, as shown in fig. 4, user data image files (Userdata. Img) are mounted to a first user data directory (Userdata directory) to obtain preset data image files (reserve. Img); backing up preset data mirror image files; unloading the user data mirror image file after the backup is completed, and executing the factory setting restoration operation; and after the factory setting restoration operation is finished, the user data mirror image file is mounted to the first user data directory, and the backed-up preset data mirror image file is restored.
According to the method for expanding the system partition, when the operation of restoring the factory setting is executed, the preset data mirror image file is ensured not to be deleted.
In one embodiment, the backing up the preset data image file includes: and extracting the preset data mirror image file from the first user data directory, and storing the preset data mirror image file into a virtual memory file.
For the second type, when factory settings are restored to open, a virtual memory file may be established first, which is not a block device, but a memory-based file system. The virtual memory file is used for backup, such as a tempfs file system.
According to the method for expanding the system partition, when the operation of restoring the factory setting is executed, the backup of the preset data mirror image file is realized through the virtual memory file.
As shown in fig. 5, in a specific embodiment, the method for expanding a system partition includes the following steps:
a) Compiling the preset data source code to a preset data catalog-Reserve catalog, packaging the Reserve catalog to obtain a preset data mirror image file Reserve. Img, moving the Reserve. Img to a second user data catalog-Userdata catalog, packaging the Userdata catalog to obtain a user data mirror image file Userdata. Img, and burning the Userdata. Img to a user data partition-Userdata partition of a disk.
b) And mounting the Userdata. Img in the Userdata partition to a first user data directory-Userdata directory of the root file System, obtaining a reserve. Img under the Userdata directory, mounting the reserve. Img to an intermediate directory (empty directory) of the root file System, and taking the intermediate directory containing the reserve. Img as a subdirectory under a preset directory of the root file System so as to map the intermediate directory to the preset directory, wherein the preset directory is a subdirectory under a System directory-System directory of the root file System.
According to the method for expanding the system partition, after the user data mirror image file is mounted to the first user data directory, the preset data mirror image file under the first user data directory is obtained, and the preset data mirror image file is mounted to the preset directory under the system directory so that the processor can access data in the preset data mirror image file. In this way, the preset data source codes are compiled and packaged into preset data mirror image files, the preset data mirror image files are burnt to the user data partitions of the magnetic disk along with the user data mirror image files, and when the mobile terminal is started, the preset data mirror image files in the user data mirror image files are mounted to the system catalog, so that the occupation of the space of the system partitions is reduced.
FIG. 2 is a flow diagram of a method of expanding a system partition in one embodiment. It should be understood that, although the steps in the flowchart of fig. 2 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
As shown in fig. 6, in one embodiment, an apparatus 600 for expanding a system partition is provided, comprising: an acquisition module 602 and a mounting module 604.
An obtaining module 602, configured to obtain a preset data image file under a first user data directory after the user data image file is mounted to the first user data directory;
and the mounting module 604 is configured to mount the preset data image file to a preset directory under a system directory, so that the processor can access data in the preset data image file.
The device 600 for expanding system partition, after mounting the user data image file to the first user data directory, obtains the preset data image file in the first user data directory, and mounts the preset data image file to the preset directory in the system directory, so that the processor can access the data in the preset data image file. In this way, the preset data source codes are compiled and packaged into preset data mirror image files, the preset data mirror image files are burnt to the user data partitions of the magnetic disk along with the user data mirror image files, and when the mobile terminal is started, the preset data mirror image files in the user data mirror image files are mounted to the system catalog, so that the occupation of the space of the system partitions is reduced.
In one embodiment, the mounting module 604 is further configured to: mounting the preset data image file to an intermediate directory, wherein the intermediate directory is empty; and mapping the intermediate directory containing the preset data mirror image file to the preset directory.
In one embodiment, the mounting module 604 is further configured to: and taking the intermediate directory containing the preset data image file as a subdirectory under the preset directory so as to map the intermediate directory to the preset directory.
In one embodiment, the device for expanding the system partition further comprises a compiling module, a packaging module and a mobile module, wherein the compiling module is used for: compiling preset data source codes to a preset data catalog; the packing module is used for: packaging the preset data catalogue to obtain the preset data mirror image file; the mobile module is used for: moving the preset data image file to a second user data directory; the packaging module is further configured to: and packaging the second user data directory to obtain the user data mirror image file.
In one embodiment, the obtaining module 602 is further configured to: acquiring a preset data image file to be upgraded, wherein the preset data image file to be upgraded is positioned in an over-the-air download software package, and the preset data image file to be upgraded is used for updating the preset data image file in the first user data directory.
In one embodiment, the apparatus for expanding a system partition further includes a backup module, and the obtaining module 602 is further configured to: acquiring a factory setting restoration type; the obtaining module 602 is further configured to: when the factory setting recovery type is the first type, acquiring the identification of the preset data image file, and adding the identification of the preset data image file into a white list; the backup module is used for: and when the factory setting recovery type is the second type, backing up the preset data mirror image file so as to restore the preset data mirror image file after the factory setting recovery is completed.
In one embodiment, the backup module is further configured to: and extracting the preset data mirror image file from the first user data directory, and storing the preset data mirror image file into a virtual memory file.
FIG. 7 illustrates an internal block diagram of a computer device in one embodiment. The computer device may be specifically the terminal 110 of fig. 1. As shown in fig. 7, the computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the memory includes a non-volatile computer-readable storage medium and an internal memory. The non-transitory computer readable storage medium of the computer device stores an operating system and may also store a computer program that, when executed by a processor, causes the processor to implement a method of expanding a system partition. The internal memory may also have stored therein a computer program which, when executed by the processor, causes the processor to perform a method of expanding a partition of a system.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the apparatus for expanding a system partition provided herein may be implemented in the form of a computer program that may be run on a computer device as shown in fig. 7. The memory of the computer device may store various program modules that make up the apparatus of the expanded system partition, such as the acquisition module 602 and the mount module 604 shown in FIG. 6. The computer program of each program module causes the processor to execute the steps in the method for expanding system partitions of the various embodiments of the present application described in the present specification.
In one embodiment, a computer device is provided that includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of expanding a system partition described above. The steps of the method of expanding a system partition herein may be steps in the method of expanding a system partition of the above-described respective embodiments.
In one embodiment, a computer readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of the method of expanding a system partition described above. The steps of the method of expanding a system partition herein may be steps in the method of expanding a system partition of the above-described respective embodiments.
Those skilled in the art will appreciate that all or part of the processes implementing the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored on a non-volatile computer readable storage medium, and the program may include processes of the embodiments of the methods described above when executed. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include a magnetic disk (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method of expanding a system partition, the method comprising:
compiling preset data source codes through a compiling system, and compiling the preset data source codes to a preset data catalog;
packaging the preset data catalogue to obtain a preset data mirror image file;
moving the preset data image file to a second user data directory;
packaging the second user data directory to obtain a user data mirror image file, and burning the user data mirror image file into a user data partition of a disk;
when a terminal is started and the user data image file is mounted to a first user data directory of a root file system, acquiring the preset data image file under the first user data directory; the root file system is the first file system hung when the kernel of the terminal is started;
and mounting the preset data image file to a preset directory under a system directory so as to enable a processor to access data in the preset data image file.
2. The method of claim 1, wherein the mounting the preset data image file to a preset directory under a system directory comprises:
mounting the preset data image file to an intermediate directory, wherein the intermediate directory is empty;
and mapping the intermediate directory containing the preset data mirror image file to the preset directory.
3. The method of claim 2, wherein mapping the intermediate directory containing the preset data image file to the preset directory comprises:
and taking the intermediate directory containing the preset data image file as a subdirectory under the preset directory so as to map the intermediate directory to the preset directory.
4. The method of claim 1, wherein the preset data image file is in ext4 format.
5. The method according to claim 1, wherein the method further comprises:
acquiring a preset data image file to be upgraded, wherein the preset data image file to be upgraded is positioned in an over-the-air download software package, and the preset data image file to be upgraded is used for updating the preset data image file in the first user data directory.
6. The method according to claim 1, wherein the method further comprises:
acquiring a factory setting restoration type;
when the factory setting recovery type is the first type, acquiring the identification of the preset data image file, and adding the identification of the preset data image file into a white list;
and when the factory setting recovery type is the second type, backing up the preset data mirror image file so as to restore the preset data mirror image file after the factory setting recovery is completed.
7. The method of claim 6, wherein the backing up the preset data image file comprises:
and extracting the preset data mirror image file from the first user data directory, and storing the preset data mirror image file into a virtual memory file.
8. An apparatus for expanding a system partition, the apparatus comprising:
the compiling module is used for compiling preset data source codes through the compiling system and compiling the preset data source codes to a preset data catalog;
the packaging module is used for packaging the preset data catalogue to obtain a preset data mirror image file;
the mobile module is used for moving the preset data mirror image file to a second user data directory;
the packaging module is further configured to package the second user data directory to obtain a user data image file, and burn the user data image file into a user data partition of a disk;
the acquisition module is used for acquiring the preset data mirror image file under the first user data directory after the terminal is started and the user data mirror image file is mounted to the first user data directory of the root file system; the root file system is the first file system hung when the kernel of the terminal is started;
and the mounting module is used for mounting the preset data image file to a preset directory under a system directory so as to enable the processor to access the data in the preset data image file.
9. A computer device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of the method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer executable instructions which when executed by a processor cause the processor to perform the steps of the method of any of claims 1 to 7.
CN202010048638.8A 2020-01-16 2020-01-16 Method, device, storage medium and computer equipment for expanding system partition Active CN113126893B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010048638.8A CN113126893B (en) 2020-01-16 2020-01-16 Method, device, storage medium and computer equipment for expanding system partition
PCT/CN2021/072154 WO2021143845A1 (en) 2020-01-16 2021-01-15 Extended system partitioning method and apparatus, storage medium, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010048638.8A CN113126893B (en) 2020-01-16 2020-01-16 Method, device, storage medium and computer equipment for expanding system partition

Publications (2)

Publication Number Publication Date
CN113126893A CN113126893A (en) 2021-07-16
CN113126893B true CN113126893B (en) 2023-06-16

Family

ID=76771799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010048638.8A Active CN113126893B (en) 2020-01-16 2020-01-16 Method, device, storage medium and computer equipment for expanding system partition

Country Status (2)

Country Link
CN (1) CN113126893B (en)
WO (1) WO2021143845A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113504997B (en) * 2021-07-28 2023-03-21 亿咖通(湖北)技术有限公司 Processing method, device, equipment and medium for application program installation package file
CN113867768A (en) * 2021-09-30 2021-12-31 厦门亿联网络技术股份有限公司 Operating system processing method and device, electronic equipment and storage medium
CN114185491B (en) * 2021-12-13 2024-01-19 惠州Tcl移动通信有限公司 Partition file downloading method and device, storage medium and computer equipment
CN116048644B (en) * 2023-03-30 2023-06-16 中科方德软件有限公司 System migration method, device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727503A (en) * 2010-01-29 2010-06-09 宋振华 Method for establishing disk file system
CN106598475A (en) * 2015-10-19 2017-04-26 中兴通讯股份有限公司 Method and device for switching partitions
CN107562452A (en) * 2017-07-26 2018-01-09 捷开通讯(深圳)有限公司 Terminal preset application update method, intelligent terminal and the device with store function
CN110543369A (en) * 2019-09-11 2019-12-06 国美视界(北京)科技有限公司 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100630104B1 (en) * 2004-02-10 2006-09-27 삼성전자주식회사 System for providing multiple window environment in mobile computing system and method thereof
US8688645B2 (en) * 2010-11-30 2014-04-01 Netapp, Inc. Incremental restore of data between storage systems having dissimilar storage operating systems associated therewith
US8914334B2 (en) * 2012-09-12 2014-12-16 International Business Machines Corporation Using a metadata image of a file system and archive instance to restore data objects in the file system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101727503A (en) * 2010-01-29 2010-06-09 宋振华 Method for establishing disk file system
CN106598475A (en) * 2015-10-19 2017-04-26 中兴通讯股份有限公司 Method and device for switching partitions
CN107562452A (en) * 2017-07-26 2018-01-09 捷开通讯(深圳)有限公司 Terminal preset application update method, intelligent terminal and the device with store function
CN110543369A (en) * 2019-09-11 2019-12-06 国美视界(北京)科技有限公司 Construction method and device of storage space structure of android system and construction structure of storage space structure of android system

Also Published As

Publication number Publication date
CN113126893A (en) 2021-07-16
WO2021143845A1 (en) 2021-07-22

Similar Documents

Publication Publication Date Title
CN113126893B (en) Method, device, storage medium and computer equipment for expanding system partition
CN105867947B (en) Data processing method and device after preset application program updating
CN108027741B (en) File processing method, device, terminal and storage medium based on patch upgrade
CN111263354B (en) OTA differential upgrading method and device
CN105335187A (en) Application processing method and apparatus
CN112882729A (en) Application image upgrading method and device, computer equipment and storage medium
CN111897623B (en) Cluster management method, device, equipment and storage medium
CN108228077B (en) Storage area management method, operation method, device, equipment and readable medium
US20160162278A1 (en) System and method for applying an update to a device system via a system snapshot
CN112395039A (en) Management method and device for Kubernetes cluster
CN103716346A (en) Management method and device of application on android handset client
CN109558143B (en) Method and device for deploying applications in cluster
CN110597568B (en) Plug-in deployment method, system and terminal
CN114567584B (en) Routing information processing method, device, computer equipment and storage medium
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN113867768A (en) Operating system processing method and device, electronic equipment and storage medium
US9854429B2 (en) Mobile terminal configuration method and system
CN113296891A (en) Multi-scene knowledge graph processing method and device based on platform
CN108536444B (en) Plug-in compiling method and device, computer equipment and storage medium
CN111176671B (en) Method for automatically and continuously updating system, mobile terminal and storage medium
CN113093995B (en) Cloud disk data migration method and system
WO2016188200A1 (en) Method and device for implementing partition switching
CN107783837B (en) Method and device for performing storage expansion and electronic equipment
CN111966744B (en) Workflow deployment method and device, computer equipment and storage medium
CN111984299A (en) Data loading method and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant