Next Previous Contents

2. Why to migrate to EXT3 ?

Why do you want to migrate from ext2 to ext3? Four main reasons: availability, data integrity, speed, and easy transition.

Here is why in the words of Michael K. Johnson :

Availability:
After an unclean system shutdown (unexpected power failure, system crash), each ext2 file system cannot be mounted until its consistency has been checked by the e2fsck program. The amount of time that the e2fsck program takes is determined primarily by the size of the file system, and for today's relatively large (many tens of gigabytes) file systems, this takes a long time. Also, the more files you have on the file system, the longer the consistency check takes. File systems several hundreds of gigabytes in size may take an hour or more to check. This severely limits availability.

By contrast, ext3 does not require a file system check even after an unclean system shutdown, except for certain rare hardware failure cases (e.g. hard drive failures), because the data is written to disk in such a way that the file system is always consistent. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the "journal" used to maintain consistency. The default journal size takes about a second to recover (depends on the speed of the hardware).

Data integrity:
Using the ext3 file system can provide stronger guarantees about data integrity in case of an unclean system shutdown. You have a choice of how carefully to protect your data. Essentially, you can choose either to keep the file system consistent but allow for damage to data on the file system in the case of unclean system shutdown (for a modest speed up under some but not all circumstances) or to ensure that the data is consistent with the state of the file system (which means that you will never see garbage data in recently-written files after a crash.) The more safe choice to keep the data consistent with the state of the file system is the default.

Since ext3 has the same on-disk format as ext2 it can use the very well tested and reliable e2fsck to ensure filesystem integrity and recover from errors, when this is needed.

Speed:
Despite writing some data more than once, ext3 is often faster (higher throughput) than ext2 because ext3's journaling optimizes hard drive head motion. You can choose from three journaling modes to optimize speed, optionally choosing to trade off some data integrity. One mode, data=writeback, limits the data integrity guarantees, allowing old data to show up in files after a crash, for a potential increase in speed under some circumstances. This mode, which is the default journaling mode for most journaling file systems, essentially provides the more limited data integrity guarantees of the ext2 file system and merely avoids the long file system check at boot time. The second mode, data=ordered (the default mode), guarantees that the data is consistent with the file system: recently-written files will never show up with garbage contents after a crash. The last mode, data=journal, requires a larger journal for reasonable speed in most cases and therefore takes longer to recover in case of unclean shutdown, but is sometimes faster for certain database operations, NFS, and synchronous MTA (mail server) operations. The default mode is recommended for all general-purpose computing needs.

Easy transition:
It is easy to change from ext2 to ext3 and gain the benefits of a robust journaling file system, without reformatting. That's right, no need to do a long, tedious, and error-prone backup, reformat, restore operation in order to experience the advantages of ext3.

It is also possible to use an "ext3" filesystem with older kernels that only understand ext2, as long as the filesystem has been cleanly umounted or if e2fsck (1.20+) is run on it.


Next Previous Contents