Книга: Fedora™ Unleashed, 2008 edition

Journaling Options in ext3

Journaling Options in ext3

The ext3 file system has several options that, depending on your needs, allow you to select how much information is journaled. Generally speaking, the typical journal requires a second or so to be read and recovered. The time needed to recover from an improper shutdown of a journaled file system is not dependent on the file system size, but the amount of data in the journal.

The default setting provided by Fedora is adequate for most needs. The optimal choice depends on so many factors (computer usage, hardware used, and testing and evaluation methods) that a meaningful discussion is beyond the scope of this chapter. You learn in this chapter what the choices are and how they differ, but whether a choice is right for you can only be determined on an individual basis.

Like all journaling file systems, the traditional file system check (fsck) is not necessary on an ext3 file system. Although only mildly annoying on a 20GB drive on your machine at home, imagine the seemingly endless hours that an fsck would take to run on a terabyte of data. This feature is shared in common with the other journaling file systems.

When choosing journaling options, you can trade off data integrity (keeping your data current and valid) for data transfer speed in your file system's operation; you cannot have both because of the nature of the file system design. You can choose to expose some of your data to potential damage in the case of an improper shutdown in exchange for faster data handling, or you can sacrifice some speed to keep the state of the file system consistent with the state of the operating system.

Three modes available as options to ext3 are as follows:

writeback — Enables old data to stay in the file system, attaining the fastest speed possible. It does not schedule any data writes; it just enables the kernel's 30-second writeback code to flush the buffer.

ordered — Keeps the data consistent, but with some sacrifice in speed (the default mode for Fedora).

journal — Requires more disk space to journal more data. You might see slower performance because data is written twice, but there are some speed benefits if you are doing synchronous data writes, as in database operations.

For most of us, the default selection represents a good trade-off. Fedora supports booting from an ext3 formatted root file system with the proper drivers loaded in the initrd image.

You select the mode by using the appropriate mount option in /etc/fstab. For example, to set the file system mode to the fastest of the three modes, use data=writeback as the option. For more details, enter man mount.

Оглавление книги


Генерация: 1.085. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз