CN102117316A - FAT (file allocation table) file system formatting method and device - Google Patents

FAT (file allocation table) file system formatting method and device Download PDF

Info

Publication number
CN102117316A
CN102117316A CN 201010620012 CN201010620012A CN102117316A CN 102117316 A CN102117316 A CN 102117316A CN 201010620012 CN201010620012 CN 201010620012 CN 201010620012 A CN201010620012 A CN 201010620012A CN 102117316 A CN102117316 A CN 102117316A
Authority
CN
China
Prior art keywords
auxiliary information
district
sector auxiliary
sector
fat
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
CN 201010620012
Other languages
Chinese (zh)
Other versions
CN102117316B (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.)
Huawei Digital Technologies Chengdu Co Ltd
Huawei Digital Technologies Co Ltd
Original Assignee
Huawei Digital Technologies Chengdu 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 Huawei Digital Technologies Chengdu Co Ltd filed Critical Huawei Digital Technologies Chengdu Co Ltd
Priority to CN 201010620012 priority Critical patent/CN102117316B/en
Publication of CN102117316A publication Critical patent/CN102117316A/en
Application granted granted Critical
Publication of CN102117316B publication Critical patent/CN102117316B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides an FAT file system formatting method and device. The method comprises: acquiring a formatting instruction for formatting an FAT file system to an FAT format; acquiring first sector information corresponding to an MBR (main boot record) region, second sector information corresponding to a DBR (dos boot record) region, third sector information corresponding to an FAT region, fourth sector information corresponding an FDT (file directory table) region, and fifth sector information corresponding to a DATA region according to the corresponding relationship between the regions of the storage medium and the sector information; and formatting the sectors marked by the first sector information and the second sector information, and not formatting the sectors marked by the third sector information, the fourth sector information and the fifth sector information.

Description

FAT file system format method and device
Technical field
The embodiment of the invention relates to the information processing technology, relates in particular to a kind of file allocation table (FileAllocation Table is called for short FAT) file system format method and device.
Background technology
Fig. 1 is the storage organization synoptic diagram of file allocation table (File Allocation Table, be called for short FAT) file system, and as shown in Figure 1, data (DATA) district is used to store the data of FAT file system, and this data unit is bunch; File Directory Table (File Directory Table, abbreviation FDT) district has another name called the ROOT district, refer in particular to root directory herein, be the catalogue of the data of the FAT file system of DATA district storage, comprise the filename, file size, change date, file starting cluster of the data of FAT file system etc. in this catalogue; The FAT district is used to store the chained list of all bunches of FAT file system, the situation of the data occupancy of expression FAT file system bunch; Main Boot Record (Main BootRecord is called for short MBR) district and Dos leader record (Dos Boot Record is called for short DBR) district are two important boot sectors, are used for the initialization and normal use of FAT file system.
In the prior art, if break down in M BR district and/or DBR district, then storage medium can't be initialized as the FAT file system once more, then must recover by format.Formative usual method is that MBR district, DBR district, FAT district and FDT district are carried out format manipulation, promptly rewrites MBR district and DBR district, and deletes FAT district and FDT district simultaneously.Because FAT district and FDT district are the index of the data of FAT file system, delete FAT district and FDT district and can cause the data of the FAT file system of storing in the storage medium all to be lost, thereby reduced reliability of data storage.
Summary of the invention
The embodiment of the invention provides a kind of FAT file system format method and device, break down FAT district and FDT district are carried out the problem that the data of the FAT file system that format manipulation causes are all lost owing to MBR district and/or DBR district in order to avoiding, improve reliability of data storage.
The embodiment of the invention provides a kind of FAT file system format method, comprising:
Obtain the format instruction that the FAT file system format is turned to the FAT form;
According to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, with corresponding second sector auxiliary information in DBR district, with corresponding the 3rd sector auxiliary information in FAT district, with corresponding the 4th sector auxiliary information in FDT district and five sector auxiliary information corresponding with the DATA district;
Format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, format manipulation is not carried out in the sector that described the 3rd sector auxiliary information, described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified.
The embodiment of the invention also provides a kind of FAT file system format makeup to put, and comprising:
The instruction acquisition module is used to obtain the format instruction that the FAT file system format is turned to the FAT form;
The information acquisition module, be used for according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, with corresponding second sector auxiliary information in DBR district, with corresponding the 3rd sector auxiliary information in FAT district, with corresponding the 4th sector auxiliary information in FDT district and five sector auxiliary information corresponding with the DATA district;
The instruction execution module, be used for format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, format manipulation is not carried out in the sector that described the 3rd sector auxiliary information, described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified.
As shown from the above technical solution, the embodiment of the invention turns to the FAT file system format after the format instruction of FAT form by obtaining, according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, second sector auxiliary information corresponding with the DBR district, three sector auxiliary information corresponding with the FAT district, four sector auxiliary information corresponding and five sector auxiliary information corresponding with the DATA district with the FDT district, thereby make it possible to format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, to described the 3rd sector auxiliary information, format manipulation is not carried out in the sector that described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified, can avoid breaking down FAT district and FDT district being carried out the problem that the data of the FAT file system that format manipulation causes are all lost, thereby improve reliability of data storage owing to MBR district and/or DBR district.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do one to the accompanying drawing of required use in embodiment or the description of the Prior Art below introduces simply, apparently, accompanying drawing in describing below is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the storage organization synoptic diagram of FAT file system;
The schematic flow sheet of the FAT file system format method that Fig. 2 provides for the embodiment of the invention one;
The schematic flow sheet of the FAT file system format method that Fig. 3 provides for the embodiment of the invention two;
The structural representation that Fig. 4 puts for the FAT file system format makeup that the embodiment of the invention three provides;
Another structural representation that Fig. 5 puts for the FAT file system format makeup that the embodiment of the invention three provides;
Another structural representation that Fig. 6 puts for the FAT file system format makeup that the embodiment of the invention three provides.
Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The schematic flow sheet of the FAT file system format method that Fig. 2 provides for the embodiment of the invention one, as shown in Figure 2, the FAT file system format method of present embodiment can may further comprise the steps:
Step 201, obtain the format instruction that the FAT file system format is turned to the FAT form;
Step 202, according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, with corresponding second sector auxiliary information in DBR district, with corresponding the 3rd sector auxiliary information in FAT district, with corresponding the 4th sector auxiliary information in FDT district and five sector auxiliary information corresponding with the DATA district;
Particularly, can realize according to the algorithm of FAT file system, divide the zone of storage medium, promptly be divided into MBR district, DBR district, FAT district, FDT district, DATA district, then can set up the zone of the storage medium of dividing and the corresponding relation of sector auxiliary information according to the zone of the storage medium of dividing.
Format manipulation is carried out in step 203, the sector that above-mentioned first sector auxiliary information and above-mentioned second sector auxiliary information are identified, and format manipulation is not carried out in the sector that above-mentioned the 3rd sector auxiliary information, above-mentioned the 4th sector auxiliary information and above-mentioned the 5th sector auxiliary information are identified.
In this step, to first sector auxiliary information corresponding with carry out format manipulation with the sector (being MBR district and DBR district) that corresponding second sector auxiliary information in DBR district is identified and promptly rewrite MBR district and DBR district, to three sector auxiliary information corresponding, with corresponding the 4th sector auxiliary information in FDT district with do not carry out format manipulation with the sector (being FAT district, FDT district and DATA district) that corresponding the 5th sector auxiliary information in DATA district is identified and promptly do not delete information in FAT district, FDT district and the DATA district with the FAT district with the MBR district.
In the present embodiment, because the dividing region of storage medium is relevant with the capacity of storage medium, therefore, each storage medium is when each format, and dividing region is identical, and promptly each shared sector, zone is identical.Because the data of the FAT file system in the DATA district remain unchanged, therefore, the catalogue of the data of the FAT file system in the FDT district also is changeless, and the corresponding relation in the FAT district bunch number also is maintained fixed constant, that is to say, can need not to carry out format manipulation to FAT district and FDT district, also can correctly characterize the relevant information of the data of FAT file system.
In the present embodiment, by obtaining the FAT file system format is turned to after the format instruction of FAT form, according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, second sector auxiliary information corresponding with the DBR district, three sector auxiliary information corresponding with the FAT district, four sector auxiliary information corresponding and five sector auxiliary information corresponding with the DATA district with the FDT district, thereby make it possible to format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, to described the 3rd sector auxiliary information, format manipulation is not carried out in the sector that described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified, can avoid breaking down FAT district and FDT district being carried out the problem that the data of the FAT file system that format manipulation causes are all lost, thereby improve reliability of data storage owing to MBR district and/or DBR district.
The schematic flow sheet of the FAT file system format method that Fig. 3 provides for the embodiment of the invention two as shown in Figure 3, is compared with a last embodiment, and before step 201, the FAT file system format method of present embodiment can further include following steps:
The executing state in step 301, detection MBR district and/or DBR district, above-mentioned executing state comprises normal condition and malfunction;
Step 302, when the executing state in above-mentioned MBR district of detecting and/or DBR district is malfunction, show corresponding fault information, need format above-mentioned FAT file system to indicate.
In the present embodiment, when the executing state that detects MBR district and/or DBR district is malfunction (being to break down in MBR district and/or DBR district), then storage medium can't be initialized as the FAT file system once more, then need to recover by format.By the FAT file system format method that adopts the embodiment of the invention to provide, can avoid breaking down FAT district and FDT district being carried out the problem that the data of the FAT file system that format manipulation causes are all lost, thereby improve reliability of data storage owing to MBR district and/or DBR district.
Need to prove: for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
The structural representation that Fig. 4 puts for the FAT file system format makeup that the embodiment of the invention three provides, as shown in Figure 4, the makeup of the FAT file system format of present embodiment is put and can be comprised instruction acquisition module 41, information acquisition module 42 and instruction execution module 43.Wherein, instruction acquisition module 41 obtains the format instruction that the FAT file system format is turned to the FAT form, information acquisition module 42 is according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, second sector auxiliary information corresponding with the DBR district, three sector auxiliary information corresponding with the FAT district, four sector auxiliary information corresponding and five sector auxiliary information corresponding with the DATA district with the FDT district, format manipulation is carried out in the sector that instruction 43 pairs of described first sector auxiliary information of execution module and described second sector auxiliary information are identified, to described the 3rd sector auxiliary information, format manipulation is not carried out in the sector that described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified.
Method all can be put realization by the FAT file system format makeup that the embodiment of the invention provides among the invention described above embodiment one, two.
In the present embodiment, obtain by the instruction acquisition module FAT file system format is turned to after the format instruction of FAT form, the information acquisition module is according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, second sector auxiliary information corresponding with the DBR district, three sector auxiliary information corresponding with the FAT district, four sector auxiliary information corresponding and five sector auxiliary information corresponding with the DATA district with the FDT district, thereby make the call instruction execution module carry out format manipulation to the sector that described first sector auxiliary information and described second sector auxiliary information are identified, to described the 3rd sector auxiliary information, format manipulation is not carried out in the sector that described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified, can avoid breaking down FAT district and FDT district being carried out the problem that the data of the FAT file system that format manipulation causes are all lost, thereby improve reliability of data storage owing to MBR district and/or DBR district.
As shown in Figure 5, the FAT file system format makeup of present embodiment is put the relation of can further include and is set up module 44, can be used to set up the zone of described storage medium and the corresponding relation of sector auxiliary information, obtain the corresponding sector auxiliary information in zone (MBR district, DBR district, FAT district, FDT district, DATA district) with storage medium for described information acquisition module.Particularly, relation is set up module 44 and specifically can be realized according to the algorithm of FAT file system, divides the zone of storage medium, sets up the zone of the storage medium of dividing and the corresponding relation of sector auxiliary information.
As shown in Figure 6, the FAT file system format makeup of present embodiment is put and be can further include state detection module 45, can be used to detect the executing state in MBR district and/or DBR district, described executing state comprises normal condition and malfunction, when the executing state in described MBR district of detecting and/or DBR district is malfunction, show corresponding fault information, need format described FAT file system with indication.
In the present embodiment, when the executing state that detects MBR district and/or DBR district when state detection module is malfunction (being to break down in MBR district and/or DBR district), then storage medium can't be initialized as the FAT file system once more, then need to recover by format.Put by the FAT file system format makeup of adopting the embodiment of the invention to provide, can avoid breaking down FAT district and FDT district being carried out the problem that the data of the FAT file system that format manipulation causes are all lost, thereby improve reliability of data storage owing to MBR district and/or DBR district.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (8)

1. a FAT file system format method is characterized in that, comprising:
Obtain the format instruction that the FAT file system format is turned to the FAT form;
According to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, with corresponding second sector auxiliary information in DBR district, with corresponding the 3rd sector auxiliary information in FAT district, with corresponding the 4th sector auxiliary information in FDT district and five sector auxiliary information corresponding with the DATA district;
Format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, format manipulation is not carried out in the sector that described the 3rd sector auxiliary information, described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified.
2. method according to claim 1 is characterized in that, also comprises:
Set up the zone of described storage medium and the corresponding relation of sector auxiliary information.
3. method according to claim 2 is characterized in that, the step of the corresponding relation of the described zone of setting up described storage medium and sector auxiliary information specifically comprises:
Algorithm according to the FAT file system is realized, divides the zone of storage medium;
Set up the zone of the storage medium of dividing and the corresponding relation of sector auxiliary information.
4. according to the described method of the arbitrary claim of claim 1~3, it is characterized in that described obtaining also comprises before the FAT file system format turned to the step of format instruction of FAT form:
Detect the executing state in MBR district and/or DBR district, described executing state comprises normal condition and malfunction;
When the executing state in described MBR district of detecting and/or DBR district is malfunction, show corresponding fault information, need format described FAT file system with indication.
5. a FAT file system format makeup is put, and it is characterized in that, comprising:
The instruction acquisition module is used to obtain the format instruction that the FAT file system format is turned to the FAT form;
The information acquisition module, be used for according to the zone of storage medium and the corresponding relation of sector auxiliary information, obtain first sector auxiliary information corresponding with the MBR district, with corresponding second sector auxiliary information in DBR district, with corresponding the 3rd sector auxiliary information in FAT district, with corresponding the 4th sector auxiliary information in FDT district and five sector auxiliary information corresponding with the DATA district;
The instruction execution module, be used for format manipulation is carried out in the sector that described first sector auxiliary information and described second sector auxiliary information are identified, format manipulation is not carried out in the sector that described the 3rd sector auxiliary information, described the 4th sector auxiliary information and described the 5th sector auxiliary information are identified.
6. device according to claim 5 is characterized in that, the relation of also comprising is set up module, is used to set up the zone of described storage medium and the corresponding relation of sector auxiliary information.
7. device according to claim 6 is characterized in that, described relation is set up module and specifically is used for
Algorithm according to the FAT file system is realized, divides the zone of storage medium, sets up the zone of the storage medium of dividing and the corresponding relation of sector auxiliary information.
8. according to the described device of the arbitrary claim of claim 5~7, it is characterized in that, also comprise state detection module, be used to detect the executing state in MBR district and/or DBR district, described executing state comprises normal condition and malfunction, when the executing state in described MBR district of detecting and/or DBR district is malfunction, show corresponding fault information, need format described FAT file system with indication.
CN 201010620012 2010-12-31 2010-12-31 FAT (file allocation table) file system formatting method and device Expired - Fee Related CN102117316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010620012 CN102117316B (en) 2010-12-31 2010-12-31 FAT (file allocation table) file system formatting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010620012 CN102117316B (en) 2010-12-31 2010-12-31 FAT (file allocation table) file system formatting method and device

Publications (2)

Publication Number Publication Date
CN102117316A true CN102117316A (en) 2011-07-06
CN102117316B CN102117316B (en) 2012-11-21

Family

ID=44216087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010620012 Expired - Fee Related CN102117316B (en) 2010-12-31 2010-12-31 FAT (file allocation table) file system formatting method and device

Country Status (1)

Country Link
CN (1) CN102117316B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108008908A (en) * 2016-10-31 2018-05-08 比亚迪股份有限公司 The method and apparatus of data in a kind of management and control SD card

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1266224A (en) * 1999-03-04 2000-09-13 英业达股份有限公司 Method for formatted disc
US6233105B1 (en) * 1999-03-29 2001-05-15 Inventec Corporation Method of disk formatting
US20090083477A1 (en) * 2007-09-21 2009-03-26 Samsung Electronics Co., Ltd. Method and apparatus for formatting portable storage device
CN101673242A (en) * 2008-09-10 2010-03-17 中兴通讯股份有限公司 Method and device for formatting hard disk

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1266224A (en) * 1999-03-04 2000-09-13 英业达股份有限公司 Method for formatted disc
US6233105B1 (en) * 1999-03-29 2001-05-15 Inventec Corporation Method of disk formatting
US20090083477A1 (en) * 2007-09-21 2009-03-26 Samsung Electronics Co., Ltd. Method and apparatus for formatting portable storage device
CN101673242A (en) * 2008-09-10 2010-03-17 中兴通讯股份有限公司 Method and device for formatting hard disk

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108008908A (en) * 2016-10-31 2018-05-08 比亚迪股份有限公司 The method and apparatus of data in a kind of management and control SD card

Also Published As

Publication number Publication date
CN102117316B (en) 2012-11-21

Similar Documents

Publication Publication Date Title
US8312554B2 (en) Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus
TWI515561B (en) Data tree storage methods, systems and computer program products using page structure of flash memory
CN109542342B (en) Metadata management and data reconstruction method, equipment and storage medium
US10083085B2 (en) Indirection data structures to manage file system metadata
CN101645043B (en) Methods for reading and writing data and memory device
CN104699417A (en) Data storage device and data access method thereof
CN104484427B (en) A kind of video file storage device and method
US20090037646A1 (en) Method of using a flash memory for a circular buffer
US20150269071A1 (en) Flash memory file system and method using different types of storage media
CN113220239A (en) Erasing and writing method, device and equipment for flash storage and readable storage medium
CN102541969B (en) File protection method and system based on file allocation table (FAT) file system, and memory
CN110147203A (en) A kind of file management method, device, electronic equipment and storage medium
RU2017104408A (en) COMPONENT DATA STORAGE TOPOLOGIES FOR DATA OBJECTS
CN107967118A (en) A kind of method and apparatus realized hard disc data high speed dump and checked
KR20090042570A (en) Apparatus and method for managing files and memory unit
CN102117316B (en) FAT (file allocation table) file system formatting method and device
CN102253938A (en) Method and device for writing and restoring file
WO2009110665A1 (en) Information storage medium for recording data according to journaling file system, and method of and apparatus for writing/recovering data using journaling file system
CN105830067A (en) Document information processing method, apparatus, and document processing apparatus and system
CN107229664B (en) Indirect data structure for managing file system metadata
KR101474285B1 (en) Fat file system and log data storage method of the same
CN105573862B (en) Method and equipment for recovering file system
CN104504349B (en) A kind of Video data safe storage device and method
US20190354306A1 (en) Available-space management method for nonvolatile memory, access device which stores data to information storage device with nonvolatile memory, information storage device, and information storage system
CN108664578B (en) File circulating storage method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121121

Termination date: 20171231