Linux Today: Linux News On Internet Time.

More on LinuxToday

Debian Planet: HOWTOs: Filesystems - Part I

Sep 16, 2001, 14:05 (0 Talkback[s])

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

"There has been much hype about journaled filesystems for GNU/Linux in recent months, and Debian Planet has hosted its fair share of articles concerning various alternative filesystems. In this series of articles we will take you through these filesystems, giving background information, history and tips. Furthermore in each article we will install and use the filesystem covered and provide benchmarks (which should only used in comparison with those disclosed within other articles within this series).

But first a bit about filesystems in general. Your files and data are stored in sections of disk known as blocks. The drive head on the disk knows how to find and read these blocks and return them to the CPU for processing. However, these blocks are not particularly useful to read and write to at a raw level, so there is a filesystem which provides the user with a way of managing his or her files. The filesystem presents a hierarchical structure to the user. When the user attempts to read a file, the filesystem reads the blocks from the drive which the filesystem maps to.

Journalled filesystems are designed to help protect the data stored on them. In general with a traditional filesystem, when you perform write actions on a device, the data to be written is stored in buffers and then only written when the filesystem is unmounted, when the system load is suitable or when a user uses sync. However if a power failure occurs before this data has been written to disk or the drive was not unmounted, the filesystem maybe in an incomplete state. The usual solution to this problem is to run a filesystem checker such as fsck on these filesystems to remove any inconsistencies. However as drive capacities become larger, this lengthy operation is becoming annoying and costly , particularly to those who need high availability. The solution is journalled filesystems. Journalled filesystems keep a log of all pending writes to be carried out on the drive. As these writes are carried out the journal is flushed, keeping the disk up to date. If a power failure occurs or if the drive is not unmounted cleanly, the journal is read and the actions listed in it are "replayed", this is much quicker than doing a filesystem check each time."

Complete Story

Related Stories: