Subject: Re: file truncated to zero length after reboot
To: David Young <>
From: Charles M. Hannum <>
List: tech-kern
Date: 12/22/2004 03:58:10
On Wednesday 22 December 2004 00:33, David Young wrote:
> On Wed, Dec 22, 2004 at 12:20:38AM +0000, Charles M. Hannum wrote:
> > On Wednesday 22 December 2004 00:08, David Young wrote:
> > > My project uses Soekris (i386) boards with CF cards.  I don't know if
> > > this is related, but if I mount a normally read-only FFS filesystem
> > > read-write, create a non-empty file on the filesystem, remount
> > > read-only, and reboot, the file is truncated to zero length after
> > > reboot.  Sometimes, if I write a second file before remounting
> > > read-only, then the first file is not truncated, but the second is.  I
> > > cannot reproduce this bug with perfect reliability.
> >
> > No, this is totally unrelated.
> Do know what causes it?

Remounting from r-w to r-o has always been a little scary, but around the time 
softdep went in, it became quite unreliable without doing a sync(8) first.  
I'm not sure whether it's only with softdep or not, but I've seen this 
*exact* symptom on a hard disk before.