CN111813748A - File system mounting method and device, electronic equipment and storage medium - Google Patents
File system mounting method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111813748A CN111813748A CN202010663406.3A CN202010663406A CN111813748A CN 111813748 A CN111813748 A CN 111813748A CN 202010663406 A CN202010663406 A CN 202010663406A CN 111813748 A CN111813748 A CN 111813748A
- Authority
- CN
- China
- Prior art keywords
- file system
- shutdown
- state information
- read
- write
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000001514 detection method Methods 0.000 claims abstract description 53
- 230000002159 abnormal effect Effects 0.000 claims abstract description 39
- 230000008569 process Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 8
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000005856 abnormality Effects 0.000 description 11
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0706—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
- G06F11/0727—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/122—File system administration, e.g. details of archiving or snapshots using management policies
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a mounting method of a file system, which is applied to target equipment and comprises the following steps: when a starting-up instruction is received, reading equipment state information from a target file; judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information; judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information; if the last shutdown of the target equipment is abnormal shutdown and the file system has data read-write operation during the last shutdown, executing abnormal detection operation on the file system; and if the file system is not abnormal, performing mount operation on the file system. According to the file system mounting method and device, the mounting efficiency of the file system can be improved on the premise that the safety of the file system is guaranteed. The application also discloses a mounting device of the file system, an electronic device and a storage medium, and the mounting device, the electronic device and the storage medium have the beneficial effects.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for mounting a file system, an electronic device, and a storage medium.
Background
In the existing storage management system, there are two mainstream file system mount modes, one is direct mount in the boot process, and the other is to execute the detection of the file system in the boot process, and if the file system is detected to have abnormality, the file system is repaired. The two file system mounting methods have certain disadvantages, the first method does not carry out file system detection until the file system is damaged and then is manually repaired, the second method has higher safety, but the file system detection is carried out at each starting time, so that time and labor are wasted, the file system detection possibly takes a long time, and the resource waste is caused by each detection.
Therefore, how to improve the mount efficiency of the file system on the premise of ensuring the security of the file system is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The present application aims to provide a method and an apparatus for mounting a file system, an electronic device, and a storage medium, which can improve the mounting efficiency of the file system on the premise of ensuring the security of the file system.
In order to solve the above technical problem, the present application provides a mounting method of a file system, which is applied to a target device, and the mounting method of the file system includes:
when a starting-up instruction is received, reading equipment state information from a target file; the equipment state information comprises shutdown state information and read-write state information;
judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information;
judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information;
if the last shutdown of the target equipment is abnormal shutdown and the file system has data read-write operation during the last shutdown, executing abnormal detection operation on the file system;
and if the file system is not abnormal, performing mounting operation on the file system.
Optionally, the method further includes:
after a shutdown instruction is received, judging whether the shutdown process of the target equipment meets a preset condition or not;
if so, judging that the target equipment is normally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a first preset value;
if yes, judging that the target equipment is abnormally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a second preset value.
Optionally, the determining whether the shutdown process of the target device meets a preset condition includes:
judging whether the file system is unloaded or not;
judging whether a logical volume manager of the target equipment is closed or not;
and if the file system is unloaded and the logical volume manager is closed, judging that the shutdown process of the target equipment meets the preset condition.
Optionally, determining whether the last shutdown of the target device is a normal shutdown according to the shutdown state information includes:
judging whether the value of a shutdown flag bit in the shutdown state information is the first preset value or not;
if yes, judging that the last shutdown of the target equipment is a normal shutdown;
if not, judging that the last shutdown of the target equipment is abnormal shutdown.
Optionally, the method further includes:
after mounting the file system, detecting whether the file system has data read-write operation according to a preset period;
if so, setting the value of the read-write flag bit in the read-write state information to be a third preset value;
if not, setting the value of the read-write flag bit in the read-write state information as a fourth preset value;
optionally, determining whether a file system has data read-write operation when the target device is powered off last time according to the read-write state information includes:
judging whether the value of the read-write flag bit in the read-write state information is a third preset value or not;
if yes, judging that the file system has data read-write operation when the target equipment is shut down last time;
if not, judging that the file system does not have data read-write operation when the target equipment is shut down last time.
Optionally, the method further includes:
if the last shutdown of the target equipment is a normal shutdown, performing mounting operation on the file system;
and if the file system does not have data reading and writing operation when the target device is powered off last time, carrying out mounting operation on the file system.
The present application further provides a mounting device of a file system, the device including:
the state reading module is used for reading equipment state information from the target file when a starting-up instruction is received; the equipment state information comprises shutdown state information and read-write state information;
the shutdown state detection module is used for judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information;
the read-write state detection module is used for judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information;
the abnormal detection module is used for executing abnormal detection operation on the file system if the target device is abnormally shut down last time and the file system has data read-write operation during the last shut down;
and the file system mounting module is used for executing mounting operation on the file system if the file system has no abnormity.
The application also provides a storage medium, on which a computer program is stored, which when executed implements the steps performed by the mount method of the file system.
The application also provides an electronic device, which comprises a memory and a processor, wherein the memory is stored with a computer program, and the processor realizes the steps executed by the mounting method of the file system when calling the computer program in the memory.
The application provides a mounting method of a file system, which is applied to target equipment and comprises the following steps: when a starting-up instruction is received, reading equipment state information from a target file; the equipment state information comprises shutdown state information and read-write state information; judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information; judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information; if the last shutdown of the target equipment is abnormal shutdown and the file system has data read-write operation during the last shutdown, executing abnormal detection operation on the file system; and if the file system is not abnormal, performing mounting operation on the file system.
According to the method and the device, the device state information is read from the target file after the starting instruction is received, and the shutdown state and the read-write state of the target device can be determined according to the device state information. Whether the last shutdown of the target equipment is normal can be judged according to the shutdown state information, and whether the file system executes data read-write operation when the target equipment is shutdown last can be judged according to the read-write state information. If the target device is normally shut down, the abnormal detection operation can not be executed on the file system; if the target device does not have data read-write operation during the last shutdown, the abnormal detection operation on the file system is not executed; the last shutdown of the target device is an abnormal shutdown, and when the file system has data read-write operation during the last shutdown, it is described that the file system may have read-write operation abnormality during the last shutdown, an abnormality detection operation needs to be performed on the file system, and a mount operation is performed on the file system after the abnormality of the file system is detected. According to the file system mounting scheme, the probability of missed detection and invalid detection can be reduced, and the mounting efficiency of the file system can be improved on the premise of ensuring the safety of the file system. The application also provides a mounting device of the file system, an electronic device and a storage medium, and the mounting device, the electronic device and the storage medium have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for mounting a file system according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a mounting device of a file system according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a method for mounting a file system according to an embodiment of the present application.
The specific steps may include:
s101: when a starting-up instruction is received, reading equipment state information from a target file;
the present embodiment may be applied to a server, a computer, and other target devices, and after receiving a power-on instruction, the target device may read device state information from a target file. The device state information is information for describing a state of the target device at the last shutdown (i.e., the latest shutdown). Specifically, the device state information may include shutdown state information and read/write state information. The shutdown state information is information describing a shutdown process of the target device when the target device is last shutdown, and the read-write state information is information describing whether a file system of the target device is executing read-write operation at a certain time. The target file may be a file stored in the target device, and the target file may also be a file stored in another device connected to the target device, and the storage location of the target file is not limited in this embodiment.
S102: judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information;
after the device state information is obtained, the present embodiment may determine the shutdown state information according to the device state information, and further determine whether the last shutdown of the target device is a normal shutdown by analyzing the shutdown state information. Specifically, the shutdown state information records a shutdown process of the target device when the target device is last shutdown, the shutdown process of the target device when the target device is last shutdown can be compared with a standard shutdown process, if the shutdown process of the target device when the target device is last shutdown is the same as the standard shutdown process, the last shutdown can be determined as normal shutdown, and if the shutdown process of the target device when the target device is last shutdown is not the same as the standard shutdown, the last shutdown can be determined as.
S103: judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information;
after the device state information is obtained, the read-write state information may be determined according to the device state information, and whether a file system has data read-write operation when the target device is powered off last time is determined by analyzing the read-write state information. The read-write state information may record the time of each data read-write operation of the file system, that is, it may be determined that the file system performs the data read-write operation at a certain time according to the read-write state information. Specifically, this embodiment may determine, according to the read-write state information, whether the file system has a data read-write operation when the target device is last powered off, that is, whether the file system is executing the data read-write operation when the target device is last powered off.
S104: if the last shutdown of the target equipment is abnormal shutdown and the file system has data read-write operation during the last shutdown, executing abnormal detection operation on the file system;
if the target device is normally powered off after last power off, the file system is not abnormal no matter whether data read-write operation exists during last power off of the file system; if the file system does not perform the data read-write operation when the target device is last powered off, the file system will not have an exception no matter whether the last power off of the file system is a normal power off. Therefore, in this embodiment, on the basis of detecting the shutdown state in S102 and detecting the read-write state during shutdown in S103, if it is detected that the previous shutdown of the target device is an abnormal shutdown and the data read-write operation exists in the file system during the previous shutdown, it is described that the file system may be abnormal and the abnormality detection operation needs to be performed on the file system. When the file system is performing read-write operations, the target device is abnormally shut down, which may cause data in the file system to be damaged or lost, and at this time, an abnormal detection operation may be performed on the file system.
As a possible implementation manner, if the last shutdown of the target device is a normal shutdown, performing mount operation on the file system; and if the file system does not have data reading and writing operation when the target device is powered off last time, carrying out mounting operation on the file system.
S105: and if the file system is not abnormal, performing mount operation on the file system.
According to the method and the device, when the target device is normally shut down or abnormal power failure occurs but the file system does not have data writing, the file system is not subjected to abnormal detection, and the file system is directly mounted.
In this embodiment, after receiving the boot instruction, the device state information is read from the target file, and the shutdown state and the read-write state of the target device can be determined according to the device state information. Whether the last shutdown of the target equipment is normal can be judged according to the shutdown state information, and whether the file system executes data read-write operation when the target equipment is shutdown last can be judged according to the read-write state information. If the target device is normally shut down, the abnormal detection operation can not be executed on the file system; if the target device does not have data read-write operation during the last shutdown, the abnormal detection operation on the file system is not executed; the last shutdown of the target device is an abnormal shutdown, and when the file system has data read-write operation during the last shutdown, it is described that the file system may have read-write operation abnormality during the last shutdown, an abnormality detection operation needs to be performed on the file system, and a mount operation is performed on the file system after the abnormality of the file system is detected. The file system mounting scheme of the embodiment can reduce the probability of missed detection and invalid detection, and can improve the mounting efficiency of the file system on the premise of ensuring the safety of the file system.
As a further introduction to the corresponding embodiment of fig. 1, the process of constructing the device state information may include: after a shutdown instruction is received, judging whether the shutdown process of the target equipment meets a preset condition or not; if so, judging that the target equipment is normally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a first preset value; if yes, judging that the target equipment is abnormally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a second preset value. According to the method, the shutdown state information comprises the shutdown flag bit, if the shutdown process of the target device meets the preset condition, the value of the shutdown flag bit is set to be a first preset value, and if the shutdown process of the target device does not meet the preset condition, the value of the shutdown flag bit is set to be a second preset value.
Further, the process of determining whether the shutdown process of the target device meets the preset condition may include: judging whether the file system is unloaded or not; judging whether a logical volume manager of the target equipment is closed or not; and if the file system is unloaded and the logical volume manager is closed, judging that the shutdown process of the target equipment meets the preset condition.
Correspondingly, the process of judging whether the last shutdown of the target device is a normal shutdown according to the shutdown state information may be: judging whether the value of a shutdown flag bit in the shutdown state information is the first preset value or not; if yes, judging that the last shutdown of the target equipment is a normal shutdown; if not, judging that the last shutdown of the target equipment is abnormal shutdown. By the mode that whether the target equipment is normally shut down is determined according to the value of the shutdown flag bit, the efficiency of detecting the shutdown state can be improved.
As a further introduction to the corresponding embodiment of fig. 1, the process of constructing the device state information may include: after mounting the file system, detecting whether the file system has data read-write operation according to a preset period; if so, setting the value of the read-write flag bit in the read-write state information to be a third preset value; and if not, setting the value of the read-write zone bit in the read-write state information as a fourth preset value. Correspondingly, the process of determining whether the file system has data read-write operation when the target device is powered off last time according to the read-write state information may include: judging whether the value of the read-write flag bit in the read-write state information is a third preset value or not; if yes, judging that the file system has data read-write operation when the target equipment is shut down last time; if not, judging that the file system does not have data read-write operation when the target equipment is shut down last time. By the method for determining whether the file system has data read-write operation when the target device is powered off last time according to the value of the read-write zone bit, the efficiency of detecting the read-write state can be improved.
In the embodiment, the normal shutdown flag is set during normal shutdown, whether data read-write exists in the file system is detected according to a preset period in a startup state, and the data read-write is marked and recorded in the target file, and when the system is started, the shutdown flag bit and the read-write flag bit are read and the file system detection is judged whether to be carried out through certain logic processing, so that detection is never missed, invalid detection is never carried out, and efficient file system detection is really realized.
The flow described in the above embodiment is explained below by an embodiment in practical use. The embodiment provides a method for detecting an efficient file system, which comprises the following steps:
step 1, compiling a script and adding the script into a timed task of a Linux server, executing the script once every five minutes, detecting whether the existing file system has data reading and writing, and storing a detection result into a file.
And 2, writing a normal shutdown mark into the file after the file system is normally unloaded and the LVM (Logical Volume Manager) is normally closed in the shutdown process.
Step 3, when the storage server is started, adding logic at the mounting logic of the file system, wherein the specific logic is as follows: the storage server has a normal shutdown mark and directly skips file system detection; the storage server does not have a normal shutdown mark, but the file system does not have data reading and writing, and the file system detection is skipped at the moment; and only when the storage server has no normal shutdown mark and the file system has data reading and writing, carrying out file system detection.
According to the embodiment, the normal shutdown mark and the file system read-write mark are added when the storage server is shut down, the marks are read and logically processed when the storage server is started, and the file system is not detected and directly mounted when the server is normally shut down or abnormally powered off but the file system has no data write, so that the file system is prevented from being detected every time the storage server is started, and the situation that the large-capacity file system is not mounted after the storage server is started due to overlong detection time is avoided. By the file system detection mode, the file system detection is not required to be carried out every time the computer is started, and the mounting efficiency of the file system is improved.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a mounting device of a file system according to an embodiment of the present disclosure;
the apparatus may include:
the state reading module 100 is configured to read device state information from a target file when a power-on instruction is received; the equipment state information comprises shutdown state information and read-write state information;
a shutdown state detection module 200, configured to determine whether a last shutdown of the target device is a normal shutdown according to the shutdown state information;
a read-write state detection module 300, configured to determine, according to the read-write state information, whether a file system has data read-write operation when the target device is last powered off;
an anomaly detection module 400, configured to perform an anomaly detection operation on the file system if the last shutdown of the target device is an anomaly shutdown and there is a data read-write operation in the file system when the target device is last shutdown;
the file system mount module 500 is configured to perform a mount operation on the file system if the file system is not abnormal.
In this embodiment, after receiving the boot instruction, the device state information is read from the target file, and the shutdown state and the read-write state of the target device can be determined according to the device state information. Whether the last shutdown of the target equipment is normal can be judged according to the shutdown state information, and whether the file system executes data read-write operation when the target equipment is shutdown last can be judged according to the read-write state information. If the target device is normally shut down, the abnormal detection operation can not be executed on the file system; if the target device does not have data read-write operation during the last shutdown, the abnormal detection operation on the file system is not executed; the last shutdown of the target device is an abnormal shutdown, and when the file system has data read-write operation during the last shutdown, it is described that the file system may have read-write operation abnormality during the last shutdown, an abnormality detection operation needs to be performed on the file system, and a mount operation is performed on the file system after the abnormality of the file system is detected. The file system mounting scheme of the embodiment can reduce the probability of missed detection and invalid detection, and can improve the mounting efficiency of the file system on the premise of ensuring the safety of the file system.
Further, the method also comprises the following steps:
the shutdown flag setting module is used for judging whether the shutdown process of the target equipment meets a preset condition or not after receiving a shutdown instruction; if so, judging that the target equipment is normally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a first preset value; if yes, judging that the target equipment is abnormally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a second preset value.
Further, the step of judging whether the shutdown process of the target device meets the preset condition by the shutdown flag setting module includes: judging whether the file system is unloaded or not; judging whether a logical volume manager of the target equipment is closed or not; and if the file system is unloaded and the logical volume manager is closed, judging that the shutdown process of the target equipment meets the preset condition.
Further, the shutdown state detection module 200 is configured to determine whether a value of a shutdown flag in the shutdown state information is the first preset value; if yes, judging that the last shutdown of the target equipment is a normal shutdown; if not, judging that the last shutdown of the target equipment is abnormal shutdown.
Further, the method also comprises the following steps:
the read-write flag bit setting module is used for detecting whether the file system has data read-write operation according to a preset period after the file system is mounted; if so, setting the value of the read-write flag bit in the read-write state information to be a third preset value; and if not, setting the value of the read-write zone bit in the read-write state information as a fourth preset value.
Further, the read-write state detection module 300 is configured to determine whether a value of a read-write flag bit in the read-write state information is a third preset value; if yes, judging that the file system has data read-write operation when the target equipment is shut down last time; if not, judging that the file system does not have data read-write operation when the target equipment is shut down last time.
Further, the file system mount module 500 is further configured to perform mount operation on the file system if the last shutdown of the target device is a normal shutdown; and the device is also used for executing mounting operation on the file system if the file system has no data read-write operation when the target device is shut down last time.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
The present application also provides a storage medium having a computer program stored thereon, which when executed, may implement the steps provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The application further provides an electronic device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the electronic device may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Claims (10)
1. A mounting method of a file system is applied to a target device, and comprises the following steps:
when a starting-up instruction is received, reading equipment state information from a target file; the equipment state information comprises shutdown state information and read-write state information;
judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information;
judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information;
if the last shutdown of the target equipment is abnormal shutdown and the file system has data read-write operation during the last shutdown, executing abnormal detection operation on the file system;
and if the file system is not abnormal, performing mounting operation on the file system.
2. The mounting method according to claim 1, further comprising:
after a shutdown instruction is received, judging whether the shutdown process of the target equipment meets a preset condition or not;
if so, judging that the target equipment is normally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a first preset value;
if yes, judging that the target equipment is abnormally shut down, and setting the value of a shutdown flag bit in the shutdown state information as a second preset value.
3. The mount method according to claim 2, wherein determining whether the shutdown process of the target device meets a preset condition comprises:
judging whether the file system is unloaded or not;
judging whether a logical volume manager of the target equipment is closed or not;
and if the file system is unloaded and the logical volume manager is closed, judging that the shutdown process of the target equipment meets the preset condition.
4. The mount method according to claim 2, wherein determining whether the last shutdown of the target device is a normal shutdown according to the shutdown state information includes:
judging whether the value of a shutdown flag bit in the shutdown state information is the first preset value or not;
if yes, judging that the last shutdown of the target equipment is a normal shutdown;
if not, judging that the last shutdown of the target equipment is abnormal shutdown.
5. The mounting method according to claim 1, further comprising:
after mounting the file system, detecting whether the file system has data read-write operation according to a preset period;
if so, setting the value of the read-write flag bit in the read-write state information to be a third preset value;
and if not, setting the value of the read-write zone bit in the read-write state information as a fourth preset value.
6. The mount method according to claim 5, wherein determining whether a file system has a data read/write operation when the target device is last powered off according to the read/write state information comprises:
judging whether the value of the read-write flag bit in the read-write state information is a third preset value or not;
if yes, judging that the file system has data read-write operation when the target equipment is shut down last time;
if not, judging that the file system does not have data read-write operation when the target equipment is shut down last time.
7. The mounting method according to claim 1, further comprising:
if the last shutdown of the target equipment is a normal shutdown, performing mounting operation on the file system;
and if the file system does not have data reading and writing operation when the target device is powered off last time, carrying out mounting operation on the file system.
8. A mounting apparatus for a file system, comprising:
the state reading module is used for reading equipment state information from the target file when a starting-up instruction is received; the equipment state information comprises shutdown state information and read-write state information;
the shutdown state detection module is used for judging whether the last shutdown of the target equipment is normal or not according to the shutdown state information;
the read-write state detection module is used for judging whether the file system has data read-write operation when the target equipment is powered off last time according to the read-write state information;
the abnormal detection module is used for executing abnormal detection operation on the file system if the target device is abnormally shut down last time and the file system has data read-write operation during the last shut down;
and the file system mounting module is used for executing mounting operation on the file system if the file system has no abnormity.
9. An electronic device, comprising a memory in which a computer program is stored and a processor, wherein the processor implements the steps of the mount method of the file system according to any one of claims 1 to 7 when calling the computer program in the memory.
10. A storage medium having stored thereon computer-executable instructions which, when loaded and executed by a processor, carry out the steps of a method of mounting a file system according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010663406.3A CN111813748B (en) | 2020-07-10 | 2020-07-10 | File system mounting method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010663406.3A CN111813748B (en) | 2020-07-10 | 2020-07-10 | File system mounting method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111813748A true CN111813748A (en) | 2020-10-23 |
CN111813748B CN111813748B (en) | 2022-06-07 |
Family
ID=72843472
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010663406.3A Active CN111813748B (en) | 2020-07-10 | 2020-07-10 | File system mounting method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111813748B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093140A (en) * | 2023-07-12 | 2023-11-21 | 荣耀终端有限公司 | Method and device for controlling shutdown of electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2358807C (en) * | 1989-09-08 | 2005-11-01 | Auspex Systems, Inc. | Multiple software-facility component operating system for co-operative processor control within a multiprocessor computer system |
CN101706822A (en) * | 2009-12-18 | 2010-05-12 | 杭州迪普科技有限公司 | Method and device for improving speed of mounting journal file system |
CN101706783A (en) * | 2009-11-16 | 2010-05-12 | 中兴通讯股份有限公司 | Method and device for checking and repairing files in embedded equipment |
CN107463652A (en) * | 2017-07-27 | 2017-12-12 | 北京小米移动软件有限公司 | The connection control method and device of external storage equipment |
CN108646982A (en) * | 2018-05-04 | 2018-10-12 | 广东电网有限责任公司电力科学研究院 | A kind of data self-repairing method and device based on UBIFS |
CN110647507A (en) * | 2019-09-12 | 2020-01-03 | 苏州浪潮智能科技有限公司 | File system writing state determining method and device, electronic equipment and medium |
-
2020
- 2020-07-10 CN CN202010663406.3A patent/CN111813748B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2358807C (en) * | 1989-09-08 | 2005-11-01 | Auspex Systems, Inc. | Multiple software-facility component operating system for co-operative processor control within a multiprocessor computer system |
CN101706783A (en) * | 2009-11-16 | 2010-05-12 | 中兴通讯股份有限公司 | Method and device for checking and repairing files in embedded equipment |
CN101706822A (en) * | 2009-12-18 | 2010-05-12 | 杭州迪普科技有限公司 | Method and device for improving speed of mounting journal file system |
CN107463652A (en) * | 2017-07-27 | 2017-12-12 | 北京小米移动软件有限公司 | The connection control method and device of external storage equipment |
CN108646982A (en) * | 2018-05-04 | 2018-10-12 | 广东电网有限责任公司电力科学研究院 | A kind of data self-repairing method and device based on UBIFS |
CN110647507A (en) * | 2019-09-12 | 2020-01-03 | 苏州浪潮智能科技有限公司 | File system writing state determining method and device, electronic equipment and medium |
Non-Patent Citations (1)
Title |
---|
佘磊等: "轨道交通实时以太网交换机启动性能的分析与优化", 《计算机科学》, 15 November 2017 (2017-11-15), pages 284 - 288 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093140A (en) * | 2023-07-12 | 2023-11-21 | 荣耀终端有限公司 | Method and device for controlling shutdown of electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111813748B (en) | 2022-06-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20080127112A1 (en) | Software tracing | |
CN108170495B (en) | BIOS upgrading method, system, equipment and computer readable storage medium | |
CN101634960A (en) | Method for revising BIOS parameter and regenerating checksum | |
CN113409881B (en) | Flash memory erasure interrupt recovery test method and device, electronic equipment and storage medium | |
CN102369513A (en) | Method for improving stability of computer system and computer system | |
CN111813748B (en) | File system mounting method and device, electronic equipment and storage medium | |
CN109582332A (en) | The method for upgrading system and device of internet video camera | |
CN117931091B (en) | Abnormal power failure processing method, device, equipment, medium and product | |
CN114385418A (en) | Protection method, device, equipment and storage medium for communication equipment | |
CN112270945B (en) | Method, device, storage medium and terminal for recording power failure during erasing | |
KR101258589B1 (en) | Information storage medium recording data according to journaling file system, method and apparatus of writing/recovering data using journaling file system | |
CN113536320A (en) | Error information processing method, device and storage medium | |
CN111984195A (en) | Method and device for improving stability of embedded Linux system | |
CN111324486A (en) | Method and system for repairing hanging die of expander chip and related device | |
CN116627737A (en) | Hard disk testing method, device, equipment and medium | |
CN113127245B (en) | Method, system and device for processing system management interrupt | |
CN112908390B (en) | Data storage method, device, electronic equipment and storage medium | |
KR20110039416A (en) | Data storage method, apparatus and system for interrupted write recovery | |
CN108804033B (en) | Full-disk scanning method and device based on power-off continuation, computer equipment and medium | |
CN111338794A (en) | Memory out-of-range monitoring method and device and storage medium | |
CN110750375A (en) | Embedded equipment and abnormal information processing method thereof | |
CN111897720B (en) | Test scene identification method, test system, equipment and storage medium | |
CN109189328B (en) | Index table protection method suitable for NAND Flash controller | |
JPH06266573A (en) | Fault recovery information managing system | |
CN117762732A (en) | Method, script, device, equipment and medium for monitoring memory read-write |
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 |