KR20070069295A - An implementation method of fat file system which the journaling is applied method - Google Patents

An implementation method of fat file system which the journaling is applied method Download PDF

Info

Publication number
KR20070069295A
KR20070069295A KR1020050131240A KR20050131240A KR20070069295A KR 20070069295 A KR20070069295 A KR 20070069295A KR 1020050131240 A KR1020050131240 A KR 1020050131240A KR 20050131240 A KR20050131240 A KR 20050131240A KR 20070069295 A KR20070069295 A KR 20070069295A
Authority
KR
South Korea
Prior art keywords
fat
log
fat area
area
file system
Prior art date
Application number
KR1020050131240A
Other languages
Korean (ko)
Other versions
KR100775141B1 (en
Inventor
유장호
Original Assignee
엘지전자 주식회사
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 엘지전자 주식회사 filed Critical 엘지전자 주식회사
Priority to KR1020050131240A priority Critical patent/KR100775141B1/en
Publication of KR20070069295A publication Critical patent/KR20070069295A/en
Application granted granted Critical
Publication of KR100775141B1 publication Critical patent/KR100775141B1/en

Links

Images

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/11File system administration, e.g. details of archiving or snapshots
    • 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/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1435Saving, restoring, recovering or retrying at system level using file system or storage system metadata
    • 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/1474Saving, restoring, recovering or retrying in transactions
    • 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/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

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)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for implementing an FAT file system applying journaling is provided to reduce failure caused by medium attachment/detachment and sudden power-off, and effectively recover the failure by applying journaling to the FAT file system. A log for file generation is recorded to the second FAT area(201). User data is stored to empty blocks of the first FAT area after the log is recorded to the second FAT area(202). Changed contents of the first FAT area are recorded to the log stored in the second FAT area until the user data is completely stored. A process for storing the user data and recording the log is repeatedly performed(205). Log information is read from the second FAT area to check a recovery point. The data is recorded to the first FAT area and a directory area by checking the log information.

Description

저널링이 적용된 FAT 파일 시스템의 구현 방법{An implementation method of FAT file system which the journaling is applied method}An implementation method of FAT file system which the journaling is applied method}

도 1은 본 발명에 따른 저널링이 적용된 FAT 파일 시스템의 구조를 나타낸 도면.1 is a diagram showing the structure of a FAT file system to which journaling is applied according to the present invention.

도 2은 제 1 FAT 영역에 저장될 입력자료가 저장장치의 빈 블록보다 많을 경우를 나타낸 예시도.2 is an exemplary view showing a case where there are more input materials to be stored in the first FAT area than empty blocks of the storage device.

도 3는 입력자료가 저장장치의 빈 블록보다 많을 경우 링크드 리스트 형태로 저장되는 과정을 나타낸 예시도.3 is an exemplary view illustrating a process of storing a linked list when input data is larger than an empty block of a storage device.

도 4는 본 발명에 따른 저널링이 적용된 FAT 파일 시스템의 구현과정을 나타낸 흐름도.4 is a flowchart illustrating an implementation process of a FAT file system to which journaling is applied according to the present invention.

도 5은 본 발명에 따른 트랜잭션의 원리를 나타내는 도면.5 illustrates the principle of a transaction in accordance with the present invention.

도 6는 본 발명에 따른 저널링이 적용된 FAT 파일 시스템에서 시스템을 복구하는 과정을 나타내는 흐름도.6 is a flowchart illustrating a process of recovering a system in a FAT file system to which journaling is applied according to the present invention.

〈도면의 주요 부분에 대한 부호의 설명〉<Explanation of symbols for main parts of drawing>

101 : 제 1 FAT 영역 102 : 제 2 FAT 영역(로그영역)101: first FAT area 102: second FAT area (log area)

103 : 디렉토리 정보 영역 104 : 사용자 데이터 영역103: directory information area 104: user data area

본 발명은 저널링(Journaling)을 적용한 FAT파일 시스템에 관한 것으로, 보다 상세하게는 전원이 차단되더라도 백업 및 복구가 가능한 저널링 기법을 적용한 FAT파일 시스템에 관한 것이다.The present invention relates to a FAT file system to which journaling is applied, and more particularly, to a FAT file system to which a journaling technique that can be backed up and restored even when power is cut off.

FAT란 운영체제가 하드디스크 내에 유지하는 일종의 파일 배치표로 파일들이 저장되어 있는 클러스터들의 위치도를 제공한다. 윈도우에서는 이것을 FAT-12, FAT-16, FAT-32, NTFS(New Technology File System)라는 각기 다른 파일 시스템의 이름을 붙여서 사용한다. FAT의 뒤에 붙여 사용하는 숫자는 각각 16비트 32비트를 나타내며 저장 용량의 한계와 하나의 드라이브에 존재하는 총 클러스터의 수를 나타내게 된다. FAT-16을 사용하는 드라이브의 경우 해당 드라이브에 존재할 수 있는 총 클러스터의 수는 2의 16승에 해당되는 65,536개만큼의 클러스터를 가질 수 있다. 새로운 파일이 저장될 때 그 파일은 적어도 하나 이상의 클러스터에 저장되는데 파일 크기가 클러스터 크기보다 작다고 할지라도 적어도 하나 이상의 클러스터를 차지한다. 이와 같이 클러스터에 파일이 차지하고 남은 공간으로 인해서 커다란 클러스터는 용량 낭비가 초래된다. 이러한 문제와 하드디스크의 대형화에 따라서 다양한 파일 시스템이 등장하게 되었다.FAT is a file layout table maintained by the operating system on the hard disk. It provides the location of clusters where files are stored. Windows uses them by naming different file systems: FAT-12, FAT-16, FAT-32, and NTFS (New Technology File System). The numbers used after the FAT represent 16 bits and 32 bits, respectively, indicating the storage capacity limit and the total number of clusters on a single drive. In the case of a drive using FAT-16, the total number of clusters that can exist in the drive can have as many as 65,536 clusters corresponding to two powers of 16. When a new file is stored, the file is stored in at least one cluster, but occupies at least one cluster even if the file size is smaller than the cluster size. As a result, files occupy and occupy space in the cluster, causing large clusters to waste capacity. As a result of these problems and the increase in size of hard disks, various file systems have emerged.

상기한 FAT 파일 시스템의 구조는 제 1 FAT 영역과 제 2 FAT 영역으로 나누 어져 있는데, 제 1 FAT 영역에 오류가 발생할 경우 전체 파일 시스템의 오류를 초래 할 수 있다. FAT 파일 시스템은 제 1 FAT 영역의 오류를 복구하기 위해 제 1 FAT 영역의 복사본을 가지고 제 1 FAT 영역 중 하나에 오류가 발생하여도 나머지 제 2 FAT을 통해 파일 시스템을 복구하도록 설계되어 있다. 하지만, FAT 영역과 디렉토리 정보에 대한 쓰기 동작 중에 전원 중단 및 미디어 탈착 등으로 쓰기 동작이 중단될 경우 파일 시스템에 심각한 오류가 발생하고, 오류를 복구하기 위한 동작에 오랜 시간이 걸리거나 복구가 불가능한 상태가 되는 경우가 많다.The structure of the FAT file system is divided into a first FAT area and a second FAT area. If an error occurs in the first FAT area, an error of the entire file system may occur. The FAT file system is designed to recover the file system through the remaining second FAT even if an error occurs in one of the first FAT areas with a copy of the first FAT area to recover the error of the first FAT area. However, if the write operation is interrupted due to power interruption or media removal while writing to the FAT area and directory information, a serious error occurs in the file system, and the operation to recover the error takes a long time or is impossible to recover. There are many cases.

따라서, 본 발명은 FAT 파일 시스템에 저널링(Journaling)을 적용하여 급작스러운 전원 중단 및 사용자의 미디어 탈착 등으로 인해 발생하는 파일 시스템 고장을 줄이고 고장이 발생하였을 경우에 효과적으로 고장을 복구하기 위한 방법에 관한 것이다.Accordingly, the present invention relates to a method for reducing the file system failure caused by sudden power interruption and user's media detachment by applying journaling to the FAT file system and effectively recovering the failure in the event of a failure. will be.

이와 같은 목적을 달성하기 위한 본 발명에 따른 저널링이 적용된 FAT 파일 시스템은 링크드 리스트로 표현된 데이터구조를 갖는 제 1 FAT 영역과 파일 생성에 따른 변화를 기록하는 로그영역의 역할을 하는 제 2 FAT 영역과 데이터 파일의 이름, 크기, 생성일시 및 데이터가 저장된 블럭의 처음 위치 정보를 가지고 있는 디렉토리 정보와 파일의 실제 데이터를 나타내는 사용자 데이터를 포함하여 이루어지는데 그 특징이 있다.The FAT file system to which the journaling is applied according to the present invention for achieving the above object has a first FAT area having a data structure represented by a linked list and a second FAT area serving as a log area for recording changes according to file generation. And directory information that contains the data file name, size, creation date and time of the block where the data is stored, and user data representing the actual data of the file.

상기 목적을 달성하기 위한 본 발명에 따른 저널링이 적용된 FAT 파일 시스 템의 구현방법은 상기 디렉토리 정보나 상기 제 1 FAT 영역을 변경하기 전에 상기 제 2 FAT 영역에 파일생성에 대한 로그를 기록하는 단계와, 상기 제 1 FAT 영역에서 비어있는 블럭을 찾아 해당하는 블록의 위치에 상기 사용자 데이터를 저장하고 상기 제 1 FAT 영역의 변경 내용을 상기 제 2 FAT 영역에 기록하는 단계와, 마지막 데이터까지 동작을 반복한 후 상기 제 2 FAT 영역에 기록된 로그를 참조하여 상기 제 1 FAT 영역과 상기 디렉토리 정보를 저장하는 단계를 포함하여 이루어지는데 그 특징이 있다.The implementation method of the FAT file system to which the journaling is applied according to the present invention for achieving the above object comprises the steps of: recording a log of file generation in the second FAT area before changing the directory information or the first FAT area; Finding an empty block in the first FAT area, storing the user data at a position of a corresponding block, recording the change of the first FAT area in the second FAT area, and repeating the operation until the last data; Thereafter, the method includes storing the first FAT area and the directory information with reference to a log recorded in the second FAT area.

상기 목적을 달성하기 위한 본발명에 따른 저널링이 적용된 FAT 파일 시스템의 복구방법은 전원이 중단되거나 미디어의 탈착중 문제가 발생하면 상기 제 2 FAT 영역에서 로그정보를 확인하는 단계와 트랜잭션 단계가 컴미트(commit) 이전 단계인지를 판단하는 단계와 상기 트랜잭션 단계가 컴미트(commit) 이전 단계일 경우, 롤백 포인트를 검색하는 단계와 검색된 롤백 포인트를 기준으로 롤백하여 복구를 진행하는 단계와 상기 트랜잭션 단계가 컴미트(commit) 이전 단계가 아닐 경우, 마지막으로 성공된 트랜잭션의 수행으로 기록된 메타데이터를 확인 후 롤백을 진행하는 단계를 포함하여 이루어지는데 그 특징이 있다.In the recovery method of a FAT file system to which journaling is applied according to the present invention for achieving the above object, when the power is interrupted or a problem occurs while the media is attached or detached, the log information in the second FAT area and the transaction step are committed. determining whether it is a previous step, and when the transaction step is a precommit step, retrieving a rollback point, rolling back based on the found rollback point, and performing a recovery; If it is not before the commit (commit), it comprises the step of performing a rollback after checking the metadata recorded by the execution of the last successful transaction.

도 1은 본 발명에 따른 저널링이 적용된 FAT 파일 시스템의 구조를 나타낸 도면.1 is a diagram showing the structure of a FAT file system to which journaling is applied according to the present invention.

도 1에 의하면, 저널링이 적용된 FAT 파일 시스템의 구조는 부트섹터(미도시), 제 1 FAT 영역(101), 제 2 FAT 영역(102), 디렉토리 정보 영역(103), 사용자 데이터 영역(104)로 구성된다.According to FIG. 1, the structure of a FAT file system to which journaling is applied is a boot sector (not shown), a first FAT area 101, a second FAT area 102, a directory information area 103, and a user data area 104. It consists of.

상기 제 1 FAT 영역(101)은 링크드 리스트로 표현된 데이터구조를 갖는다.The first FAT area 101 has a data structure represented by a linked list.

상기 제 1 FAT 영역(101)의 링크드 리스트 구조를 설명하면, 다음과 같다.The linked list structure of the first FAT area 101 will be described below.

상기 링크드 리스트는 일정한 순서를 가지는 데이터 항목들을 표현하는 방법 중의 하나이며, 배열과 같은 순차적 표현 방법과는 달리 데이터 항목들의 논리적인 순서만 유지되고 기억장소 내에서는 각 항목들의 임의의 위치를 가지도록 하는 자료구조이다.The linked list is one of methods of representing data items having a certain order, and unlike a sequential expression method such as an array, only the logical order of data items is maintained and an arbitrary position of each item in a storage location is maintained. It is a data structure.

상기 링크드 리스트에서는 각 데이터 항목들이 기억장소내의 어떤 위치에 어떤 항목이 있는 지를 표시해 주어야 한다. 이를 위해 데이터 항목에는 값뿐만 아니라 다음 항목의 위치 정보도 함께 저장해둔다. 위치정보의 저장에는 포인터가 사용된다. In the linked list, each data item should indicate which item is in which location in the storage. To do this, the data item stores not only the value but also the location information of the next item. The pointer is used to store the location information.

상기 링크드 리스트에서 포인터는 각 항목의 다음 순서인 항목이나 앞 순서인 항목의 위치를 가르키는 지시자이다. 링크드 리스트의 마지막 노드에는 다음 순서인 항목이 없고, 첫번째 노드에는 이전 순서인 항목이 없으므로 이들 포인터는 널(null)로 해주어야 한다.In the linked list, a pointer is an indicator indicating the position of the next or next item of each item. The last node in the linked list has no items in the next order, and the first node has no items in the previous order, so these pointers must be null.

포인터는 상기 링크드 리스트의 핵심이다. 링크드 리스트에서 공통적인 사항은 데이터 항목 간의 결합이 데이터 항목 자체 내에 포함되어 있는 정보에 의해 포인터의 형식으로 정의된다는 것이다. 이런 사실은 데이터 항목 간의 결합이 배열의 배치와 저장을 기반으로 하는 배열과 링크드 리스트를 분명히 구분하는 기준이다.The pointer is the heart of the linked list. Common to linked lists is that the association between data items is defined in the form of a pointer by the information contained within the data item itself. This is a clear distinction between arrays and linked lists based on the arrangement and storage of arrays of data items.

도 2은 제 1 FAT 영역에 저장될 입력자료가 저장장치의 빈 블록보다 많을 경우를 나타낸 예시도이다.FIG. 2 is an exemplary diagram illustrating a case where more input data to be stored in the first FAT area is than an empty block of the storage device.

도 2에 의하면, 입력자료는 4블록으로 구성되어 있는데, 저장장치에 비어있는 연속된 공간은 최고 3블록밖에 없다. 이럴 경우 배열로는 입력자료를 수용하지 못한다. 그러나 링크드 리스트를 이용하면 연속되지 않은 빈 공간들을 효율적으로 사용할 수 있다.According to Fig. 2, the input data is composed of four blocks, and only 3 blocks of empty contiguous space are stored in the storage device. In this case, the array cannot accept input data. However, linked lists allow you to efficiently use noncontiguous free spaces.

도 3는 입력자료가 저장장치의 빈 블록보다 많을 경우 링크드 리스트 형태로 저장되는 과정을 나타낸 예시도이다.3 is an exemplary diagram illustrating a process of storing input data in the form of a linked list when there are more input blocks than empty blocks of a storage device.

도 3에 의하면, 저장장치의 최초 연속해서 비어있는 3블록에 입력자료의 3블록이 저장되고 나머지 남은 입력자료의 1블록은 저장장치의 다음 빈 블록에 링크드 형식으로 저장되어 연결성이 보장된다.According to FIG. 3, three blocks of input data are stored in three consecutive empty blocks of the storage device, and one block of the remaining input data is stored in a linked form in the next empty block of the storage device to ensure connectivity.

본 발명에 따른 상기 제 2 FAT 영역(102)는 기존과 같이 상기 제 1 FAT 영역을 복사한 동일한 값의 구조로 사용하는 것이 아니라, 로그 데이터가 저장될 로그영역으로 사용된다.The second FAT area 102 according to the present invention is used as a log area in which log data is to be stored, rather than using the same value structure in which the first FAT area is copied.

상기 제 2 FAT 영역은 상기 제 1 FAT 영역의 변경 되어가는 내용을 로그데이터로 기록하여 여러 가지 문제가 발생하였을 경우, 복구 시점을 판단할 수 있는 중요한 역할을 담당한다.The second FAT area plays an important role in determining a recovery time point when various problems occur by recording the changed contents of the first FAT area as log data.

상기 디렉토리 정보(103)는 데이터 파일의 이름, 크기, 생성일시 및 데이터가 저장된 블록의 처음 위치 정보를 가지며, 최종적인 정보의 저장은 제 2 FAT 영역의 메타데이터를 기준으로 기록된다.The directory information 103 has a name, a size, a creation date and time of a block in which data is stored, and the storage of the final information is recorded based on metadata of the second FAT area.

상기 사용자 데이터(104)는 파일의 실제 데이터를 나타낸다.The user data 104 represents the actual data of the file.

저널링 파일 시스템(journaling file system)이란 백업 및 복구 능력이 있는 파일 시스템을 말한다. 디스크에 있는 인덱스가 갱신되기 전에 관련 내용이 로그에 기록되기 때문에 정전이나 다른 문제 때문에 인텍스에 이상이 생기더라도 다시 시스템을 재가동하면 운영체제가 로그를 보고 인덱스를 재작성 및 복구를 할 수 있게 된다.A journaling file system is a file system with backup and recovery capabilities. Since the index is written to the log before the index on the disk is updated, even if the index fails due to a power failure or other problem, restarting the system will allow the operating system to view the log and rebuild and restore the index.

저널링 파일시스템은 디스크에 적용되는 변화를 로그로 남기기 때문에 전통적인 파일 시스템보다 안전하다. 저널링 파일 시스템은 변화를 커미트(commmit)하거나 RDBMS(relational database management system) 처럼 트랜잭션 방법으로 이전으로 되돌릴 수 있다.Journaling filesystems are more secure than traditional filesystems because they log changes made to disk. Journaling file systems can either commit changes or revert back to transactional methods, such as a relational database management system (RDBMS).

도 4는 본 발명에 따른 저널링이 적용된 FAT 파일 시스템의 구현과정을 나타낸 흐름도이다.4 is a flowchart illustrating an implementation process of a FAT file system to which journaling is applied according to the present invention.

도 3을 참조하여, 도 4를 설명하면 다음과 같다.Referring to FIG. 3, FIG. 4 is as follows.

파일이 생성되는 과정을 예를 들어 설명하면, 데이터 파일의 파일 이름, 크기, 생성일시 및 데이터가 저장된 블록의 처음 위치에 대한 정보를 가지고 있는 디렉토리 정보 영역(103)과 제 1 FAT 영역(102)의 빈 블록에 데이터가 저장되기 이전에 사용자가 파일을 생성하기 위해 작업을 시작하는 순간, 즉, 에이피아이(API,Application Programming Interface)를 호출하는 순간부터의 로그를 기록하게 된다. 운영체계가 함수를 호출하여 작업을 시작하는 순간부터의 기록을 의미한다.A process of creating a file will be described by way of example. The directory information area 103 and the first FAT area 102, which contain information on the file name, size, creation date and time of the block in which the data is stored, are stored. Before the data is stored in the empty block, the log is recorded from the moment when the user starts to create the file, that is, the moment the API is called. This is the record from the moment the operating system starts a function call.

로그의 기록과정은 다음과 같이 설명할 수 있다.The logging process can be explained as follows.

로그는 원형의 버퍼 구조 형태로 순환적으로 데이터들이 되고 버퍼의 끝에 도달하면 데이터들은 다시 버퍼의 가장 앞쪽에 저장되는 구조로 이루어져 있다. 로그상에는 테이터를 지정하는 포인터가 존재하여 테이터를 구분할 수 있는데, 로그의 내용은 계속해서 수정되는 파일 시스템에 대한 로그 레코드가 추가되어 갈 뿐 일반적인 파일 시스템운영에서는 로그에 대한 읽기와 쓰기 같은 접근은 이루어 지지 않는다. The log consists of circular buffer structure and the data are cyclically stored. When the end of the buffer is reached, the data is stored in the front of the buffer again. In the log, there is a pointer to designate the data to distinguish the data. The log contents are added to the log record for the file system that is continuously modified. In normal file system operation, access such as reading and writing to the log is performed. I do not lose.

로그는 원형의 버퍼와 같은 구조로 되어 있기 때문에 시간이 지나면 포화 상태가 된다. 그러므로 로그 영역이 포화가 되면 가장 오래된 로그 레코드 순으로 삭제하는 동작을 수행해야 한다.Since the log has a circular buffer-like structure, it becomes saturated over time. Therefore, when the log area becomes saturated, the oldest log record must be deleted.

디스크의 빈 블록 비트맵이나 인노드(inode)가 포함된 블록에 대한 수정을 하기 전에 반드시 로그에 대한 트랜잭션을 수행한다.Before modifying an empty block bitmap or a block containing an inode, a transaction must be performed on the log.

이와 같은 로그 기록 형식으로 제 2 FAT 영역(102)에 로그를 기록한 후, 상기 제 1 FAT 영역(101)에서 비어있는 블록을 찾아 해당하는 블록의 위치에 링크드 리스트 형식으로 상기 사용자 데이터(104)를 저장하고 상기 제 2 FAT 영역(102)에 상기 제 1 FAT 영역의(101) 변경 내용에 대한 로그를 기록한다.After the log is recorded in the second FAT area 102 in this log recording format, the empty block is found in the first FAT area 101, and the user data 104 is stored in the linked list at the position of the corresponding block. And stores a log of changes made to the first FAT area 101 in the second FAT area 102.

사용자에 의해 자료입력이 끝나면, 마지막 데이터까지 동작을 반복한 후 상기 제 2 FAT 영역(102)에 기록된 로그를 확인하여 최종적인 정보를 상기 제 1 FAT 영역(101)과 상기 디렉토리 정보(103)에 저장한다.After inputting data by the user, the operation is repeated until the last data, and then the log recorded in the second FAT area 102 is checked and final information is transferred to the first FAT area 101 and the directory information 103. Store in

이렇게 하면, 입력된 자료의 정보가 메타데이터로 저장되어 로그영역에 남게 된다. 문제가 발생 될 경우에 로그영역을 참조하여 메타데이터를 검색해 복구를 진 행할 수 있다.In this way, the information of the input data is stored as metadata and remains in the log area. If a problem occurs, you can search the metadata to recover the metadata.

자료 입력 과정이나 미디어를 탈착시에 문제가 발생하였을 때, 저널링이 적용된 FAT 시스템에서의 복구하는 과정을 설명하고자 한다.This article describes how to recover a journaling applied FAT system when a problem occurs during data entry or removal of media.

상기와 같이, 수정작업을 하기전에는 반드시 로그에 대한 트랜잭션을 수행하야 하는데, 먼저 수행할 파일 작성 트랜잭션에 대한 ID를 획득하기 위해서 새로운 트랜잭션 할당을 수행한다.As described above, before modifying, a log transaction must be executed. In order to obtain an ID for a file creation transaction to be executed, a new transaction allocation is performed.

디스크상의 블록을 변경하기 전에 반드시 로그에 기록해야하기 때문에 트랜잭션별로 할당되어 있는 관리 데이터와 링크되어 메모리에 저장된다. 이 단계는 아직 로그에 저장된 상태는 아니다. 단지 트랜잭션에 로컬로 저장된 상태이다.Since the log must be written before changing the block on disk, it is linked to the management data allocated for each transaction and stored in memory. This step is not yet stored in the log. It is only stored locally in the transaction.

트랜잭션 추가 단계에서 만들어진 트랜잭션의 내용을 로그에 저장하는 동작을 수행한다. 롤백이라는 동작도 수행 되는데 롤백은 트랜잭션 중에서 수행한 수정을 취소할 경우 수행회든 것으로 에러가 발생했을 경우에도 수행된다.Saves the contents of the transaction created in the transaction addition step to the log. A rollback operation is also performed. Rollback is also performed when an error occurs when canceling a modification made during a transaction.

도 4은 본 발명에 따른 트랜잭션의 원리를 나타내는 도면이다.4 is a diagram illustrating the principle of a transaction according to the present invention.

도 4에 의하면, 사용자가 인서트(INSERT)(301)문을 사용해 데이터를 삽입하고, 업데이트(UPDATE)(302)문으로 데이터를 갱신하고, 딜리트(DELETE)(303) 문으로 데이터를 삭제하였다고 했을 때, 만약 이 모든 과정이 오류 없이 수행되었다면 지금까지 실행한 모든 작업을 '실제로' 수행하라는 명령을 내릴 수 있는데 이때의 명령이 바로 컴미트(COMMIT)(304) 명령이다.According to FIG. 4, a user inserts data using an INSERT 301 statement, updates data with an UPDATE 302 statement, and deletes data with a DELETE 303 statement. In this case, if all of these processes were performed without error, the command to execute 'actually' all the operations executed so far is the COMMIT 304 command.

상기 컴미트(COMMIT)(304) 명령을 주기 전까지의 모든 작업은 롤백(ROLLBACK)(306) 명령으로 원상태로 되돌릴 수 있다. All work up to the COMMIT 304 command can be returned to the original state with the ROLLBACK 306 command.

만약 상기 인서트(INSERT)(301) 작업을 한 다음 세이브포인트 에이(SAVEPOINT A)(305)라는 명령을 실행하였다면 나중에 롤백에이(ROLLBACK A)(305)라는 명령을 통해 상기 인서트(INSERT)(301) 작업을 한 그 위치로 되돌아 올 수 있는 것이다. 그 전에 상기 컴미트(COMMIT)(304) 명령을 실행하지 않았다는 전제가 필요하다. If the insert 301 is executed and a savepoint A 305 command is executed, the insert 301 can be executed later using a rollback a 305 command. You can come back to where you did your work. It is necessary to assume that the COMMIT 304 command has not been executed before.

이와 같이 상기 컴미트(COMMIT)(304) 명령으로 하나의 작업이 성공적으로 끝났을 때 트랜잭션이 성공적으로 수행되는 것이다.As such, when a task is completed successfully by the COMMIT 304 command, the transaction is successfully executed.

데이터베이스에서 트랜잭션(Transaction)이란 논리적인 일의 단위를 말한다.In a database, a transaction is a logical unit of work.

메타데이터를 변경하기 전 이러한 수행과정을 통하여 로그를 기록하게 된다.The log is recorded through this process before the metadata is changed.

도 6는 본 발명에 따른 저널링이 적용된 FAT 파일 시스템에서 시스템을 복구하는 과정을 나타내는 흐름도.6 is a flowchart illustrating a process of recovering a system in a FAT file system to which journaling is applied according to the present invention.

도 6에 의하면, 전원 공급 중단이나 사용자의 미디어 탈착시 문제가 발생하면 정상적인 수행과정을 마치지 못하게 된다(401).According to FIG. 6, if a problem occurs when the power supply is interrupted or the user detaches the media, the normal execution process cannot be completed (401).

정상적인 수행과정을 마치지 못하여 문제가 발생하게 되면 제 2 FAT 영역(로그영역)(102)에서 현재까지 진행되고 있었던 과정을 로그데이터를 통해 확인한다(402).If a problem occurs due to the failure of the normal execution process, the process that has been progressing up to now in the second FAT area (log area) 102 is confirmed through the log data (402).

로그의 정보를 확인 후, 트랜잭션 단계가 컴미트 명령을 내리기 전단계인지, 컴미트 명령을 내린 후인지는 판단하게 된다(403).After checking the information in the log, it is determined whether the transaction step is before the commit command or after the commit command (403).

만약, 트랜잭션 단계가 컴미트 명령을 내리기 전이라면, 롤백 포인트를 검색 하게 된다(404).If the transaction step is before issuing a commit command, the rollback point is retrieved (404).

롤백 포인트가 파악이 되면 포인트를 찾아서 롤백을 진행하여 복구(406)를 완료한다.Once the rollback point is identified, the point is found and rolled back to complete the recovery (406).

이미 컴미트 명령을 내린 후라면, 마지막으로 성공된 트랜잭션의 수행으로 기록된 메타데이터를 로그정보를 통해 확인한 후, 이전상태로 롤백을 진행하여 완료한다(405)If the commit command has already been issued, the metadata recorded by the execution of the last successful transaction is confirmed through the log information, and then rollback is completed to the previous state (405).

기존의 FAT 파일시스템의 제 2 FAT 영역을 로그영역으로 사용한 저널링을 이용하면 상기와 같이 제 1 FAT 영역의 변경내용을 제 2 FAT 영역에 복사해놓는 방식에서 벗어나 긴급한 상황에서 로그를 이용하여 문제를 해결할 수 있게 된다.If journaling using the second FAT area of the existing FAT file system is used as the log area, the problem of using the log in an emergency situation is eliminated from the method of copying the changes of the first FAT area to the second FAT area as described above. It can be solved.

본 발명은 컴퓨터 및 임베디드 시스템의 하드 디스크나 낸드 플래쉬 메모리 같은 고정식 미디어 및 컴팩 플래쉬나 유에스(USB) 메모리와 같은 이동식 미디어 등에 많이 사용되는 FAT 파일 시스템에 적용될 수 있다.The present invention can be applied to a FAT file system which is widely used for fixed media such as hard disks and NAND flash memories of computers and embedded systems, and removable media such as compact flash or USB memory.

실시 예로 저널링은 리눅스의 EXT3 및 JFFS 등에도 적용되어 있는 기법으로 시스템의 안정성을 크게 향상시키는 기법으로 점차 그 사용 범위가 증가하는 추세이다.As an example, journaling is a technique applied to Linux's EXT3 and JFFS, and it is a technique that greatly improves system stability.

이상에서 본 발명에 대하여 그 바람직한 실시예를 중심으로 설명하였으나 이는 단지 예시일 뿐 본 발명을 한정하는 것이 아니며, 본 발명이 속하는 분야의 통상의 지식을 가진 자라면 본 발명의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 예를 들어, 본 발명의 실시예에 구체적으로 나타난 각 구성 요소는 변형하여 실시할 수 있는 것이다. 그리고 이러한 변형과 응용에 관계된 차이점들은 첨부된 청구 범위에서 규정하는 본 발명의 범위에 포함되는 것으로 해석되어야 할 것이다.The present invention has been described above with reference to the preferred embodiments, which are merely examples and are not intended to limit the present invention, and those skilled in the art to which the present invention pertains do not depart from the essential characteristics of the present invention. It will be appreciated that various modifications and applications are not possible that are not illustrated above. For example, each component specifically shown in the embodiment of the present invention can be modified. And differences relating to such modifications and applications will have to be construed as being included in the scope of the invention defined in the appended claims.

저널링(Journaling) 기법을 이용한 본 발명을 도입하면 FAT(file allocation table)테이블 및 루트 디렉토리 엔트리(root directory entry) 정보 기록 도중 전원중단 및 미디어 탈착의 위험에 노출될 확률을 현격히 낮출 수 있다. 또한 오류가 발생하였을 경우에는 미리 저장된 로그 정보를 통해 신속히 복구를 할 수 있는 효과가 있다 The present invention using the journaling technique can significantly reduce the risk of power failure and media detachment during recording of FAT (file allocation table) and root directory entry information. In addition, when an error occurs, it is possible to recover quickly through the previously stored log information.

Claims (7)

복수 개의 FAT 영역을 갖는 파일 시스템에 있어서,In a file system having a plurality of FAT areas, 파일 생성에 대한 로그를 제 2 FAT 영역에 기록하는 단계;Recording a log for file creation in a second FAT area; 상기 제 2 FAT 영역에 로그를 기록 후, 제 1 FAT 영역의 빈 블록에 사용자 데이터를 저장하는 단계;Storing user data in an empty block of the first FAT area after recording a log in the second FAT area; 상기 사용자 데이터의 저장이 끝날 때까지, 상기 제 1 FAT 영역의 변경된 내용을 제 2 FAT 영역에 로그를 각각 기록하는 단계;Recording the changed contents of the first FAT area in a second FAT area, respectively, until the storage of the user data is finished; 상기 사용자 데이터를 저장 및 로그를 기록하는 과정을 반복하는 단계;를 포함하는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.And repeating the process of storing the user data and recording a log. 제 1 항에 있어서,The method of claim 1, 상기 FAT 파일 시스템은 고정식 미디어 및 이동식 미디어에 사용되는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.And the FAT file system is used for fixed media and removable media. 상기 사용자 데이터의 저장이 끝나기 전에 문제 발생시 데이터를 복구하는 방법에 있어서,In the method of recovering data when a problem occurs before the end of storing the user data, 상기 제 2 FAT 영역에서 복구 시점을 확인하기 위한 로그정보를 읽는 단계;Reading log information for identifying a recovery point in the second FAT area; 상기 로그정보를 확인하여 상기 제 1 FAT 영역과 상기 디렉토리 영역에 데이터를 기록하는 단계;를 더 포함하는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.And confirming the log information and recording data in the first FAT area and the directory area. 제 3 항에 있어서,The method of claim 3, wherein 상기 제 2 FAT 영역의 로그정보는 트랜잭션 이전상태 또는 트랜잭션 과정 중 롤백 포인트의 위치 정보를 확인할 수 있는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.The log information of the second FAT area is a method of implementing a journaling applied FAT file system, characterized in that the position information of the rollback point during the transaction or during the transaction process can be confirmed. 제 4 항에 있어서,The method of claim 4, wherein 상기 롤백 포인트는 트랜잭션이 컴미트(commit) 명령을 수행했는지의 여부를 판단하는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.And the rollback point determines whether or not the transaction has performed a commit command. 제 4 항에 있어서,The method of claim 4, wherein 상기 롤백 포인트는 트랜잭션이 컴미트(commit) 명령을 수행하기 이전 단계일 때, 검색된 롤백 포인트를 기준으로 롤백을 수행하는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법.And wherein the rollback point is to perform a rollback based on the retrieved rollback point when the transaction is before the commit command. 제 4 항에 있어서,The method of claim 4, wherein 상기 롤백 포인트는 트랜잭션이 컴미트(commit) 명령을 이미 수행했을 때, 마지막으로 성공된 트랜잭션의 수행으로 기록된 메타데이터를 확인 후 롤백을 진행하는 것을 특징으로 하는 저널링이 적용된 FAT 파일 시스템의 구현방법The rollback point is a method of implementing a journaling applied FAT file system, when the transaction has already performed a commit command, rollback is performed after checking the metadata recorded by the execution of the last successful transaction.
KR1020050131240A 2005-12-28 2005-12-28 An implementation method of FAT file system which the journaling is applied method KR100775141B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020050131240A KR100775141B1 (en) 2005-12-28 2005-12-28 An implementation method of FAT file system which the journaling is applied method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020050131240A KR100775141B1 (en) 2005-12-28 2005-12-28 An implementation method of FAT file system which the journaling is applied method

Publications (2)

Publication Number Publication Date
KR20070069295A true KR20070069295A (en) 2007-07-03
KR100775141B1 KR100775141B1 (en) 2007-11-12

Family

ID=38504932

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020050131240A KR100775141B1 (en) 2005-12-28 2005-12-28 An implementation method of FAT file system which the journaling is applied method

Country Status (1)

Country Link
KR (1) KR100775141B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100954603B1 (en) * 2008-05-16 2010-04-26 주식회사 휴원 A log file of file system and method for recovering file system
KR100987320B1 (en) * 2008-07-24 2010-10-12 강릉원주대학교산학협력단 Data processing apparatus and Data procssing method, using FAT file system capable of fast file recovery

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100260028B1 (en) * 1996-08-13 2000-06-15 윤종용 Data recovery method in a file system
JP2001101044A (en) * 1999-09-29 2001-04-13 Toshiba Corp Transactional file managing method and transactional file system and composite transactional file system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100954603B1 (en) * 2008-05-16 2010-04-26 주식회사 휴원 A log file of file system and method for recovering file system
KR100987320B1 (en) * 2008-07-24 2010-10-12 강릉원주대학교산학협력단 Data processing apparatus and Data procssing method, using FAT file system capable of fast file recovery

Also Published As

Publication number Publication date
KR100775141B1 (en) 2007-11-12

Similar Documents

Publication Publication Date Title
US7363540B2 (en) Transaction-safe FAT file system improvements
US11301379B2 (en) Access request processing method and apparatus, and computer device
US10235375B1 (en) Persistent file system objects for management of databases
US8856469B2 (en) Apparatus and method for logging optimization using non-volatile memory
EP1739535B1 (en) File system storing transaction records in flash-like media
US7174420B2 (en) Transaction-safe FAT file system
US8150851B2 (en) Data processing apparatus and method of processing data
US8239356B2 (en) Methods and apparatuses for data protection
EP1744246B1 (en) File system having deferred verification of data integrity
US7694105B2 (en) Data storage systems that implement sector sets
EP1744247B1 (en) Optimized startup verification of file system integrity
US7383465B1 (en) Undoable volume using write logging
KR20090087509A (en) Nonvolatile disk cache for data security
WO2013074914A1 (en) Method of and system for merging, storing and retrieving incremental backup data
CN103207883A (en) Method For Metadata Persistence
US10977143B2 (en) Mirrored write ahead logs for data storage system
US8060481B1 (en) Time indexed file system
US11204912B2 (en) Commit coalescing for micro-journal based transaction logging
US9411692B2 (en) Applying write elision
JP4159506B2 (en) Hierarchical storage device, recovery method thereof, and recovery program
KR100775141B1 (en) An implementation method of FAT file system which the journaling is applied method
US10452496B2 (en) System and method for managing storage transaction requests
JP2007305012A (en) Hsm control program, hsm controller, and hsm control method
CN114442941A (en) Data migration method, system, storage medium and equipment
KR20060135248A (en) File system recovery method and system for portable terminal with hard disk drive

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
G170 Publication of correction
FPAY Annual fee payment

Payment date: 20121026

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20131024

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20141024

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20151023

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee