Jump to content

ext3

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tytso (talk | contribs) at 15:41, 12 July 2006 (Add reference to ext3dev/ext4 wiki). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
ext3
Developer(s)Stephen Tweedie (ext3 design and implementation), Rémy Card (original ext2 design and implementation), Theodore Ts'o (tools and improvements), Andreas Gruenbacher (xattrs and ACLs), Andreas Dilger (online resizing), et al
Full nameThird extended file system
IntroducedNovember 2001 with Linux 2.4.15
Partition IDs0x83 (MBR)
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (GPT)
Structures
Directory contentsTable, Tree
File allocationbitmap (free space), table (metadata)
Bad blocksTable
Limits
Max volume size32TiB
Max file size2TiB
Max no. of filesVariable1
Max filename length255 bytes
Allowed filename
characters
All bytes except NUL and '/'
Features
Dates recordedmodification (mtime), attribute modification (ctime), access (atime)
Date rangeDecember 14, 1901 - January 18, 2038
ForksYes
AttributesNo-atime, append-only, synchronous-write, no-dump, h-tree (directory), immutable, journal, secure-delete, top (directory), allow-undelete
File system
permissions
Unix permissions, ACLs and arbitrary security attributes (Linux 2.6 and later)
Transparent
compression
No
Transparent
encryption
No (provided at the block device level)

The ext3 or third extended filesystem is a journalled file system that is commonly used by the Linux operating system. It is the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extending ext2 in a February 1999 kernel mailing list posting [1] and the filesystem was merged with the mainline kernel from 2.4.15 onwards[2]

Although its performance and scalability is less attractive than competitors such as ReiserFS and XFS, it does have the significant advantage in that it allows in-place upgrades from the popular ext2 file system without having to backup and restore data.

The ext3 file system adds, over its predecessor:

  • A journal
  • Tree-based directory indexes for directories spanning multiple blocks
  • Online filesystem resizing

Without these, any ext3 file system is also a valid ext2 file system. This has allowed well-tested and mature file system maintenance utilities for maintaining and repairing ext2 file systems to also be used with ext3 without major changes. The ext2 and ext3 file systems share the same standard set of utilities, e2fsprogs, which includes a fsck tool. The close relationship also makes conversion between the two file systems (both forward to ext3 and backward to ext2) straightforward.

There are three levels of journaling available in the Linux implementation of ext3:

  • Journal, where both metadata and file contents are written to the journal before being committed to the main filesystem. This improves reliability at a performance penalty because all data has to be written twice.
  • Writeback, where metadata is journaled but file contents are not. This is faster, but introduces the hazard of out-of-order writes where, for example, files being appended to during a crash may gain a tail of garbage on the next mount.
  • Ordered, is as with writeback, but forces file contents to be written before its associated metadata is marked as committed in the journal. This is thought to be an acceptable compromise between reliability and performance, and hence is the default.

Versions of ext3 since November 2004 also support online resizing. This means that an ext3 filesystem can be grown while being used, without unmounting.

Disadvantages

Since ext3 aims at being mostly compatible with ext2, many of the on-disk structures are similar to those of ext2. Because of that, ext3 lacks a number of features of more recent designs, such as dynamic allocation of i-nodes, variable block sizes (frags or tails), and, by default, hashed directories.

There is no ext3 defragmentation tool. An offline ext2 defragmenter, e2defrag, exists but requires that the ext3 filesystem be converted back to ext2 first. However, defragmentation has long been considered a non-issue for ext2/ext3, since they are much better at placing files on the disk versus old FAT-based filesystems.

Unlike ext2, ext3 zeroes out the block pointers in the inodes of deleted files. Because this removes all metadata for the affected files, the files cannot be recovered directly. The user's only recourse is to grep the hard drive for data known to signal the start and end of the file. This provides slightly more secure deletion than ext2, which can be either an advantage or a disadvantage.

Support for transparent compression (available as an unofficial patch for ext2) is not available in ext3.

Advantages

While in some contexts the lack of modern filesystem features such as dynamic inode allocation and tree-based data structures could be considered a disadvantage, in terms of recoverability this gives ext3 a significant advantage over filesystems with those features. The filesystem metadata is all in fixed, well-known locations, and there is some redundancy inherent in the data structures that allow ext2 and ext3 to be recoverable in the face of significant data corruption, where tree-based filesystems may not be recoverable.

Notes

  1. The maximum number of inodes (and hence the maximum number of files and directories) is set when the file system is created. If is the volume size in blocks, then the default number of inodes is given by , and the minimum by . The default was deemed sufficient for most applications.
  2. You can turn an ext3 filesystem back into ext2 by using tune2fs -O ^has_journal <device>. NOTE: it might be necessary to use the -f option in conjunction.

Ext3dev / Ext4

Another extension to the ext filesystem has been proposed, which will be called ext3dev while in development, and ext4 when stabilized. A couple of proposed features of this extension are delayed allocation, higher resolution timestamps[3], and support for larger volumes and file sizes.[4] More information is available at the ext3/ext4 development wiki.[5]

References

  1. ^ Stephen C. Tweedie (February 17 1999). "Re: fsync on large files". Linux kernel mailing list. {{cite web}}: Check date values in: |year= (help)CS1 maint: year (link)
  2. ^ Rob Radez (November 23 2001). "2.4.15-final". Linux kernel mailing list. {{cite web}}: Check date values in: |year= (help)CS1 maint: year (link)
  3. ^ Theodore Ts'o (June 28 2006). "Proposal and plan for ext2/3 future development work". Linux kernel mailing list. {{cite web}}: Check date values in: |year= (help)CS1 maint: year (link)
  4. ^ Mingming Cao (June 08 2006). "extents and 48bit ext3". Linux kernel mailing list. {{cite web}}: Check date values in: |year= (help)CS1 maint: year (link)
  5. ^ "EXT3 Filesystem Extents/64bit Project".

See also