Log-structured File System (LFS), Journaling file system

Log-structured File System (LFS): Log-structured File System is a type of implementation of a file system where entire disk is structured as a log. All the write operations are buffered in the memory as a single segment. When writing has to be done, it is written as a single contiguous segment at the end of the log. I-nodes, data blocks and directory blocks are all present in a segment. In this method i-nodes are not in a specific location but all over the segment. Hence, it is difficult to locate an I-node in the segment. To solve this problem an I-node map is used. I-nodes are indexed in the map by using i-number. This map is cached in the memory, since it will be used all the time. Once an I-node is located, then blocks of the file can be located. In LFS there is a cleaner thread which is used for scanning the entire log. It scans segments to check single i-nodes and blocks to see if they required. If they are not required then they are freed. Similarly if a segment is not required then it is made free.

Journaling file system: In journaling file system, a log is created before making any changes in the file system. When the tasks are completed, log entries are no longer needed and they are deleted from the system. It saves the file system from any system crashes and hardware failures. When the system is booted again the log files are checked to see what was going on in the file system and the tasks can be run again. In journaling file system a task has to be made repetitive and it should be in such a way that when it is repeated the results should be exactly the same as anticipated. This type of file system is used in NTFS file system.

Leave a Reply