Friday, April 22, 2011

Ext4 delayed allocation data loss

My Ubuntu (Maverick Meerkat) netbook crashed this week and completely wiped an open .odt document. The behavior was very similiar to what happened here. I'm not a file system guru so I wasn't aware until now of the long standing issue with Ext4 file system delayed allocation. From LinuxInsight:
In Ext4 file system, Delayed Allocation causes some extra risks of the data loss if your system gets crashed before all the data is written to hard drive.

This was also covered on slashdot over 2 years ago.

It appears that the transition to Ext4 requires applications properly use fsync() to prevent data loss. Theodore T'so, who played a major role in developing Ext4, includes a good summary here. In fact, Android devices which run on Ext4 are rolling out and preventing data loss has been a major concern.

I can't imagine the Open Office that ships with Ubuntu 10.10 doesn't adhere to the Ext4 spec and use fsync() properly but I've never had this problem in other apps. Very aggravating and perhaps another reason to use Google Docs or give Libre Office a try!

3 comments:

  1. There are a LOT of programs that relied on the ext3 disk flush in 5 second "side effect" unfortunately. It will be sometime before all applications in the current Linux world are properly updated or the System libraies updated to fill the gap of less than ideal written applications. (apparently lots of sloppying file writing routines) LibreOffice uses the same core libraies that OpenOffice does so its probable that it will act the same way for now until Apache (Oracle has passed the OO torch to them) does a few refinements (or LibreOffice). Best thing to do is redo your partition using ext3 for word processing apps until the ext4 behavior is accounted for in all major linux software: say 2-3 years...I could of course be wrong on that, but I figure its a safe bet.

    ReplyDelete
  2. On another note, unless privacy is of no concern I would not use Google Docs. Everything given to Google is collected. And I do mean EVERYTHING. (Unless you do an Internal network isntall of Google Docs and I'll bet you have to pay Google for that). I don't blame Google for this. They give free service, free storage and people just take it for granted and expect to give nothing in return.

    ReplyDelete
  3. I lost the file .xhb with homebank :/ in ext4

    ReplyDelete