Ext4 Users Report Data Loss
The Ubuntu User Forum reports users with data loss after installing applications on the ext4 filesystem. Kernel developer Ted Ts'o is already on top of it.
A user reported as bug #317781 the data loss problem involving a Kubuntu Jaunty installation on the ext4 filesystem: "The first time I had this problem was a few days ago when after a power loss ktimetracker's config file was replaced by a 0 byte version." The problem recurred during a system failure: "After a clean reboot pretty much any file written to by any application (during the previous boot) was 0 bytes." In his case the KDE and Plasma configuration data was reset and MySQL files vanished. Another user ran into the same issue with a Gentoo installation on ext4.
As it became clear that the issue was hitting a number of users, kernel expert and pioneer ext4 developer Theodore Ts'o rushed into the discussion: "The short answer is (a) yes, I'm aware of it, (b) there is a (partial) solution, (c) it's not yet in mainline, and as far as I know, not in an Ubuntu Kernel, but it is queued for integration at the next merge window, after 2.6.29 releases, and (d) this is really more of an application design problem more than anything else."
Ts'o, current chief technologist at the Linux Foundation, took time in his responses to the bug to explain his work on ext4 and hands-on approaches to resolving the data loss problem (especially in this reply). He sees the cause of the problem to be the delayed allocation before a data commit in ext4 of 60 seconds (designed to enhance security and performance). The ext3 interval used to be 5 seconds, which Ts'o says began to be an expectation among developers: "Since ext3 became the dominant filesystem for Linux, application writers and users have started depending on this, and so they become shocked and angry when their system locks up and they lose data --- even though POSIX never really made any such guaranteed."
To help ease the file loss problem, Ts'o recommends for both ext3 and ext4, "If you want to force things to be stored on disk, you must use fsync() or fdatasync()." As an aside, Linux Magazine Online recently aired a video of Ts'o describing the stability of ext4 and its advantages over the experimental btrfs filesystem.
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
First Release Candidate for Linux Kernel 6.14 Now Available
Linus Torvalds has officially released the first release candidate for kernel 6.14 and it includes over 500,000 lines of modified code, making for a small release.
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.