Recital

Login Register

Ext3 -vs- Ext4 with regard to write commit times.

A number of people have complained about data loss after a system crash when using Ext4.  A bug report was logged. According to multiple posts by a developer of Ext4, Theodore Tso, this is due to differences in approach to security and performance issues between the two file systems.

Ext3 commits writes to disk within approximately 5 seconds - Ext4 can take from 40-150 seconds.  In addition, if a system is using Ext3 and crashes before the commit takes place you will still have the previous contents of a file where under Ext4 the file will be empty.  Theodore Tso feels that this is a failure at the application level and that the file system is behaving as designed and as specified by the POSIX spec (which apparently does not specify what is supposed to happen when a system is not shut down cleanly).  His solution to the issue is to suggest proper use of fsync() and lists various scenarios/examples in post 54 of the bug report (linked above).  In addition he wrote a patch that recognize the rename() situation mentioned in his post 54 yet retains the normal Ext4 behaviors and performance in the majority of cases.  Also a more "proper" solution has been provided which allows the behavior of Ext3 to be retained under Ext4 by mounting it with alloc_on_commit.

A somewhat related topic is the use of on-board caching by hard drives.  This behavior can be modified on most drives by using hdparm.
Twitter

Copyright © 2024 Recital Software Inc.

Login

Register

User Registration
or Cancel