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
-
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.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.