You are not logged in.

#1 2009-12-28 12:47:53

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

ext3, ext4, crash, data loss

As you know, an OS crash may lead to reducing of size of an opened for writing file to zero, i.e. to data loss, see http://en.wikipedia.org/wiki/Ext4#Delay … _data_loss. Is there an example, how am I supposed to work with files to avoid data loss; not a hand-wavy explanation, but an example. I just want a file system to behave like a database, i.e. to perform update of a file in a single transaction. BTW is this problem present in btrfs, nilfs?


we are not condemned to write ugly code

Offline

#2 2009-12-28 13:18:17

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: ext3, ext4, crash, data loss

The `sync` command performs any cached filesystem operations, but I don't know how to stop them from being cached in the first place.

Offline

#3 2009-12-28 14:39:28

robmaloy
Member
From: Germany
Registered: 2008-05-14
Posts: 263

Re: ext3, ext4, crash, data loss

'sync' is also a mount option ('defaults' uses async)

also, always have backups of important files


☃ Snowman ☃

Offline

#4 2009-12-28 18:05:30

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: ext3, ext4, crash, data loss

Barrucadu wrote:

The `sync` command performs any cached filesystem operations, but I don't know how to stop them from being cached in the first place.

I am afraid that "sync" does not replace transactions. E.g. I open a file and perform a long-term write. During it OS crashes. This reduces file size to zero, is not it?


we are not condemned to write ugly code

Offline

Board footer

Powered by FluxBB