Jump to content

JFS (file system)

From Alfawiki
Journaled File System (JFS)
Company typeSoftware
IndustryComputer software, File systems
Founded1990; 36 years ago (1990)
FounderIBM
ProductsJournaling file system
Websitesourceforge.net/projects/jfs-linux/

Journaled File System (JFS) is a 64-bit journaling file system originally created by IBM, available for platforms such as AIX, OS/2, eComStation, ArcaOS, and Linux. The Linux variant is distributed under the GNU General Public License (GPL) as free software. It is important to note that HP-UX employs a distinct JFS, which is an OEM adaptation of Veritas Software's VxFS.

Within AIX, two generations of JFS exist: the initial JFS (also called JFS1) and the more advanced JFS2. IBM developed the first generation primarily for 32-bit systems, whereas JFS2 was designed to support 64-bit architectures. Other operating systems, including OS/2 and Linux, utilize only the second generation, commonly referred to simply as JFS.

History

The debut of JFS occurred with the release of AIX 3.1 in 1990. Termed JFS1 on AIX, it served as the default file system on AIX for more than ten years and was extensively adopted by users. Its architecture is tightly coupled with AIX’s memory management system, reflecting its design for a single operating environment. JFS was among the pioneering file systems to implement journaling technology.

Starting in 1995, IBM undertook efforts to enhance JFS by improving scalability and enabling support for multiprocessor systems, with an objective of making it portable across different platforms. This revamped version of JFS was introduced in OS/2 Warp Server for eBusiness in April 1999 and later included in OS/2 Warp Client by October 2000. In December 1999, IBM contributed the OS/2 JFS source code to the open-source community, which initiated its porting to Linux. The first stable Linux release was published in June 2001 and has since been maintained by the JFS Core Team. This open-source foundation also allowed a subsequent re-port back to OS/2.

Simultaneously, certain developers merged the updated JFS code back into AIX, culminating in the release of the Enhanced Journaled File System (JFS2) alongside AIX 5L in May 2001.

By early 2008, doubts emerged regarding IBM’s ongoing dedication to supporting JFS as a production-grade file system. Nevertheless, IBM’s Linux Technology Center together with the JFS Core Team continue to oversee Linux kernel developments and address any identified defects. Some Linux distributions opt not to include JFS support due to resource allocation priorities.

In 2012, JFS incorporated support for the TRIM command on solid-state drives, thereby improving its performance with contemporary storage devices.

Features

The following capabilities are supported by JFS.

Journal

JFS is a journaling file system that integrated journaling from its initial design phase, unlike ext3 which added this feature later. Its journal can reach sizes up to 128 MB and logs only metadata changes, ensuring metadata integrity while user data might still be vulnerable to corruption after unexpected shutdowns. This journaling method resembles that of XFS, concentrating on specific parts of the inode.

B+ tree

To accelerate directory searches, JFS employs a B+ tree structure. Initially, up to eight directory entries are stored within an inode before additional entries are managed through a B+ tree. Extents are similarly indexed using B+ trees to facilitate efficient retrieval.

Dynamic inode allocation

Disk inode space is allocated dynamically according to demand. Each inode consumes 512 bytes, with allocations made in groups of 32 inodes per 16 kB extent.

Extents

File storage utilizes extents—contiguous sequences of blocks whose length can vary—and these extents may span multiple allocation groups. To streamline extent identification and access, they are organized within a B+ tree index.

Compression

Compression functionality is available exclusively in JFS1 on AIX, utilizing an algorithm based on LZ compression. Because it results in significant CPU consumption and heightened fragmentation, it is advisable to use compression solely on single-user workstations or within offline backup scenarios.

Concurrent input / output (CIO)

Under normal circumstances, JFS enforces read-shared and write-exclusive locks to avoid data corruption, serializing write operations at the file level. Enabling the CIO feature turns off this locking mechanism, which benefits applications such as relational databases that handle their own data integrity, by reducing filesystem overhead.

Allocation groups

To improve input/output efficiency through optimized resource allocation, JFS segments the total storage into allocation groups (AGs). It groups related disk blocks and inodes within the same AG to maintain locality, while spreading unrelated data across different AGs to limit fragmentation. When a file is accessed, its corresponding AG is locked so that only that file can expand within it, further minimizing fragmentation.

Superblocks

The superblock contains essential metadata about the filesystem, including:

  • Total filesystem size
  • Count of data blocks
  • Filesystem state indicator
  • Sizes of allocation groups
  • Block size of the filesystem

On Linux

JFS support on Linux is provided through a kernel module available since version 2.4.18pre9-ac4, accompanied by the userspace package JFSutils. The majority of Linux distributions include JFS by default unless omitted for space-saving reasons, such as on live CDs.

Performance tests demonstrate that JFS delivers consistent and efficient results across diverse workloads. Although it occupies a relatively small niche, JFS distinguishes itself by offering a case-insensitive mount option rarely found in Linux filesystems.

Nevertheless, the journal write method employed by JFS can potentially postpone commit operations indefinitely, which may introduce risks of data loss under specific conditions.

See also

External links