Debugging method, device and storage medium for device partition mounting failure

By checking and recording metadata through file system inspection tools, the problem of mobile device user data partition mounting failures is solved, providing a convenient debugging method and improving device efficiency and flash memory device lifespan.

CN114328193BActive Publication Date: 2026-06-23BEIJING SPREADTRUM HI TECH COMM TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING SPREADTRUM HI TECH COMM TECH CO LTD
Filing Date
2021-12-15
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

When user data partition mounting fails on mobile devices, metadata encryption makes it impossible to capture user logs, making it impossible to directly determine the cause. Furthermore, reading back is of no analytical value, and existing debugging methods are time-consuming, laborious, and complex.

Method used

The file system inspection tool examines the metadata of the user data partition, records failed nodes, and logs the kernel's mount process when a mount fails. It controls the device to enter recovery mode and decrypts and saves the metadata in recovery mode for analysis and repair.

Benefits of technology

It enables convenient analysis and resolution of user data partition mounting failures, improves debugging efficiency, and extends the lifespan of flash memory devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328193B_ABST
    Figure CN114328193B_ABST
Patent Text Reader

Abstract

The application provides a debugging method, device and storage medium for device partition mounting failure. The method comprises the following steps: S1, starting the device, and checking the metadata in the user data partition by using a file system checking tool; S2, when the checking fails, the file system checking tool records the metadata of the failed node; S3, when the checking succeeds, mounting the user data partition; S4, if the mounting fails in the mounting process, returning to execute S1 to S3, and if the mounting fails again, jumping to S5; S5, when the mounting fails, recording the mounting process log executed by the kernel into the set partition, and controlling the device to enter the recovery mode. The debugging method for device partition mounting failure records the metadata of the failed node, analyzes the metadata in the user data partition, finds the problems in the metadata in the user data partition, analyzes the reasons for the user data mounting failure through the process log, and is convenient for solving the mounting failure problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a debugging method, apparatus and storage medium for device partition mounting failure. Background Technology

[0002] For mobile devices, the following changes have been made regarding user data: A metadata encryption mechanism has been added to protect user data; due to permission considerations, user logs are stored in the user data partition. Based on these limitations, when user data mounting fails and enters recovery mode, user logs cannot be retrieved, making it impossible to directly determine the cause of the mounting failure. Furthermore, since the metadata is encrypted, rereading the user data has no analytical value or meaning.

[0003] To repair equipment or ensure normal use, testers or users connect to the serial port of a Universal Asynchronous Receiver / Transmitter (UART) and raise the serial port log level to capture the serial port data during this process for root cause analysis. However, this method has several drawbacks and limitations: testers or users may lose the problem scene due to unfamiliarity with the operation, making reproduction time-consuming and laborious; end-user devices may not have a reserved UART serial port, making operation impossible; and reading back the partition has no analytical value, requiring the metadata to be encrypted and discarded for retesting and troubleshooting.

[0004] Therefore, it is necessary to design a debugging method that facilitates the analysis of the causes of device partition mounting failures. Summary of the Invention

[0005] The purpose of this invention is to provide a debugging method, apparatus, and storage medium for device partition mounting failure, in order to improve the problem that when metadata is encrypted and user logs cannot be captured, it is impossible to directly debug the cause of user data mounting failure and the device cannot be used normally.

[0006] In a first aspect, embodiments of this application provide a debugging method for device partition mounting failure, the method comprising: S1, enabling the device and checking the metadata in the user data partition using a file system checking tool; S2, when the check fails, the file system checking tool records the metadata of the failed node; S3, when the check succeeds, mounting the user data partition; S4, if the mounting process fails, returning to execute S1 to S3, and if the mounting fails again, jumping to S5; S5, when the mounting fails, recording the kernel-executed mounting process log to a designated partition, and controlling the device to enter recovery mode.

[0007] The beneficial effects of the device partition mount failure debugging method of the present invention are as follows: The device is powered on, and the metadata in the user data partition is checked using a file system checking tool. If the check fails, the metadata of the failed node is recorded. If the check succeeds, the user data partition is mounted. If the mount fails again, the mounting action is repeated. If the mount still fails after the second attempt, the mount process log executed by the kernel at the time of the mount failure is recorded in a designated partition, and the device is controlled to enter recovery mode. This allows for analysis of the metadata in the user data partition by recording the metadata of the failed node, identifying problems in the metadata of the user data partition, and analyzing the reasons for the user data mount failure through the process log, facilitating the analysis and resolution of the mount failure problem.

[0008] In one possible embodiment, after controlling the device to enter recovery mode, the method further includes: decrypting the metadata recorded by the file system checking tool and saving it to the designated partition. The advantage is that by decrypting and saving the metadata recorded by the file system checking tool to the designated partition, the metadata recorded by the file system checking tool can be analyzed after entering recovery mode, making it easier to identify the cause of the mount failure.

[0009] In one possible embodiment, after the file system checking tool records the metadata of the failed node when the check fails, the method further includes: repairing the metadata in the user data partition based on the metadata recorded by the file system checking tool. The advantage is that by repairing the metadata in the user data partition, problems in the metadata of the user data partition are fixed, facilitating subsequent mounting of the user data partition.

[0010] In one possible embodiment, when the check fails, the file system checking tool records the metadata of the failed node, including: recording the data block content of the failed node. The advantage is that this allows the device to accurately locate the position of the failed data block, facilitating repair.

[0011] In one possible embodiment, the user data partition is a user data partition in the F2FS flash file system. The advantage is that by setting the user data partition as a user data partition in the F2FS flash file system, the lifespan of the flash memory device can be improved.

[0012] Secondly, embodiments of this application also provide a debugging device for device partition mounting failure, which includes modules / units for executing any of the possible design methods described in the first aspect. These modules / units can be implemented in hardware or by hardware executing corresponding software.

[0013] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory. The memory stores one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device is able to implement any of the possible design methods described in the second aspect above.

[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium comprising a computer program that, when executed on an electronic device, causes the electronic device to perform any of the possible design methods described above.

[0015] Fifthly, embodiments of this application also provide a method comprising a computer program product, which, when the computer program product is run on a terminal, causes the electronic device to perform any of the possible designs described above. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the debugging method for device partition mounting failure according to an embodiment of the present invention;

[0017] Figure 2 for Figure 1 A structural block diagram of the debugging method for device partition mounting failure;

[0018] Figure 3 This is a schematic diagram of a debugging device for device partition mounting failure according to an embodiment of the present invention;

[0019] Figure 4 This is a schematic diagram of an electronic device structure according to an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art. The terms "comprising" and similar expressions used herein mean that the element or object preceding the word covers the element or object listed following the word and its equivalents, but do not exclude other elements or objects.

[0021] Currently, on mobile devices, specifically Android devices, metadata is encrypted, and user logs are stored in the user data partition. When user data mounting fails, the device enters recovery mode and cannot be started normally. Furthermore, user logs are not generated in this state, and the metadata in the read-back partition is encrypted and cannot be decrypted, making it impossible to find an effective and direct way to debug the cause of the user data mounting failure.

[0022] To address the problems existing in the prior art, embodiments of the present invention provide a debugging method for device partition mounting failure.

[0023] Figure 1 This is a flowchart illustrating the debugging method for device partition mounting failure according to the present invention. Figure 2 for Figure 1 The structural block diagram of the debugging method for device partition mounting failure.

[0024] In some embodiments of the present invention, reference is made to Figure 1 and Figure 2 Troubleshooting methods for device partition mounting failures include:

[0025] S1. Turn on the device and use a file system check tool to check the metadata in the user data partition.

[0026] S2. When the check fails, the file system check tool records the metadata of the failed node.

[0027] S3. When the check is successful, mount the user data partition.

[0028] S4. If the mounting process fails, return to execute S1 to S3. If the mounting fails again, jump to S5.

[0029] S5. When mounting fails, record the kernel-executed mounting process log to the designated partition and control the device to enter recovery mode.

[0030] In some specific embodiments of the present invention, the device is powered on, and the metadata in the user data partition is checked using a file system check tool. If there are problems with the metadata in the user data partition, the check will fail. When the check fails, the file system check tool records the metadata of the failed node in the user data partition for subsequent review and analysis of the error cause. If there are no problems with the metadata in the user data partition, no problems will be detected, i.e., the check is successful. When the check is successful, the user data partition is mounted. If the mounting process fails, it indicates a problem with the user data mounting process. The check process is repeated and repaired. If the mounting is successful, the device can be used normally. If the mounting fails again, the mounting process log executed by the kernel during the mounting process is recorded in a designated partition, and then the device is controlled to enter recovery mode. Then, the mounting failure problem is analyzed based on the mounting process log recorded in the designated partition to determine the reason why the device cannot mount user data normally.

[0031] In some embodiments, the user data partition is the storage space on the device that can be used by the user to store personal data. The user usage log is a logging mechanism that allows for problem analysis. Mounting involves attaching the flash memory device to a specific path, making it accessible to the user. Metadata represents a specific file system and the data used to organize and manage user data.

[0032] It is worth noting that the recovery mode is a special mode that can erase user data and restore factory settings.

[0033] In some other embodiments, the designated partition is a cache partition. In still other embodiments, the designated partition is another type of partition.

[0034] In some embodiments of the present invention, reference is made to Figure 1 and Figure 2 After controlling the device to enter recovery mode, the method further includes: decrypting the metadata recorded by the file system checking tool and saving it to the designated partition. In some specific embodiments of the present invention, the metadata recorded by the file system checking tool is the metadata of the failed node. Decrypting the metadata of the failed node and saving it to the designated partition facilitates subsequent readback and analysis of the cause.

[0035] In some embodiments of the present invention, reference is made to Figure 1 and Figure 2 After the file system check tool records the metadata of the failed node when the check fails, the method further includes: repairing the metadata in the user data partition based on the metadata recorded by the file system check tool.

[0036] In some specific embodiments of the present invention, repairing the metadata of the failed node enables the check to succeed, thereby allowing the mounting step to proceed. In other aspects, the above method for repairing the metadata of the failed node can identify problems with the metadata in the user data partition one by one, and enable them to be repaired one by one.

[0037] In some embodiments of the present invention, reference is made to Figure 1 and Figure 2 When the check fails, the file system check tool records the metadata of the failed node, including: the data block content of the failed node recorded by the file system check tool when the check fails.

[0038] In some embodiments of the present invention, reference is made to Figure 1 and Figure 2 The user data partition is a user data partition within the F2FS flash file system. F2FS is a flash-friendly file system that can be used for user data partitions. Using the F2FS flash file system in this embodiment can extend the lifespan of the flash device.

[0039] Figure 3 This is a schematic diagram of a debugging device for device partition mounting failure according to an embodiment of the present invention.

[0040] refer to Figures 1 to 3 Based on the above-mentioned debugging method for device partition mounting failure, in some embodiments of this application, a debugging device 300 for device partition mounting failure is disclosed, the device 300 comprising:

[0041] The inspection unit 301 is used to inspect the metadata in the user data partition using a file system inspection tool when the device is turned on.

[0042] Recording unit 302 is used to record the metadata of the failed node when the check fails;

[0043] Mounting unit 303 is used to mount the user data partition when the check is successful; if the mounting fails during the mounting process, the checking unit, the recording unit and the mounting unit are executed repeatedly; if the mounting fails again, the mounting unit ends the mounting.

[0044] The recording unit 302 is also used to record the kernel-executed mount process log to a designated partition when the mount fails.

[0045] Control unit 304 is used to control the device to enter recovery mode.

[0046] In one possible implementation, the device further includes a decryption unit 305, used to decrypt the metadata recorded by the file system inspection tool and save it to the designated partition.

[0047] In one possible implementation, the apparatus further includes a repair unit 306 for repairing the metadata in the user data partition based on the metadata recorded by the file system inspection tool.

[0048] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0049] Figure 4 This is a schematic diagram of an electronic device structure according to an embodiment of the present invention.

[0050] In other embodiments of this application, an electronic device is disclosed, such as... Figure 4 As shown, the electronic device 400 may include: one or more processors 401; a memory 402; a display 403; one or more application programs (not shown); and one or more computer programs 404. These devices may be connected via one or more communication buses 405. The one or more computer programs 404 are stored in the memory 402 and configured to be executed by the one or more processors 401. The one or more computer programs 404 include instructions.

[0051] The present invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a computer, implements the method described in the above-described embodiments. Specific effects can be found in the above-described embodiments.

[0052] The present invention also provides a computer program product that, when executed by a computer, implements the method described in the above-described method embodiments. Specific effects can be found in the above-described embodiments.

[0053] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0054] In the various embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0055] If the integrated unit is implemented as 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 solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as flash memory, portable hard disk, read-only memory, random access memory, magnetic disk, or optical disk.

[0056] While embodiments of the present invention have been described in detail above, it will be apparent to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations fall within the scope and spirit of the invention as set forth in the claims. Furthermore, the invention described herein may have other embodiments and can be implemented or carried out in various ways.

Claims

1. A debugging method for device partition mounting failure, characterized in that, The method includes: S1. Power on the device and use a file system check tool to check the metadata in the user data partition; the metadata is encrypted metadata. S2. When the check fails, the file system check tool records the metadata of the failed node; the metadata of the failed node includes the data block content of the failed node; S3. When the check is successful, mount the user data partition; S4. If the mounting process fails, return to execute S1 to S3. If the mounting fails again, jump to S5. S5. When mounting fails, record the kernel's mounting process log to the designated partition, control the device to enter recovery mode, and decrypt the metadata recorded by the file system inspection tool and save it to the designated partition to analyze the reason for the mounting failure of the user data partition in recovery mode.

2. The method according to claim 1, characterized in that, After the file system inspection tool records the metadata of the failed node when the inspection fails, it also includes: Repair the metadata in the user data partition based on the metadata recorded by the file system inspection tool.

3. The method according to claim 1, characterized in that, The user data partition is the user data partition in the F2FS flash file system.

4. A debugging device for equipment partition mounting failure, characterized in that, The device includes: The inspection unit is used to inspect the metadata in the user data partition using a file system inspection tool when the device is powered on; the metadata is encrypted metadata. A recording unit is used by the file system inspection tool to record the metadata of the failed node when the inspection fails; the metadata of the failed node includes the data block content of the failed node; The mounting unit is used to mount the user data partition when the check is successful; if the mounting fails during the mounting process, the checking unit, the recording unit and the mounting unit are executed repeatedly. If the mounting fails again, the mounting unit ends the mounting process. The recording unit is also used to record the kernel-executed mount process log to a designated partition when the mount fails. A control unit is used to control the device to enter recovery mode; The decryption unit is used to decrypt the metadata recorded by the file system inspection tool and save it to the designated partition in order to analyze the reasons for the failure to mount the user data partition in recovery mode.

5. The apparatus according to claim 4, characterized in that, The device also includes a repair unit: The repair unit is used to repair the metadata in the user data partition based on the metadata recorded by the file system inspection tool.

6. The apparatus according to claim 4, characterized in that, The user data partition is the user data partition in the F2FS flash file system.

7. A computer-readable storage medium storing a computer program therein, characterized in that, When the computer program is executed by the device, it implements the method of any one of claims 1 to 3.