CN106708960A - Restoration method for file system of NAS device and NAS device - Google Patents

Restoration method for file system of NAS device and NAS device Download PDF

Info

Publication number
CN106708960A
CN106708960A CN201611085516.6A CN201611085516A CN106708960A CN 106708960 A CN106708960 A CN 106708960A CN 201611085516 A CN201611085516 A CN 201611085516A CN 106708960 A CN106708960 A CN 106708960A
Authority
CN
China
Prior art keywords
nas device
file
file system
data cached
nas
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
Application number
CN201611085516.6A
Other languages
Chinese (zh)
Other versions
CN106708960B (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201611085516.6A priority Critical patent/CN106708960B/en
Publication of CN106708960A publication Critical patent/CN106708960A/en
Application granted granted Critical
Publication of CN106708960B publication Critical patent/CN106708960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1471Saving, restoring, recovering or retrying involving logging of persistent data for recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Abstract

The invention discloses a restoration method for a file system of an NAS device. When the NAS device is shut down, a special mark is added into a mark file in the device according to loss of cache data, and the special mark is used for indicating whether the device is normally shut down and whether the file system needs to be restored; before the file system is loaded when the device is started, first, the mark file is read to judge whether the special mark is in the mark file, and the file system is detected and restored if the special mark is not in the mark file. As a result, whether the file system needs to be restored can be judged automatically when the NAS device is started, and the file system is restored automatically when restoration is needed for the file system. Therefore, the situation that the file system needs to be detected and restored every time the NAS device is started is avoided, and resource cost and time cost for maintaining the NAS device are greatly saved. Meanwhile, the invention furthermore provides the NAS device.

Description

A kind of restorative procedure and NAS device of NAS device file system
Technical field
The present invention relates to communication technical field, more particularly to a kind of restorative procedure of NAS file system, while the application is also It is related to a kind of NAS device.
Background technology
With the swift and violent growth of data volume, people are increasing to the demand of data storage, the application of NAS storage devices, Can be very good to solve storage problem for enterprise.
NAS (Network Attached Storage), is translated into network attached storage or the network storage equipment, and it is A kind of exclusive data storage device, can be attached directly on network, be not required to be articulated in the rear end of server, it is to avoid increase to server I/O is loaded.NAS uses embedded systems software, there is provided cross-platform file-sharing, is capable of achieving data centralized management.
NAS not only has the advantages that the storage shared data of SAN and centralized management, simultaneously because it is based on the access of LAN Mode, the features such as with convenient and swift, low cost, compatibility good, convenient management is accessed, and then can largely save user into This.Nowadays, NAS has been increasingly becoming one of main selection of enterprises and institutions' network storage solutions.
The function of NAS mainly includes following two aspects, first, file-sharing, being that the NAS network storages are most basic answers With.NAS device can be found in number of ways such as " network neighbors ", and common file is stored in its share directory.This Outward, the also built-in file server function of the part NAS network storages, we can be by browser access and management NAS File, and uploaded in HTTP modes and download file, facilitate just as access software download site.
Second, data backup/disaster tolerance, most of NAS network storages are all with various backup functionalitys, including local backup (during the data on computer are backuped into NAS by LAN), remote backup are (standby by wide area network by the data on the computer of strange land Part in NAS) (replicate data between NAS and NAS) etc. is backed up and between NAS.
Mainly application is XFS systems to NAS file system at present, and XFS file system is a kind of high performance journal file system System.XFS is supported file system metadata there is provided daily record.When file system updates, metadata can be in actual disk block Daily record is sequentially written in before being updated.The daily record of XFS is stored on the cyclic buffer of disk block, will not be by normal file System operatio influences.XFS daily records can also be stored in the data field (referred to as built-in daily record) of file system, or one extra (to reduce disk operating) in equipment.Because most daily records and NAS file system maintenance processes remain on operating system delaying Area is deposited so as to result in following problem:
1st, powered-off fault or hanging equipment extremely cause NAS journal files or loss of data, and then cause NAS file system Damage.
2nd, medium occur bad for hard disk, generally results in NAS file system and loss of data occurs, is likely to cause NAS File system journal is lost so as to cause NAS file system corruptions.
In order to solve the above problems, prior art is by following two solutions:
1st, after encountering NAS file corruptions, using the manual method repaired.
2nd, after device power startup, no matter whether NAS file system is really damaged, and all NAS file system is examined Survey and repair.
Applicant has found that prior art at least has problems with during the application is realized:
For scheme 1:Repair manually and bring labor intensive material resources, while the influence business that the artificial reparation of wait can be permanent.
For scheme 2:Whether NAS files damage the method for all carrying out detecting reparation, have following problem:With hard The continuous expansion of disk capacity, more than nas resources self-capacity lifting to TB ranks, NAS files system is detected after causing device power Whether system is normal, and generally requires several hours the time required to reparation NAS file system.As long as device power is run, all can Automatically NAS file system is detected and is repaired, be in most cases that upper electricity is normally restarted or started shooting to equipment in itself, NAS file system is not damaged, in order to avoid powered-off fault in this case file system corruption and to all of device power Situation all carry out the reparation of NAS file system waste it is too big.
Therefore, the resource and time cost for how reducing NAS file system reparations are NAS managers technologies urgently to be resolved hurrily Problem.
The content of the invention
The invention provides a kind of restorative procedure of NAS device file system, when NAS device is closed, according to caching number According to loss situation add special marking on tab file in equipment, be used to point out equipment whether normal switching-off and file Whether system needs to repair;Before device power-up load document system, read tab file first, and according to special marking come Judge whether file system is damaged, and file system is detected and repaired when damaging.Have in the NAS device of the application Tab file, the method includes:
Before load document system is needed, the tab file is read;
Judge with the presence or absence of special marking in the tab file, the special marking is when the NAS device is closed Write-in;
If not existing special marking in the tab file, the file system is detected and repaired.
Preferably, also include:
If there is special marking in the tab file, the file system is loaded, and delete the special marking.
Preferably, the adding method of the special marking is as follows:
When the NAS device is closed, judge whether the data cached of the NAS device loses;
If the data cached of the NAS device is not lost, special marking is added on the tab file.
Preferably, the adding method of the special marking also includes:
If the data cached loss of the NAS device, judges whether the NAS device has power input;
If non-transformer is input into, keep the tab file constant;
If there is power input, judge it is described it is data cached whether normal process;
If the data cached normal process, special marking is added on the tab file;
If the data cached non-normal process, keeps the tab file constant.
Accordingly, present applicant proposes a kind of NAS device, there is tab file in NAS device, including:
Read module, before load document system is needed, reads the tab file;
Judge module, judges with the presence or absence of special marking in the tab file, the special marking is described in closing Write during NAS device;
Repair module, when not existing special marking in the tab file, is detected and is repaiied to the file system It is multiple.
Preferably, also include,
Operation module, when there is special marking in the tab file, loads the file system, and delete described Special marking.
Preferably, the adding method of the special marking is as follows:
When the NAS device is closed, judge whether the data cached of the NAS device loses;
If the data cached of the NAS device is not lost, special marking is added on the tab file.
Preferably, the adding method of the special marking also includes:
If the data cached loss of the NAS device, judges whether the NAS device has power input;
If non-transformer is input into, keep the tab file constant;
If there is power input, judge it is described it is data cached whether normal process;
If the data cached normal process, special marking is added on the tab file;
If the data cached non-normal process, keeps the tab file constant.
As can be seen here, by the technical scheme of application the application, when NAS device is closed, according to data cached loss Situation adds special marking on the tab file in equipment, be used to point out equipment whether normal switching-off and file system whether Need to repair;Before device power-up load document system, read in tab file judge mark file whether have special first Mark, is detected and is repaired to file system if without if.Therefore, it can whether the automatic decision when NAS device is started needs File system is repaired, and be repaired automatically when needing to repair it.So as to, it is to avoid each unlatching NAS It is required for that file system is detected and repaired during equipment, is greatly saved the resource and time cost for safeguarding NAS device.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the restorative procedure of NAS device file system proposed by the present invention;
Fig. 2 is the flow of the restorative procedure of a kind of specific NAS device file system that the application specific embodiment is proposed Figure;
Fig. 3 is a kind of flow chart of NAS device file system restorative procedure entirety that the application specific embodiment is proposed;
Fig. 4 is that the equipment that the application specific embodiment is proposed is performing the starting procedure of present specification system repair Figure;
Fig. 5 is that the equipment that the application specific embodiment is proposed is restarted in the order for performing present specification system repair Flow chart;
Fig. 6 is that the equipment that the application specific embodiment is proposed is performing the order shutdown of present specification system repair Flow chart;
Fig. 7 is that the equipment that the application specific embodiment is proposed is pulled out in the battery that has for performing present specification system repair Power supply (or equipment tamping machine) flow chart;
Fig. 8 is the adding method schematic flow sheet that the cachings at different levels that the application specific embodiment is proposed all lose flag bit;
Fig. 9 is the adding method flow signal that the cachings at different levels that the application specific embodiment is proposed all do not lose flag bit Figure;
Figure 10 is a kind of structural representation of NAS device that application is proposed.
Specific embodiment
As described in background, in use, the process of abnormal shutdown may result in system cache data to NAS device Loss, and then cause the damage of the file system of NAS device, have a strong impact on the normal of NAS device and use.It is above-mentioned in order to solve Technical problem, prior art has two kinds of solutions, first, after the file system corruption for finding NAS device, using repairing manually Multiple method;Second, after opening of device, no matter whether the file system of NAS device is damaged, and all file system is detected And repair.For method 1, manually repair need to expend substantial amounts of manpower and materials, while etc. it is to be repaired when waste plenty of time, shadow Normal business is rung.For method 2, file system is detected and is repaired when opening every time, not only wasted time and energy, and And in general the file system of equipment can normally be run, if all right when opening every time for a small number of several situations File system is detected and is repaired that the resource and waste of time for causing are too big really.
In order to solve problem present in the repair process of existing NAS device file system, present applicant proposes a kind of NAS The restorative procedure of installable file system, when equipment is closed, according to tab file of the data cached loss situation in equipment Upper addition special marking, to point out whether whether normal switching-off and file system need to repair equipment;In device power-up loading Before file system, tab file is read first, and judge whether file system is damaged according to special marking, and when damaging File system is detected and is repaired, such that it is able to realize it is intelligent file system is repaired, reduce file system Resource and time loss in repair process.
As shown in figure 1, the schematic flow sheet of the restorative procedure for a kind of NAS device file system of the application proposition, should Method includes:
S101, before load document system is needed, reads tab file.
In embodiments herein, in order to preferably judge that equipment (including is restarted, normal shutdown, has battery closing Pull out power supply, pull out power supply without battery) when, system it is data cached whether correct storage, in NAS device, add tab file, and And in each pass hull closure, special marking is added on tab file according to data cached storage situation.Special marking Effect is whether the data cached of system of pointing out correctly is stored.
In the preferred embodiment of the application, the adding method of special marking is as follows:
Step 1) when NAS device is closed, judge whether the data cached of NAS device loses;If the caching number of NAS device Step 2 is gone to according to not losing, if the data cached loss of NAS device goes to step 3.
The data cached of NAS device is generally divided into system cache, storage level caching and disk buffering.System cache is to set The caching that standby operation itself is divided, storage level caching is the caching that system partition caching is used for memory function, and disk delays Deposit the caching for disk read-write that i.e. disk is provided in itself.
Restarting, shut down, abnormal tamping machine or in the case of thering is battery to pull out power supply, NAS device all can automatically will be above-mentioned It is data cached to brush non volatile storage medium.In these cases, it is data cached typically to lose.But, without battery Abnormal tamping machine or in the case of pulling out power supply without battery, NAS device cannot complete the process of above-mentioned brush system cache data, therefore Three kinds mentioned above data cached all to lose substantially.
For case above, in order to accurately understand in pass hull closure, it is data cached whether correct storage, held in system Gone by it is data cached brush non volatile storage medium after, judge it is data cached whether the non volatile storage medium of correct transfer In, if not, then it is assumed that data cached loss, otherwise it is assumed that data cached do not lose.
Step 2) if the data cached of the NAS device is not lost, special marking is added on the tab file.
If the data cached of NAS device is not lost, i.e., the at different levels data cached of NAS device has all correctly brushed non-easy Lose storage medium to suffer, in this case, in secondary start next time, NAS device can be by data cached recovery, can Normally use, its file system is unaffected.Therefore, in this case need not be to file system perform detection simultaneously Repair.
Therefore in order to be marked to above-mentioned situation, NAS device is marked when judging to obtain data cached loss by reading Note file, and special marking is added on tab file, it is data cached to have obtained correct during with the closing for pointing out this secondary device Storage, the file system of equipment and be affected, it is not necessary to detected and repaired.
Step 3) if the data cached loss of the NAS device, judges whether the NAS device has power input, if There is power input then to go to step 4), go to step 5 if no power input).
If the at different levels data cached of the data cached loss of NAS device, i.e. NAS device does not all brush non-volatile correctly Storage medium is suffered, and in this case, equipment can also be further processed data cached, and can in start Restore it.But above-mentioned further processing procedure must can be performed in the case where NAS device has power input 's.
Therefore, can be completed to data cached in the case of data cached loss to preferably judge NAS device Treatment, it is determined that during data cached loss, first judging whether equipment has power input.
Step 4) if NAS device has power input, judge it is data cached whether normal process, if data cached obtain just Often treatment, then go to step 6, if data cached do not obtain normal process, goes to step 7.
If NAS device has power input, illustrate that NAS device has the ability to complete data cached further to treat Journey, but this also not necessarily ensure that NAS device can be processed successfully data cached.
Therefore, judging to obtain also needing to further judge NSA equipment to data cached when NAS device has power input Treatment whether succeed.So can accurately just know it is data cached can start when be restored, can further determine Whether need that file system is detected and repaired.
Step 5) if NAS device does not have power input, keep the tab file constant.
If NAS device does not have power input, illustrate that equipment can not be necessarily completed to data cached further place Reason process, it is data cached in this case to be bound to lose.Now, it will cause file system corruption, it is necessary in start File system is detected and is repaired, can just make NAS device recover normally to use.
Therefore, in order to by above-mentioned normal process can not can be obtained with data cached to data cached situation about being processed Situation mutually distinguish, NAS device judge obtain not having power input when, tab file will be kept constant, i.e., not to mark File does any treatment.
Step 6) if data cached obtain normal process, special marking is added on tab file.
As above step 4) it is described, even if NAS device has power input, also can not necessarily complete to enter one to data cached Step treatment, therefore must also obtain and further judge whether NAS device is correctly completed to data cached processing procedure, this Processing procedure enable to it is data cached next time start shooting when be restored.
If data cached obtain normal process, in this case, then illustrate NAS device in start next time, NAS device can normally use data cached recovery, and its file system is unaffected.Therefore, this In the case of to file system perform detection and need not repair.
Likewise, because NAS device is not affected, additionally it is possible to normally use, therefore in order to point out this feelings Condition, NAS device judge obtain it is data cached normally processed when, special marking will be added on tab file.
Step 7) if data cached do not obtain normal process, keep the tab file constant.
If data cached do not obtain normal process, in this case, then illustrate that NAS device will be slow in shutdown Deposit data is lost, and is difficult to be restored it in start.So, in start next time, NAS device can not delay Deposit data recovers, it is impossible to which enough normally to use, its file system can receive damage.Have in this case to file system System perform detection is simultaneously repaired.
Therefore, in order to can not can normally be recovered above-mentioned with data cached to data cached situation about being recovered Situation mutually distinguish, NAS device judge obtain not to it is data cached carry out normal process when, will keep tab file not Become, i.e., any treatment is not done to tab file.
As can be seen here, by the adding method of above-mentioned special marking, can fast and accurately judge NAS device when closed Whether correctly process data cached.It is further will need to detect NAS device and repaired with need not be right NAS device is detected mutually distinguish with the two kinds of situations repaired.By the addition of special marking, to whether needing to carry out equipment Detection and reparation improve important reference.
In embodiments herein, before NAS device start load document system, in order to accurately judge file system Whether system has damage, and first the tab file in NAS device is read out.And according to the situation of tab file, judge whether to need File system is detected and repaired.
S102, judges in the tab file with the presence or absence of special marking.
From the foregoing, in embodiments herein, when NAS device is closed, NAS device can be according to data cached Disposition, decides whether to add special marking in tab file.Also, stored by correct data cached and/or Equipment data cached adds special marking when can recover in tab file, and now the file system of NAS device will not be received To influence, therefore when starting shooting next time, it is not necessary to it is detected or is repaired.It is data cached loss and can not be extensive When multiple, holding tab file is constant, i.e., without special marking, now the file system of NAS device can be destroyed, therefore When starting shooting next time need that the file system of NAS device is detected and repaired.
As can be seen here, can be by judging whether to need to set NAS with the presence or absence of special marking in judge mark file Standby file system is detected and repaired.It is thus possible to fast and accurately judge whether to need to text when NAS device is opened Part system is detected and repaired, it is to avoid be required for detecting file system and repaired during each unlatching NAS device, pole Big saves the resource and time cost for safeguarding NAS device.
S103, if not existing special marking in tab file, is detected and is repaired to file system.
If not finding special marking in tab file, illustrate in last time pass hull closure, equipment it is data cached Lose and equipment has not been completed to data cached correct treatment, now to equipment during explanation last time pass hull closure yet File system damage.Therefore, need that the file system of equipment is detected and repaired in this case.
In the preferred embodiment of the application, detection and repair process to installable file system are comprised the following steps:
Step 1), inquire about file system path, and by file system successively be added to reparation queue in;
Step 2), umount (solution is hung) NAS file system;
Step 3), detected to repairing the file system in queue;
Step 4), judgement detects whether to pass through, if detection is by going to step 5), do not go to step if if detection 6);
Step 5), detected to repairing the next file system in queue, and go to step 4) judge to detect whether Pass through;
Step 6), list the operation for needing to repair;
Step 7), perform and repair file system;
Step 8) decided whether to perform the reparation to damaging data according to system configuration.
Can automatically be set in unlatching when damaging occurs in file system with flow, equipment is repaired by above-mentioned detection Repaired when standby, it is ensured that equipment can normally be run, be required for file when open every time NAS device so as to avoiding System detected and repaired, and is greatly saved the resource and time cost for safeguarding NAS device.
In the preferred embodiment of the application, if there is special marking in tab file, file system is loaded directly into, And the special marking in tab file is deleted.
If there is special marking in tab file, illustrate in last time pass hull closure, equipment it is data cached by just Really storage and/or equipment have carried out correct treatment in the case of data cached loss to data cached.In this case, exist When starting shooting next time, data cached to be restored, file system is not damaged, therefore file system need not be entered Row detection and reparation.
As can be seen here, by the addition of special marking, whether equipment automatic decision can be needed to file system in start System is detected and repaired, is required for detecting file system and being repaired when open every time NAS device so as to avoiding, pole Big saves the resource and time cost for safeguarding NAS device.
Afterwards, equipment also deletes the special marking in tab file, so that again without special marking in tab file, Conveniently in pass hull closure next time, treatment of the equipment to tab file.
As can be seen here, by the technical scheme of application the application, when NAS device is closed, according to data cached loss Situation adds special marking on the tab file in equipment, be used to point out equipment whether normal switching-off and file system whether Need to repair;Before device power-up load document system, read in tab file judge mark file whether have special first Mark, is detected and is repaired to file system if without if.Therefore, it can whether the automatic decision when NAS device is started needs File system is repaired, and be repaired automatically when needing to repair it.So as to, it is to avoid each unlatching NAS It is required for that file system is detected and repaired during equipment, is greatly saved the resource and time cost for safeguarding NAS device.
In order to technological thought of the invention is expanded on further, in conjunction with specific application scenarios, to technical side of the invention Case is illustrated.
It is illustrated in figure 2 the restorative procedure of a kind of specific NAS device file system of the application specific embodiment proposition Flow chart, as seen from the figure:
After device power-up, reported in hard disk, after scanning array, logical resource, the code of this patent can be loaded.This generation Code can read flag bit file first, if flag bit A or B are present in flag bit file, explanation need not carry out NAS files System detectio and reparation.If it does not, explanation needs that NAS file system is detected and repaired.
Specifically, the method is comprised the following steps:
S201, reads flag bit file;
S202, judgement symbol position A or B whether there is, if in the presence of S203 is gone to, otherwise going to S204;
S203, empties flag bit, the detection of NAS file system is not carried out and is repaired;
S204, is detected and is repaired to NAS file system.
It is illustrated in figure 3 a kind of overall stream of NAS device file system restorative procedure of the application specific embodiment proposition Cheng Tu, the method is comprised the following steps,
S301, it is sky to set default logo position file;
S302, under condition 1 by flag bit file modification be flag bit A;
S303, under condition 2 by flag bit file modification be flag bit B;
S304, keeps for 3 times flag bit file constant in condition;
S305, opens equipment, and whether judge mark position file changes;If change goes to S306, otherwise go to S307;
S306, is loaded directly into file system;
S307, is detected and is repaired to file system;
S308, empties marker bit.
It should be noted that:
Condition 1 is:Device command is restarted, device command shutdown, data cached without loss.
Condition 2 is:Equipment has battery to pull out power supply, and unit exception tamping machine is data cached without loss.
Condition 3 is:Equipment pulls out power supply without battery, and equipment is without battery exception tamping machine, data cached loss.
The equipment for being illustrated in figure 4 the proposition of the application specific embodiment is performing opening for present specification system repair Machine flow chart, as seen from the figure, first starts BIOS self-inspections, kernel loads to internal memory, after Virtual File System loading after device power Load the driver of root;After unload Virtual File System, carry real file system;Subsequent load drives, and loading sets Standby service;Reached the standard grade to hard disk again, array, logical resource scanning just can be with mount NAS file system after reaching the standard grade.
The method is specific as follows:
S401, equipment carries out BIOS self-inspections;
S402, loads kernel
S403, loading root necessity driver
S404, load document system
S405, load driver
S406, caching is brushed by non volatile storage media data
S407, starting device service
S408, Disk are reported;
S409, array, logical resource scanning;
S410, loads the restorative procedure of NAS device file system;
S411, mount NAS file system.
The equipment for being illustrated in figure 5 the proposition of the application specific embodiment is performing the life of present specification system repair Flow chart is restarted in order, and the method includes:
S501, equipment performs reset command;
S502, closes network interface;
S503, stops respective services;
S504, brush system cachings at different levels;
S505, flag bit is set according to caching situation
S506, performs reboot orders and enters starting procedure.
The equipment for being illustrated in figure 6 the proposition of the application specific embodiment is performing the life of present specification system repair Shutdown process figure is made, the method includes:
S601, equipment performs shutdown command;
S602, closes network interface;
S603, stops respective services;
S604, brush system cachings at different levels;
S605, flag bit is set according to caching situation
S606, performs halt shutdown process;
S607, into kernel shutdown flow.
The equipment for being illustrated in figure 7 the proposition of the application specific embodiment is performing having for present specification system repair Battery pulls out power supply (or equipment tamping machine) flow chart, and the method includes:
S701, equipment is pulled out power supply when there is battery, is forced shutdown;
S701, closes network interface;
S701, cuts kdump and enters mini system;
S701, brush system cachings at different levels;
S701, flag bit is set according to caching situation;
S701, into kernel shutdown flow.
The cachings at different levels for being illustrated in figure 8 the proposition of the application specific embodiment are all lost the adding method flow of flag bit and are shown It is intended to, the method includes:
S801, cachings at different levels are all lost;
S802, judges whether equipment has battery, if going to S803, otherwise goes to S804;
S803, judge it is data cached whether normal process, if going to S805, otherwise go to S806;
S804, keeps flag bit file constant;
S805, B is write in flag bit file
S806, it is ensured that flag bit file is constant.
The cachings at different levels for being illustrated in figure 9 the proposition of the application specific embodiment all do not lose the adding method stream of flag bit Journey schematic diagram, the method includes:
S901, cachings at different levels are not all lost;
S902, the off-mode for judging equipment is that normal shutdown is restarted or unit exception tamping machine, if the shutdown shape of equipment State is that normal shutdown is restarted, and goes to S903, otherwise goes to S904;
S903, flag bit file write-in A;
S904, flag bit file write-in B.
As can be seen here, by the technical scheme of application the application, when NAS device is closed, according to data cached loss Situation adds special marking on the tab file in equipment, be used to point out equipment whether normal switching-off and file system whether Need to repair;Before device power-up load document system, read in tab file judge mark file whether have special first Mark, is detected and is repaired to file system if without if.Therefore, it can whether the automatic decision when NAS device is started needs File system is repaired, and be repaired automatically when needing to repair it.So as to, it is to avoid each unlatching NAS It is required for that file system is detected and repaired during equipment, is greatly saved the resource and time cost for safeguarding NAS device.
To reach above technical purpose, disclosed herein as well is a kind of NAS device, there is tab file in NAS device, wrap Include:
Read module 101, before load document system is needed, reads the tab file;
Judge module 102, judges with the presence or absence of special marking in the tab file, and the special marking is to close institute State what is write during NAS device;
Repair module 103, in the tab file do not exist special marking when, to the file system carry out detection with Repair.
In specific application scenarios, also include,
Operation module, when there is special marking in the tab file, loads the file system, and delete described Special marking.
In specific application scenarios, the adding method of the special marking is as follows:
When the NAS device is closed, judge whether the data cached of the NAS device loses;
If the data cached of the NAS device is not lost, special marking is added on the tab file.
In specific application scenarios, the adding method of the special marking also includes:
If the data cached loss of the NAS device, judges whether the NAS device has power input;
If non-transformer is input into, keep the tab file constant;
If there is power input, judge it is described it is data cached whether normal process;
If the data cached normal process, special marking is added on the tab file;
If the data cached non-normal process, keeps the tab file constant.
As can be seen here, by the technical scheme of application the application, when NAS device is closed, according to data cached loss Situation adds special marking on the tab file in equipment, be used to point out equipment whether normal switching-off and file system whether Need to repair;Before device power-up load document system, read in tab file judge mark file whether have special first Mark, is detected and is repaired to file system if without if.Therefore, it can whether the automatic decision when NAS device is started needs File system is repaired, and be repaired automatically when needing to repair it.So as to, it is to avoid each unlatching NAS It is required for that file system is detected and repaired during equipment, is greatly saved the resource and time cost for safeguarding NAS device.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can lead to Cross hardware realization, it is also possible to realize by the mode of software plus necessary general hardware platform.Based on such understanding, this hair Bright technical scheme can be embodied in the form of software product, and the software product can be stored in a non-volatile memories Medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in, including some instructions are used to so that a computer equipment (can be Personal computer, server, or network equipment etc.) perform method described in each implement scene of the invention.
It will be appreciated by those skilled in the art that accompanying drawing is a schematic diagram for being preferable to carry out scene, module in accompanying drawing or Flow is not necessarily implemented necessary to the present invention.
It will be appreciated by those skilled in the art that module in device in implement scene can according to implement scene describe into Row is distributed in the device of implement scene, it is also possible to carry out one or more dresses that respective change is disposed other than this implement scene In putting.The module of above-mentioned implement scene can merge into a module, it is also possible to be further split into multiple submodule.
The invention described above sequence number is for illustration only, and the quality of implement scene is not represented.
Disclosed above is only several specific implementation scenes of the invention, but, the present invention is not limited to this, Ren Heben What the technical staff in field can think change should all fall into protection scope of the present invention.

Claims (8)

1. a kind of restorative procedure of NAS device file system, it is characterised in that have tab file, the method bag in NAS device Include:
Before load document system is needed, the tab file is read;
Judge with the presence or absence of special marking in the tab file, the special marking is write when the NAS device is closed 's;
If not existing special marking in the tab file, the file system is detected and repaired.
2. the method for claim 1, it is characterised in that also include:
If there is special marking in the tab file, the file system is loaded, and delete the special marking.
3. the method as described in any one of claim 1 or 2, it is characterised in that the adding method of the special marking is as follows:
When the NAS device is closed, judge whether the data cached of the NAS device loses;
If the data cached of the NAS device is not lost, special marking is added on the tab file.
4. method as claimed in claim 3, its feature is with the adding method of the special marking also includes:
If the data cached loss of the NAS device, judges whether the NAS device has power input;
If non-transformer is input into, keep the tab file constant;
If there is power input, judge it is described it is data cached whether normal process;
If the data cached normal process, special marking is added on the tab file;
If the data cached non-normal process, keeps the tab file constant.
5. a kind of NAS device, it is characterised in that have tab file in NAS device, the equipment includes:
Read module, before load document system is needed, reads the tab file;
Judge module, judges with the presence or absence of special marking in the tab file, and the special marking is set in the closing NAS Write when standby;
Repair module, when not existing special marking in the tab file, is detected and is repaired to the file system.
6. NAS device as claimed in claim 5, it is characterised in that also include,
Operation module, when there is special marking in the tab file, loads the file system, and delete described special Mark.
7. the NAS device as described in any one of claim 5 or 6, it is characterised in that the adding method of the special marking is such as Under:
When the NAS device is closed, judge whether the data cached of the NAS device loses;
If the data cached of the NAS device is not lost, special marking is added on the tab file.
8. NAS device as claimed in claim 7, it is characterised in that the adding method of the special marking also includes:
If the data cached loss of the NAS device, judges whether the NAS device has power input;
If non-transformer is input into, keep the tab file constant;
If there is power input, judge it is described it is data cached whether normal process;
If the data cached normal process, special marking is added on the tab file;
If the data cached non-normal process, keeps the tab file constant.
CN201611085516.6A 2016-11-30 2016-11-30 Repair method of NAS device file system and NAS device Active CN106708960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611085516.6A CN106708960B (en) 2016-11-30 2016-11-30 Repair method of NAS device file system and NAS device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611085516.6A CN106708960B (en) 2016-11-30 2016-11-30 Repair method of NAS device file system and NAS device

Publications (2)

Publication Number Publication Date
CN106708960A true CN106708960A (en) 2017-05-24
CN106708960B CN106708960B (en) 2021-05-28

Family

ID=58935207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611085516.6A Active CN106708960B (en) 2016-11-30 2016-11-30 Repair method of NAS device file system and NAS device

Country Status (1)

Country Link
CN (1) CN106708960B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107562577A (en) * 2017-09-21 2018-01-09 郑州云海信息技术有限公司 A kind of file system restorative procedure and device
CN109388436A (en) * 2017-08-04 2019-02-26 中兴通讯股份有限公司 Control method, device and the storage medium of starting procedure
CN109597715A (en) * 2018-12-04 2019-04-09 深圳创维数字技术有限公司 A kind of disk restorative procedure, device and equipment
CN110908760A (en) * 2019-11-25 2020-03-24 安徽兮克电子科技有限公司 Method for realizing window opening switching on WEB browser
CN112579179A (en) * 2019-09-30 2021-03-30 合肥杰发科技有限公司 Partition mounting method of embedded system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1460210A (en) * 2001-04-25 2003-12-03 成津C&C株式会社 Apparatus and method for protecting failure of computer operating system
CN1936853A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Data cut-off protection and repairing method of inlaid apparatus
CN101807212A (en) * 2010-04-30 2010-08-18 迈普通信技术股份有限公司 Caching method for embedded file system and embedded file system
CN102113058A (en) * 2008-04-09 2011-06-29 拉姆伯斯公司 Programmable memory repair scheme
CN103020415A (en) * 2011-09-28 2013-04-03 盛趣信息技术(上海)有限公司 Method, device and system for preventing game cheating
CN103064752A (en) * 2011-09-27 2013-04-24 奇智软件(北京)有限公司 Method and device of repairing document
CN104090729A (en) * 2014-07-04 2014-10-08 浙江宇视科技有限公司 Method and device for repairing mirror image synchronization through service write operation
US9490034B1 (en) * 2015-08-18 2016-11-08 Oracle International Corporation Centralized memory repair block

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1460210A (en) * 2001-04-25 2003-12-03 成津C&C株式会社 Apparatus and method for protecting failure of computer operating system
CN1936853A (en) * 2005-09-22 2007-03-28 康佳集团股份有限公司 Data cut-off protection and repairing method of inlaid apparatus
CN102113058A (en) * 2008-04-09 2011-06-29 拉姆伯斯公司 Programmable memory repair scheme
CN101807212A (en) * 2010-04-30 2010-08-18 迈普通信技术股份有限公司 Caching method for embedded file system and embedded file system
CN103064752A (en) * 2011-09-27 2013-04-24 奇智软件(北京)有限公司 Method and device of repairing document
CN103020415A (en) * 2011-09-28 2013-04-03 盛趣信息技术(上海)有限公司 Method, device and system for preventing game cheating
CN104090729A (en) * 2014-07-04 2014-10-08 浙江宇视科技有限公司 Method and device for repairing mirror image synchronization through service write operation
US9490034B1 (en) * 2015-08-18 2016-11-08 Oracle International Corporation Centralized memory repair block

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
冷静等: "硬盘数据恢复原理与方法", 《江苏科技信息》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109388436A (en) * 2017-08-04 2019-02-26 中兴通讯股份有限公司 Control method, device and the storage medium of starting procedure
CN107562577A (en) * 2017-09-21 2018-01-09 郑州云海信息技术有限公司 A kind of file system restorative procedure and device
CN109597715A (en) * 2018-12-04 2019-04-09 深圳创维数字技术有限公司 A kind of disk restorative procedure, device and equipment
CN112579179A (en) * 2019-09-30 2021-03-30 合肥杰发科技有限公司 Partition mounting method of embedded system
CN110908760A (en) * 2019-11-25 2020-03-24 安徽兮克电子科技有限公司 Method for realizing window opening switching on WEB browser
CN110908760B (en) * 2019-11-25 2022-10-14 安徽兮克电子科技有限公司 Method for realizing window opening switching on WEB browser

Also Published As

Publication number Publication date
CN106708960B (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN106708960A (en) Restoration method for file system of NAS device and NAS device
US8612707B2 (en) Continuous data protection over intermittent connections, such as continuous data backup for laptops or wireless devices
CN102955720B (en) A kind of method improving ext file system stability
US10061655B2 (en) Volatile cache reconstruction after power failure
CN102033786B (en) Method for repairing consistency of copies in object storage system
CN108319543A (en) A kind of asynchronous processing method and its medium, system of computer log data
CN103226965B (en) Based on the audio/video data access method of time bitmap
CN101945131B (en) Storage virtualization-based data migration method
CN102402471A (en) Method and system for backing up data in real time based on snapshot function of memory array
CN107918568B (en) Method for preventing Linux system from failing to restart
CN102609327B (en) Method and device for improving reliability of multi-core processor
CN101706783A (en) Method and device for checking and repairing files in embedded equipment
CN104811645A (en) Embedded video-recording data storage method
CN101187887A (en) Storage device with temporary data protection function and the method
CN106959907A (en) A kind of cloud platform fragmentation data backup and reduction system
CN103176867A (en) Fast file differential backup method
CN104636218B (en) Data reconstruction method and device
CN103455391B (en) A kind of apparatus and method of data protection of dynamic conditioning
US10671567B2 (en) System and method for optimized lock detection
CN102750202A (en) Data protection method and device
US20050262033A1 (en) Data recording apparatus, data recording method, program for implementing the method, and program recording medium
CN109753381A (en) A kind of continuous data protection method based on object storage
US20160037119A1 (en) Video recording apparatus, and video recording method when temporary network failure occurs
CN101916234A (en) Information maintenance method and system of storage equipment
CN100524257C (en) Recording medium, data processing apparatus, and data processing method

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