CN109086079B - Mounting management method and device for storage equipment - Google Patents

Mounting management method and device for storage equipment Download PDF

Info

Publication number
CN109086079B
CN109086079B CN201810596862.3A CN201810596862A CN109086079B CN 109086079 B CN109086079 B CN 109086079B CN 201810596862 A CN201810596862 A CN 201810596862A CN 109086079 B CN109086079 B CN 109086079B
Authority
CN
China
Prior art keywords
storage device
framework layer
application
notification message
read
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
CN201810596862.3A
Other languages
Chinese (zh)
Other versions
CN109086079A (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.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology 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 Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN201810596862.3A priority Critical patent/CN109086079B/en
Publication of CN109086079A publication Critical patent/CN109086079A/en
Application granted granted Critical
Publication of CN109086079B publication Critical patent/CN109086079B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a mounting management method and device for storage equipment. The method comprises the following steps: the method comprises the following steps that an operating system kernel detects the file system state of a directory mounted by a storage device, and when judging that the storage device is re-mounted as read-only according to a detection result, the operating system kernel executes the following steps: and sending a first notification message to an application framework layer, wherein the application framework layer notifies an application program to stop accessing the storage device which is re-mounted to be read only according to the first notification message.

Description

Mounting management method and device for storage equipment
Technical Field
The invention relates to the technical field of computers, in particular to a mounting management method and device of a storage device.
Background
The storage device in the mobile device is divided into an internal storage and an external storage. The internal storage refers to a storage space of the mobile device when the mobile device leaves a factory, and can be used for installing system firmware and software, and the external storage is usually a pluggable memory card, such as an SD card.
In the linux operating system, all devices are regarded as files, resources of the whole devices are integrated into one file directory, if the files in the storage device need to be accessed, the storage device needs to be mounted on an existing directory as a file partition, and then the files in the storage device are accessed by accessing the directory.
Applications in the mobile device may access these storage devices after they are mounted to an existing directory. When the storage device is damaged by hardware or a file system, the storage device can be mounted in a read-only state again, and the application cannot know that the storage device is mounted in a read-only state again in time, so that the read-write operation can be continuously performed on the storage device, and the access failure of the application to the storage device can be caused because the storage device is in the read-only state currently.
Disclosure of Invention
The embodiment of the application provides a mounting management method and device for storage equipment.
In a first aspect, a storage device mount management method is provided, including: the method comprises the following steps that an operating system kernel detects the file system state of a directory mounted by a storage device, and when judging that the storage device is re-mounted as read-only according to a detection result, the operating system kernel executes the following steps: and sending a first notification message to an application framework layer, wherein the application framework layer notifies an application program to stop accessing the storage device which is re-mounted to be read only according to the first notification message.
According to the embodiment of the application, the operating system kernel detects the file system state of the directory mounted by the storage device, and sends the first notification message to the application framework layer when the storage device is determined to be re-mounted as read-only, so that the application framework layer notifies the application program to stop accessing the storage device which is re-mounted as read-only, the condition that the storage device is re-mounted as read-only can be timely found, the application program can stop accessing the storage device in time, and the failure of access of the application to the storage device due to the fact that the storage device is currently in the read-only state is avoided.
In a possible implementation manner, when the kernel of the operating system determines that the storage device is re-mounted as read-only according to the detection result, the method further includes: and checking a hardware register of the storage device, and if the hardware register of the storage device is set to be read only by a hardware controller, notifying the application program framework layer that the storage device has a hardware fault.
According to the embodiment of the application, when the kernel of the operating system judges that the storage device is re-mounted only when read according to the detection result, whether the storage device is a hardware fault or not can be judged by checking the hardware register of the storage device, so that a fault reason can be determined, and further subsequent processing can be performed according to the fault reason.
In a possible implementation manner, when the kernel of the operating system determines that the storage device is re-mounted as read-only according to the detection result, the method further includes: sending a second notification message to the application framework layer, unloading the storage device, repairing the file system error by the application framework layer according to the second notification message, and after the file system is successfully repaired, re-mounting the storage device; and the application program framework layer informs the application program to restore the access to the storage device.
According to the above embodiment of the present application, when the kernel of the operating system determines that the storage device is re-mounted as read-only according to the detection result, the kernel of the operating system may further notify the framework layer of the application program to unload the storage device, perform the file system recovery process, and re-mount the storage device after the recovery is successful, so that the application program may access the storage device, that is, the file system error may be recovered in the above manner.
In a possible implementation manner, if the file system repair fails, the method further includes: the application framework layer notifies the application of a file system error.
In a possible implementation manner, the first notification message carries indication information of the storage device, or carries indication information of a directory to which the storage device is mounted.
In a second aspect, a storage device mount management apparatus is provided, including: an operating system kernel and an application framework layer; the operating system kernel is used for detecting the file system state of the directory mounted by the storage device, and sending a first notification message to the application program framework layer when the storage device is judged to be re-mounted only in reading according to the detection result; and the application framework layer is used for informing the application program to stop accessing the storage equipment which is re-mounted to be read only according to the first notification message.
In one possible implementation, the operating system kernel is further configured to: when the storage equipment is judged to be re-mounted as read-only according to the detection result, checking a hardware register of the storage equipment; and if the hardware register of the storage device is set to be read only by a hardware controller, notifying the application program framework layer that the storage device has a hardware fault.
In one possible implementation, the operating system kernel is further configured to: when the storage device is judged to be re-mounted only in reading according to the detection result, sending a second notification message to the application program framework layer;
the application framework layer is further used for unloading the storage device according to the second notification message, repairing a file system error, and after the file system is successfully repaired, re-mounting the storage device; and notifying the application to resume access to the storage device.
In one possible implementation, the application framework layer is further configured to: and if the file system repair fails, notifying the application program that the file system is wrong.
In a possible implementation manner, the first notification message carries indication information of the storage device, or carries indication information of a directory to which the storage device is mounted.
In a third aspect, an apparatus is provided, comprising: a processor, a memory; the processor is used for reading the program in the memory and executing: an operating system kernel in the processor detects the file system state of a directory mounted by the storage device, and executes the following steps when judging that the storage device is re-mounted only in reading according to the detection result: and sending a first notification message to an application framework layer, and notifying the application framework layer in the processor to stop accessing the storage device which is re-mounted to be read only according to the first notification message.
In a fourth aspect, there is provided a computer-readable storage medium having stored thereon computer-executable instructions for causing the computer to perform the method of any of the first aspects above.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of an operating system architecture according to an embodiment of the present application;
fig. 2 is a schematic view illustrating a mount management process of a storage device according to an embodiment of the present application;
fig. 3 is a schematic view illustrating a mount management process of a storage device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a storage device mount management system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present application.
Detailed Description
In the linux operating system, mounting means mounting a storage device to an existing directory, and accessing a file in the storage device through accessing the directory. For some other types of operating systems, the meaning of mount is similar.
When the storage device in the terminal is damaged by hardware or a file system, the storage device can be mounted in a read-only state again. In order to notify the applications in the terminal that the storage device is re-mounted in a read-only state in time, so as to avoid read-write operation errors caused by continuing to perform read-write operation on the storage device, embodiments of the present application provide a storage device mounting management method and apparatus.
The storage device in the terminal may include an internal storage and/or an external storage.
The embodiment of the application is applicable to various types of terminals. The terminal, also referred to as User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), etc., is a device for providing voice and/or data connectivity to a user, for example, a handheld device with a wireless connection function, a vehicle-mounted device, etc. Currently, some examples of terminals are: a mobile phone (mobile phone), a tablet computer, a notebook computer, a palm top computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (smart security), a wireless terminal in city (smart city), a wireless terminal in home (smart home), and the like.
The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a schematic diagram of a terminal operating system architecture is shown.
As shown in FIG. 1, the system architecture may include, from a bottom level to a top level, an operating system kernel, an application framework level, and an application level. The above layers may be implemented by software, that is, the above layers may be regarded as functional modules or software modules, for example, an operating system kernel may also be referred to as an operating system kernel module, and an application framework layer may also be referred to as an application framework layer module.
The kernel of the operating system is mainly used for realizing core functions such as hardware device driving, process and memory management, network protocol stack, power management, wireless communication and the like. It is a piece of software that provides secure access to computer hardware for many applications.
The application framework layer is used to provide a series of class libraries needed to run the application. Taking the android system as an example, the application framework layer may include, but is not limited to, the following libraries (or modules):
activity manager (activity manager): the system comprises a plurality of application life cycles, a plurality of navigation backspacing functions and an interface, wherein the navigation backspacing functions are used for managing the life cycles of the applications and providing a common navigation backspacing function;
window manager (window manager): managing all opened window programs;
view system (view system): creating a base component of an application, including lists (lists),
Grids (grids), text boxes (text boxes), buttons (buttons), embeddable web browsers, and the like;
package manager (package manager): managing the application program, wherein the provided functions can comprise the steps of managing the application program according to the application program, uninstalling the application program, inquiring related authority information and the like;
resource manager (resource manager): various non-code resources are provided for use by applications, such as localized strings, pictures, audio, and the like.
The application program layer includes various application programs, such as Short Message Service (SMS) programs on a smart phone, a phone dialing application, a picture browser, a calendar application, a game, a map application, a web browser, and the like.
Based on the above-mentioned architecture, in the embodiment of the present application, the operating system kernel may detect the file system state of the directory mounted by the storage device. The application framework layer may include a "mount management module," which may be embodied as a system service and may implement the mount management function of the storage device provided in the embodiment of the present application.
It should be noted that, in the embodiment of the present application, a naming mode of the "mount management module" is not limited, and as long as the mount management function provided in the embodiment of the present application can be implemented, the "mount management module" in the embodiment of the present application can be regarded regardless of naming mode.
Referring to fig. 2, a schematic view of a mount management process of a storage device according to an embodiment of the present application is provided.
The storage device may be mounted under an existing directory. During the starting process of the operating system, the storage device can be automatically mounted in an existing directory, or the mounting of the storage device can be performed according to a mounting command (such as a mount command). The storage device can be mounted as a partition in an existing directory, and an application program can access the directory to perform read-write operation on files in the storage device.
After the storage device is mounted in the directory, the file system state of the storage device is generally a read-write state. However, if the storage device experiences a hardware failure or a file system failure, the storage device may be reloaded to a read-only state.
In the storage device mount management process provided in the embodiment of the present application, by detecting the file system state of the directory mounted by the storage device, when it is determined that the storage device is re-mounted as read-only according to the detection result, the application program is timely notified to stop accessing the storage device.
As shown, the process may include:
s201: the operating system kernel detects a file system state of a directory to which the storage device is mounted.
In this step, after the storage device is mounted in the directory in the read-write manner (after the storage device is mounted in the directory in the read-write manner, the file system state of the directory is the read-write state), the operating system kernel may detect, for the directory, whether the file system state is changed to the read-only state because the storage device is re-mounted in the read-only state.
In specific implementation, when the storage device is re-mounted as read-only due to a hardware failure or a file system failure, the corresponding event can be acquired by the operating system kernel, so that the operating system kernel can detect a file system state change of a directory mounted by the storage device.
More specifically, taking linux operating system as an example, the operating system kernel may determine whether an event that the storage device is re-mounted as read-only occurs through the detected mounting parameter. For example, if the operating system kernel determines that an error handling parameter indicating that the re-mount is read-only appears in the mount parameters of the storage device, for example, error ═ rumount-ro, it may be determined that the storage device is re-mounted as read-only.
S202: if the storage device is determined to be read only by being re-mounted according to the detection result, the operation goes to S203;
s203: the operating system kernel sends a first notification message to the application framework layer.
The first notification message is used for indicating that the storage device is reloaded to be read-only, or the first notification message is used for indicating that the application framework layer notifies the application program to stop accessing the storage device which is reloaded to be read-only.
Optionally, the first notification message may carry indication information of a storage device that is re-mounted as read-only, or may carry indication information of a directory to which the storage device is mounted, so that the application framework layer may notify the application to stop accessing the storage device or the directory indicated by the indication information.
The application framework layer may specifically be a "mount management module" in the application framework layer shown in fig. 1.
During specific implementation, information interaction can be carried out between the operating system kernel and the mounting management module through interprocess communication.
S204: and after receiving the first notification message, the application framework layer notifies the application program in the terminal to stop accessing the storage device which is re-mounted as read-only according to the first notification message.
Alternatively, the application framework layer may notify the application of the application layer to stop accessing the storage device that is re-mounted as read-only or to stop accessing the directory to which the storage device is mounted by sending a broadcast message to the application layer.
It can be seen from the above description that the operating system kernel can detect the file system state of the directory mounted by the storage device, and can send a notification message to the application framework layer when it is determined that the storage device is re-mounted as read-only according to the detection result, so that the application framework layer notifies the application program to stop accessing the storage device that is re-mounted as read-only according to the notification message, thereby being capable of timely detecting that the storage device is re-mounted as read-only and timely stopping the application program from accessing the storage device, and avoiding access failure caused by the application program accessing the storage device when the storage device is re-mounted as read-only.
Optionally, on the basis of the above flow, in another embodiment, after detecting that the storage device is reinstalled as read-only, the operating system kernel may check a hardware register of the storage device, and if detecting that the hardware register of the storage device is set as read-only by the hardware controller, it indicates that the hardware register of the storage device is reinstalled as read-only due to a hardware failure of the storage device, so as to notify the application framework layer that the storage device has a hardware failure. Further, the application framework layer may notify the application in the terminal of the occurrence of the hardware failure of the storage device. According to this embodiment, it may be detected whether the storage device is mounted as read-only for hardware register reasons and the application framework layer may be informed of the reason and further the application.
Based on the foregoing embodiment, in a possible implementation manner, after detecting that the storage device is re-mounted as read-only, and before sending the first notification message to the application framework layer, the operating system kernel may check a hardware register of the storage device to determine a reason that the storage device is re-mounted as read-only, and send the first notification message to the application framework layer when it is determined that the storage device is re-mounted as read-only due to the reason of the hardware register of the storage device, so as to notify the application framework layer of the information that the hardware fault occurs in the storage device, and notify the application framework layer of stopping accessing the storage device.
In another possible implementation manner, after detecting that the storage device is re-mounted as read-only and after sending the first notification message to the application framework layer, the operating system kernel may check a hardware register of the storage device to determine a reason that the storage device is re-mounted as read-only, and when determining that the storage device is re-mounted as read-only due to the hardware register of the storage device, send a notification message to the application framework layer again to notify the application framework layer of the failure reason and notify the application program of the failure reason. Compared with the former implementation mode, the implementation mode can inform the application framework layer in time so that the application framework layer can inform the application program to stop accessing the storage device in time.
Optionally, on the basis of the above flow, in another embodiment, after detecting that the storage device is reloaded as read-only, the operating system kernel sends a second notification message to the application framework layer; and the application program framework layer unloads the storage device which is re-mounted as read-only according to the second notification message, repairs the file system error, re-mounts the storage device after the file system is successfully repaired, and notifies the application program to recover to access the storage device. Further, if the file system repair fails, the application framework layer may notify the application of the file system error. According to the embodiment, whether the reason that the storage device is mounted as the read-only device is the file system fault can be detected, the file system fault can be repaired, and the storage device is mounted again so as to recover the access of the storage device.
Based on the foregoing embodiment, in a possible implementation manner, after detecting that the storage device is re-mounted as read-only, the operating system kernel may first check a hardware register of the storage device to determine whether the storage device is re-mounted as read-only due to a hardware failure of the storage device (see the foregoing embodiment for a specific implementation method), and if it is determined that the storage device is not re-mounted as read-only due to a hardware failure of the storage device, then send a second notification message to the application framework layer.
In order to more clearly understand the above embodiments of the present application, a detailed description is given below of an implementation method of the embodiments of the present application, taking a linux system as an example.
Referring to fig. 3, a schematic view of a storage device mount management process under the linux system according to an embodiment of the present application, as shown in the figure, the process may include:
s301: detecting the file system state of the directory mounted by the storage device by an operating system kernel (hereinafter referred to as linux kernel), and if the storage device is determined to be re-mounted as read-only according to the detection result, turning to S302;
s302: the linux kernel sends a first notification message to a mount management module in an application program framework layer;
s303: a mount management module in an application framework layer receives a first notification message, and notifies an application program in an application layer to stop accessing the storage device according to the first notification message;
s303: the linux kernel checks a hardware register of the storage device, if the hardware register of the storage device is judged to be reloaded to be read only due to hardware faults of the storage device according to the checking result, the step is switched to S304, and if the hardware register of the storage device is not reloaded to be read only due to hardware faults of the storage device, the step is switched to S305;
s304: the linux kernel informs a mount management module in an application program framework layer that the storage equipment has a hardware fault, and the mount management module informs an application program in an application program layer of the information;
s305: the linux kernel sends a second notification message to a mount management module in the application program framework layer;
s306: receiving the second notification message by the mount management module in the application framework layer, unloading the storage device which is re-mounted as read-only according to the notification message, repairing the file system error, if the repair is successful, turning to S307, otherwise, turning to S308;
s307: the storage device is reinstalled, and an application program is informed to restore the access to the storage device;
s308: and the mounting management module in the application framework layer informs the application file system fault in the application layer.
Based on the same technical concept, the embodiment of the present application further provides a storage device mount management apparatus, which can implement the storage device mount management process in the foregoing embodiment.
Referring to fig. 4, which is a schematic structural diagram of a storage device mount management apparatus according to an embodiment of the present application, as shown in the drawing, the base station may include: an operating system kernel 401, and an application framework layer 403.
The operating system kernel 401 is configured to detect a file system state of a directory mounted by the storage device, and send a first notification message to the application framework layer 402 when it is determined, according to a detection result, that the storage device is re-mounted as read-only. The application framework layer 402 is configured to notify the application to stop accessing the storage device that is reloaded to be read-only according to the first notification message.
Optionally, the operating system kernel 401 is further configured to: when the storage equipment is judged to be re-mounted as read-only according to the detection result, checking a hardware register of the storage equipment; and if the hardware register of the storage device is set to be read only by the hardware controller, notifying the application framework layer 402 that the storage device has a hardware fault.
Optionally, the operating system kernel 401 is further configured to: and when the storage device is determined to be re-mounted only in reading according to the detection result, sending a second notification message to the application framework layer 402. The application framework layer 402 is further configured to uninstall the storage device according to the second notification message, repair a file system error, and after the file system is successfully repaired, re-mount the storage device; and notifying the application to resume access to the storage device.
Optionally, the application framework layer 402 is further configured to: and if the file system repair fails, notifying the application program that the file system is wrong.
Optionally, the first notification message carries indication information of the storage device, or carries indication information of a directory to which the storage device is mounted.
Based on the same technical concept, the embodiment of the present application further provides an apparatus, which can implement the storage device mount management process in the foregoing embodiment. The apparatus may be a terminal.
Referring to fig. 5, a schematic structural diagram of an apparatus provided in an embodiment of the present application is shown, where the apparatus may include: a processor 501, a memory 502, and a bus interface 503.
The processor 501 is responsible for managing the bus architecture and general processing, and the memory 502 may store data used by the processor 501 in performing operations.
The bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented by processor 501, and various circuits, represented by memory 502, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. Bus interface 504 provides an interface. The processor 501 is responsible for managing the bus architecture and general processing, and the memory 502 may store data used by the processor 501 in performing operations.
The process disclosed in the embodiment of the present invention may be applied to the processor 501, or implemented by the processor 501. In implementation, the steps of the process flow may be performed by instructions in the form of hardware, integrated logic circuits, or software in the processor 501. The processor 501 may be a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the processing flow in combination with the hardware thereof.
Specifically, the processor 501 is configured to read the program in the memory 502 and execute:
an operating system kernel in the processor 501 detects a file system state of a directory mounted by a storage device, and when judging that the storage device is re-mounted as read-only according to a detection result, executes the following steps: sending a first notification message to an application framework layer; and the application program framework layer in the processor informs an application program to stop accessing the storage equipment which is re-mounted to be read only according to the first notification message.
Specific implementation of the process can be referred to the related description of the foregoing embodiments, and will not be repeated here.
Based on the same technical concept, the embodiment of the application also provides a computer storage medium. The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the processes performed by the foregoing embodiments.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (8)

1. A mounting management method for a storage device is characterized by comprising the following steps:
the method comprises the following steps that an operating system kernel detects the file system state of a directory mounted by a storage device, and when judging that the storage device is re-mounted as read-only according to a detection result, the operating system kernel executes the following steps:
sending a first notification message to an application framework layer;
the application framework layer informs an application program to stop accessing the storage equipment which is re-mounted to be read only according to the first notification message;
the method further comprises the following steps:
the operating system kernel sends a second notification message to the application program framework layer;
the application program framework layer unloads the storage equipment according to the second notification message, repairs file system errors, and re-mounts the storage equipment after the file system is successfully repaired;
and the application program framework layer informs the application program to restore the access to the storage device.
2. The method of claim 1, wherein when the operating system kernel determines that the storage device is re-mounted as read-only according to the detection result, further comprising:
checking a hardware register of the storage device;
and if the hardware register of the storage device is set to be read only by a hardware controller, notifying the application program framework layer that the storage device has a hardware fault.
3. The method of claim 1, wherein if the file system repair fails, further comprising:
the application framework layer notifies the application of a file system error.
4. The method according to any one of claims 1 to 3, wherein the first notification message carries indication information of the storage device or indication information of a directory to which the storage device is mounted.
5. A storage device mount management apparatus, comprising: an operating system kernel and an application framework layer;
the operating system kernel is used for detecting the file system state of the directory mounted by the storage device, and sending a first notification message to the application program framework layer when the storage device is judged to be re-mounted only in reading according to the detection result;
the application framework layer is used for notifying an application program to stop accessing the storage equipment which is re-mounted to be read only according to the first notification message;
the operating system kernel is further configured to:
when the storage device is judged to be re-mounted only in reading according to the detection result, sending a second notification message to the application program framework layer;
the application framework layer is further used for unloading the storage device according to the second notification message, repairing a file system error, and after the file system is successfully repaired, re-mounting the storage device; and notifying the application to resume access to the storage device.
6. The apparatus of claim 5, wherein the operating system kernel is further to:
when the storage equipment is judged to be re-mounted as read-only according to the detection result, checking a hardware register of the storage equipment;
and if the hardware register of the storage device is set to be read only by a hardware controller, notifying the application program framework layer that the storage device has a hardware fault.
7. An apparatus, comprising: a processor, a memory; the processor is used for reading the program in the memory and executing:
an operating system kernel in the processor detects the file system state of a directory mounted by the storage device, and executes the following steps when judging that the storage device is re-mounted only in reading according to the detection result:
sending a first notification message to an application framework layer;
an application framework layer in the processor informs an application program to stop accessing the storage equipment which is re-mounted to be read only according to the first notification message;
the operating system kernel in the processor is also used for sending a second notification message to the application framework layer;
the application framework layer is further used for unloading the storage device according to the second notification message, repairing a file system error, and after the file system is successfully repaired, re-mounting the storage device; and notifying the application to resume access to the storage device.
8. A computer-readable storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 4.
CN201810596862.3A 2018-06-11 2018-06-11 Mounting management method and device for storage equipment Active CN109086079B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810596862.3A CN109086079B (en) 2018-06-11 2018-06-11 Mounting management method and device for storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810596862.3A CN109086079B (en) 2018-06-11 2018-06-11 Mounting management method and device for storage equipment

Publications (2)

Publication Number Publication Date
CN109086079A CN109086079A (en) 2018-12-25
CN109086079B true CN109086079B (en) 2021-05-11

Family

ID=64839884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810596862.3A Active CN109086079B (en) 2018-06-11 2018-06-11 Mounting management method and device for storage equipment

Country Status (1)

Country Link
CN (1) CN109086079B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020223862A1 (en) * 2019-05-05 2020-11-12 深圳市欢太科技有限公司 Mounting processing method and apparatus, electronic device, and computer readable storage medium
CN111078658B (en) * 2019-10-31 2022-08-12 苏州浪潮智能科技有限公司 Method and device for mounting cluster file system
CN113642010B (en) * 2020-04-27 2024-04-26 青岛海信移动通信技术有限公司 Method for acquiring data of extended storage device and mobile terminal
CN112328173A (en) * 2020-10-27 2021-02-05 中国建设银行股份有限公司 Distributed storage system disk fault repairing method and device
CN112562774B (en) * 2020-12-14 2024-02-23 深圳市网心科技有限公司 Storage device mounting method and device, computer device and storage medium
CN112685084A (en) * 2020-12-21 2021-04-20 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN113835857B (en) * 2021-09-18 2024-04-02 青岛海信移动通信技术有限公司 Mounting method, device, equipment and medium of external storage equipment
CN114443582B (en) * 2021-12-22 2022-11-29 科东(广州)软件科技有限公司 File system mounting method, device, equipment and medium on operating system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100043015A1 (en) * 2008-08-13 2010-02-18 Mcclements Scott M Efficient management of customized functionality within shared data objects
CN106126382A (en) * 2016-06-29 2016-11-16 北京小米移动软件有限公司 Identify the method and device of file system error
CN107943605A (en) * 2017-11-14 2018-04-20 青岛海信移动通信技术股份有限公司 A kind of storage card processing method and processing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100043015A1 (en) * 2008-08-13 2010-02-18 Mcclements Scott M Efficient management of customized functionality within shared data objects
CN106126382A (en) * 2016-06-29 2016-11-16 北京小米移动软件有限公司 Identify the method and device of file system error
CN107943605A (en) * 2017-11-14 2018-04-20 青岛海信移动通信技术股份有限公司 A kind of storage card processing method and processing device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
linux文件系统只读原因和监控脚本监控文件系统只读;高耀华;《https://blog.csdn.net》;20140224;第1-2页 *

Also Published As

Publication number Publication date
CN109086079A (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN109086079B (en) Mounting management method and device for storage equipment
CN109670319B (en) Server flash safety management method and system thereof
CN106775610B (en) Electronic equipment starting method and electronic equipment
CN105260655A (en) Application program starting protection method, device and system
CN108121560A (en) Difference bag upgrade method, device, terminal and computer readable storage medium
CN107943605B (en) Memory card processing method and device
CN109766140A (en) A kind of localization method and device that set-top box starting is abnormal
CN113672306B (en) Server component self-checking abnormity recovery method, device, system and medium
CN103713916A (en) Automatic application program running method and automatic application program running system in Windows embedded system
CN108920338A (en) A kind of method and terminal indicating file system state
US20230087221A1 (en) Detection fields of view
CN113412480B (en) Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
CN108845772B (en) Hard disk fault processing method, system, equipment and computer storage medium
CN110968456B (en) Method and device for processing fault disk in distributed storage system
CN108595292B (en) System optimization method, mobile terminal and computer storage medium
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN112817796A (en) Board setting method, board resetting method, device, equipment and storage medium
CN114153503A (en) BIOS control method, device and medium
CN110659052B (en) Method and system for updating system software in network equipment and readable storage medium
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium
CN103106089B (en) A kind of upgrade method of intelligent platform management controller and system
CN105278993A (en) Linux system based drive module upgrading method and apparatus
CN104932885A (en) Information processing method and electronic equipment
CN110476153A (en) The method and electronic equipment of access instruction SRAM
CN116991710B (en) Automatic test method and system, electronic equipment and storage medium thereof

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Patentee before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.