Re: XFS: how to NOT null files on fsck?

Bernd Eckenfels
2004-07-13T01:44:55Z

In article <20040712225338.GD23623@taniwha.stupidest.org> you wrote:
> To be quite honest I've never seen nulls in files that a days old, and
> I have scripts which checksum (md5) my files (hundreds of gigabytes)
> which would notice this, so knowing how to reproduce it would be nice.

I can say, that nulls in files are most common at the end of (sys)log files
filing up to the next block boundary. I always asumed this is due to the
fact that the filesize in the metadata was not written but the last
half-finished block was already linked in the inode structure.

I have never seen null filled data or config files other than that, but I
do not have busy servers crashing often on me.

> Log was being appended, system crashed, you get nulls at the end when
> rebootd, the logger opens the file append and starts writing stuff,
> the nulls end up in the middle. Arguably this is expected.

Yes, and it is normally easy to spot, since the messages after the nulls are
boot messages.

> see the nulls. I'm pretty sure for you the nulls are not really
> on-disk, looking at the raw device you won't see them. They nulls are
> returns for unwritten extents just as nulls are returned for holes in
> sparse files.

ls -s compared with ls -l should make that visible?

Greetings
Bernd
--
eckes privat - http://www.eckes.org/
Project Freefire - http://www.freefire.org/