El Mar 26 Feb 2002 10:40, escribiste:
> as it turned out my /usr/share/config/kdm/kdmrc was
> hosed. Unfortunately even kcontrol did not reset it up
> properly. Fortunately I had another server that I
> could pull the config files from to get it running
> again. My /usr directory is using xfs and I suspect
> that all of my laptop crash tests (trying to
> suspend/resume) may be creating some file corruption.
> I also had something like this happen to my kmailrc
> file (but my /home directory is on reiserfs) Where it
> looked like part of the autobookmarks or something
> like that took over part of the kmailrc file.
>
> Is it really this easy to corrupt files using these
> journaled file systems?

        From the XFS FAQ:

"
Q: Why do I see binary NULLS in some files after recovery when I unplugged the 
power?

If it hurts don't do that!

Basically this is normal behavior. XFS journals metadata updates, not data 
updates. After a crash you are supposed to get a consistent filesystem which 
looks like the state sometime shortly before the crash, NOT what the in 
memory image looked like the instant before the crash. Since XFS does not 
write data out to disk immediately unless you tell it to with fsync or an 
O_SYNC open (the same is true of other filesystems), you are looking at an 
inode which was flushed out to disk, but for which the data was never flushed 
to disk. You will find that the inode is not taking any disk space since all 
it has is a size, there are no disk blocks allocated for it yet.

This same will apply to other metadata only journaling filesystems. The 
current linux kernel VM will write out the metadata after 1/60th of a second 
and the data after 30 seconds. So the possibility of losing data when 
unplugging the power within 30 seconds is quite large. The only way of being 
sure that your data will get to the disk is using fsync in the program of 
sync after closing the program.
"

        There is also a thread about this in the linux-xfs mailing list. You can see 
it at:

        http://marc.theaimsgroup.com/?l=linux-xfs&m=100607082003066&w=2


Reply via email to