Ext4 data loss; explanations and workarounds

Last week’s announcement of possible data losses with Ext4 caused consternation and heated discussion. One user of an alpha version of Ubuntu 9.04 with Ext4 lost a large amount of data on a system crash immediately after starting KDE 4. Following a reboot, almost all the files written just before the crash showed a size of 0 bytes and were empty. He complained that nothing like that had ever happened to him with Ext3.

What had happened? When applications want to overwrite an existing file with new or changed data (for example, a configuration file after the user has changed a setting) frequently they first create a temporary file for the new data and then rename it with the system call – rename(). The logic behind this is that, if something goes wrong during the write process, say the computer crashes or there’s a power failure, at least the old version of the file will be retained.

Read more at H-online

Comments are closed.