Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [107]

By Root 1406 0
a filesystem to instantly recover to the last good state after a system crash. After the system reboots, outstanding consistent entries in the journal are replayed (committed to disk), while any remaining inconsistent entries are discarded. This process is often referred to as a log replay. The benefit here is that you don't have to wait for a large filesystem to fsck. Journaling is especially helpful when working with RAID because arrays tend to be larger than single disks, which already take a long time to fsck. Imagine waiting for fsck to complete on a terabyte RAID partition that is using ext2. The downtime could be hours, or even days! With a journaling filesystem, the replay process generally takes only a few seconds, or at most a few minutes.

Doesn't journaling hurt performance?

Normally, the process of maintaining a journal would carry serious performance overhead. However, two factors help alleviate this additional load. First, journaling usually records only metadata, which has a very small overhead. Second, unlike traditional Unix filesystems, most journaling filesystems are designed with performance in mind. While a well-designed nonjournaling filesystem would outperform a similarly designed journaling filesystem, the new journaling filesystems available for Linux typically perform at least as well as legacy filesystems.

Just as RAID offers varying trade-offs between performance and reliability, so do journaling filesystems. While all journaling filesystems support metadata journaling, some support data journaling as well.

The Linux Virtual Filesystem (VFS)

The Virtual Filesystem (VFS) was developed to provide a common interface for many filesystems to interoperate with the Linux kernel. The VFS is an additional layer of abstraction between specific filesystem implementations and system calls. Figure 6-1 illustrates the relationship between filesystems, block devices, and the VFS.

Figure 6-1. The Linux Virtual Filesystem.

The Linux kernel and the VFS impose some limits that affect the usability of any filesystem. Originally, the Linux file access API used a signed 32-bit value to represent file sizes on 32-bit systems such as x86 and PowerPC. This imposed a serious limit because file size could never be larger than a single 32-bit value. Using 32-bit values to store file sizes limits users to a maximal file size of 231 (2,147,483,648) bits or 2 GB. Beginning with the 2.4 series kernel, this limit was raised to 1 terabyte (TB) or 1000 GB. Patches to correct the 2 GB limitation are available for 2.0 and 2.2 series kernels. Libraries and applications must also be patched if you want large file support. So even with a patched kernel, not all applications will support large file sizes natively. For more information on large file support, see http://www.suse.de/~aj/linux_lfs.html. Also note that many distributions that shipped 2.0 and 2.2 series kernels came with large file support already implemented. Check the specific distribution if you are unable to use 2.4, or later, kernels.

Limits on file sizes are also imposed by the filesystem, but these usually exceed the kernel API limit significantly. For general purposes, the maximum file size for any filesystem is limited to 1 TB, although filesystems could support larger sizes natively.

The maximum size of a filesystem on a 32-bit system is also limited by the kernel. Linux imposes a hard limit of 2 TB on any filesystem. In fact, the hard limit for just about anything running under Linux, as of version 2.4, is 2 TB. This 2 TB limit is much smaller than many filesystems are capable of supporting.

64-bit architectures

64-bit systems are not subject to the same limitations as 32-bit systems because they use a 64-bit value to represent file sizes. On 64-bit systems such as Alpha and IA64, files can be as large as 263, 8 exabytes (EB), or 8 million TB.

ext2

ext2, originally released in 1993, has a single advantage over the new, high-performance filesystems available to Linux users: it is the most widely implemented filesystem for Linux and has

Return Main Page Previous Page Next Page

®Online Book Reader