[Top] [All Lists]

Re: XFS, empty files after a crash

To: kadafax@xxxxxxxxx
Subject: Re: XFS, empty files after a crash
From: Stan Hoeppner <stan@xxxxxxxxxxxxxxxxx>
Date: Tue, 21 Feb 2012 11:39:23 -0600
Cc: xfs@xxxxxxxxxxx
In-reply-to: <4F4387A7.2070009@xxxxxxxxx>
References: <4F4387A7.2070009@xxxxxxxxx>
Reply-to: stan@xxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
On 2/21/2012 6:01 AM, kfx wrote:

> After a crash, a lot of files on a xfs file system report an empty size
> with "ls -a" but not with "du".
> xfs_check and xfs_repair don't report any problem to repair (although an
> internal log is used) :(
> So if I understand correctly, those empty files actually use space on
> the disk but are incorrectly reported as empty by the system.
> Is there a way to copy back the used blocks to recover the files ?

What was the nature of the crash?  Kernel panic?  Power failure?  Other?

Do you have have backups of previously existing files that are now shown
as zero size?  If so delete and restore, maybe just overwrite.

For new files that were in the process of being created you're simply
out of luck.  The metadata may have hit the journal but the file data in
buffer cache was lost.

In memory write buffering/ordering techniques are what give modern
filesystems their write throughput performance.  Unfortunately this
comes at a cost, when systems crash.  As Peter mentioned, one way to
mitigate this is coding apps to sync their writes.  This obviously has a
performance impact.  Another is possibly to mount filesystems with the
sync option, which will obviously severely impact write performance.
Both will prevent or at least lessen the carnage you've seen as a result
of this crash.  You may not be able to live the performance of the
latter, though.


<Prev in Thread] Current Thread [Next in Thread>